Backed out changeset 234a8e0fb95f (bug 1874952) for causing mochitests in browser_doorhanger_remembering.js. CLOSED TREE

This commit is contained in:
Stanca Serban
2024-02-03 20:15:38 +02:00
parent 11ac4daf59
commit 2c24c9c59e
4 changed files with 12 additions and 8 deletions

View File

@@ -2663,7 +2663,7 @@ var gProtectionsHandler = {
} else { } else {
this._protectionsPopup.hidePopup(); this._protectionsPopup.hidePopup();
ConfirmationHint.show( ConfirmationHint.show(
this._trackingProtectionIconContainer, this.iconBox,
"confirmation-hint-breakage-report-sent" "confirmation-hint-breakage-report-sent"
); );
} }

View File

@@ -9946,7 +9946,7 @@ var ConfirmationHint = {
); );
this._panel.openPopup(anchor, { this._panel.openPopup(anchor, {
position: options.position ?? "bottomleft topleft", position: options.position ?? "bottomcenter topleft",
triggerEvent: options.event, triggerEvent: options.event,
}); });
}, },

View File

@@ -604,8 +604,15 @@ export class LoginManagerPrompter {
}); });
Services.logins.removeLogin(matchingLogins[0]); Services.logins.removeLogin(matchingLogins[0]);
browser.focus(); browser.focus();
// The "password-notification-icon" and "notification-icon-box" are hidden
// at this point, so approximate the location with the next closest,
// visible icon as the anchor.
const anchor = browser.ownerDocument.getElementById("identity-icon");
lazy.log.debug("Showing the ConfirmationHint"); lazy.log.debug("Showing the ConfirmationHint");
showConfirmation(browser, "confirmation-hint-password-removed"); anchor.ownerGlobal.ConfirmationHint.show(
anchor,
"confirmation-hint-password-removed"
);
}, },
}); });
} }

View File

@@ -26,15 +26,12 @@ export class GenericAutocompleteItem {
* *
* @param {object} browser - An object representing the browser. * @param {object} browser - An object representing the browser.
* @param {string} messageId - Message ID from browser/confirmationHints.ftl * @param {string} messageId - Message ID from browser/confirmationHints.ftl
* @param {string} [anchorId="identity-icon-box"] - ID of the element to anchor the hint to. * @param {string} [anchorId="identity-icon"] - ID of the element to anchor the hint to.
The "password-notification-icon" and "notification-popup-box" are hidden
at the point of showing the hint (for *most* cases), so approximate the
location with the next closest, visible icon as the anchor.
*/ */
export function showConfirmation( export function showConfirmation(
browser, browser,
messageId, messageId,
anchorId = "identity-icon-box" anchorId = "identity-icon"
) { ) {
const anchor = browser.ownerDocument.getElementById(anchorId); const anchor = browser.ownerDocument.getElementById(anchorId);
anchor.ownerGlobal.ConfirmationHint.show(anchor, messageId, {}); anchor.ownerGlobal.ConfirmationHint.show(anchor, messageId, {});