Backed out changeset 98c3d77b4330 (bug 1899757) for causing multiple failures CLOSED TREE
This commit is contained in:
@@ -1942,17 +1942,6 @@ export class _ASRouter {
|
||||
if (!skipLoadingMessages) {
|
||||
await this.loadMessagesFromAllProviders();
|
||||
}
|
||||
// Implement the global `browserIsSelected` context property.
|
||||
if (browser?.constructor.name === "MozBrowser" && trigger) {
|
||||
if (!Object.prototype.hasOwnProperty.call(trigger, "context")) {
|
||||
trigger.context = {};
|
||||
}
|
||||
if (typeof trigger.context === "object") {
|
||||
trigger.context.browserIsSelected =
|
||||
trigger.context.browserIsSelected ||
|
||||
browser === browser.getTabBrowser().selectedBrowser;
|
||||
}
|
||||
}
|
||||
const telemetryObject = { tabId };
|
||||
TelemetryStopwatch.start("MS_MESSAGE_REQUEST_TIME_MS", telemetryObject);
|
||||
// Return all the messages so that it can record the Reach event
|
||||
|
||||
@@ -556,10 +556,7 @@ export class FeatureCallout {
|
||||
);
|
||||
continue;
|
||||
}
|
||||
let { selector, arrow_position, panel_position } = anchor;
|
||||
if (!selector) {
|
||||
continue; // No selector provided.
|
||||
}
|
||||
const { selector, arrow_position, panel_position } = anchor;
|
||||
if (panel_position) {
|
||||
let panel_position_string =
|
||||
this._getPanelPositionString(panel_position);
|
||||
@@ -590,28 +587,7 @@ export class FeatureCallout {
|
||||
);
|
||||
continue;
|
||||
}
|
||||
let scope = this.doc.documentElement;
|
||||
// %triggerTab% is a special token that gets replaced with :scope, and
|
||||
// instructs us to look for the anchor element within the trigger tab.
|
||||
if (this.browser && selector.includes("%triggerTab%")) {
|
||||
let triggerTab = this.browser
|
||||
.getTabBrowser?.()
|
||||
.getTabForBrowser(this.browser);
|
||||
if (triggerTab) {
|
||||
selector = selector.replace("%triggerTab%", ":scope");
|
||||
scope = triggerTab;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
let element = scope.querySelector(selector);
|
||||
// The element may not be a child of the scope, but the scope itself. For
|
||||
// example, if we're anchoring directly to the trigger tab, our selector
|
||||
// might look like `%triggerTab%[visuallyselected]`. In this case,
|
||||
// querySelector() will return nothing, but matches() will return true.
|
||||
if (!element && scope.matches(selector)) {
|
||||
element = scope;
|
||||
}
|
||||
const element = selector && this.doc.querySelector(selector);
|
||||
if (!element) {
|
||||
continue; // Element doesn't exist at all.
|
||||
}
|
||||
@@ -638,7 +614,7 @@ export class FeatureCallout {
|
||||
if (
|
||||
this.context === "chrome" &&
|
||||
element.id &&
|
||||
selector.includes(`#${element.id}`)
|
||||
anchor.selector.includes(`#${element.id}`)
|
||||
) {
|
||||
let widget = lazy.CustomizableUI.getWidget(element.id);
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user