Bug 1281493 - Add another selector for identity popup main view as XBL bindings sometimes have a race condition. Removing surplus identity-popup-security-content selector.
MozReview-Commit-ID: DxAX18vGXHN
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -6582,23 +6582,35 @@ var gIdentityHandler = {
get _identityPopup () {
delete this._identityPopup;
return this._identityPopup = document.getElementById("identity-popup");
},
get _identityBox () {
delete this._identityBox;
return this._identityBox = document.getElementById("identity-box");
},
+ get _identityPopupMultiView () {
+ delete _identityPopupMultiView;
+ return document.getElementById("identity-popup-multiView");
+ },
get _identityPopupContentHosts () {
delete this._identityPopupContentHosts;
- return this._identityPopupContentHosts = [...document.querySelectorAll(".identity-popup-headline.host")];
+ let selector = ".identity-popup-headline.host";
+ return this._identityPopupContentHosts = [
+ ...this._identityPopupMultiView._mainView.querySelectorAll(selector),
+ ...document.querySelectorAll(selector)
+ ];
},
get _identityPopupContentHostless () {
delete this._identityPopupContentHostless;
- return this._identityPopupContentHostless = [...document.querySelectorAll(".identity-popup-headline.hostless")];
+ let selector = ".identity-popup-headline.hostless";
+ return this._identityPopupContentHostless = [
+ ...this._identityPopupMultiView._mainView.querySelectorAll(selector),
+ ...document.querySelectorAll(selector)
+ ];
},
get _identityPopupContentOwner () {
delete this._identityPopupContentOwner;
return this._identityPopupContentOwner =
document.getElementById("identity-popup-content-owner");
},
get _identityPopupContentSupp () {
delete this._identityPopupContentSupp;
@@ -6648,17 +6660,17 @@ var gIdentityHandler = {
*/
handleMoreInfoClick : function(event) {
displaySecurityInfo();
event.stopPropagation();
this._identityPopup.hidePopup();
},
toggleSubView(name, anchor) {
- let view = document.getElementById("identity-popup-multiView");
+ let view = this._identityPopupMultiView;
if (view.showingSubView) {
view.showMainView();
} else {
view.showSubView(`identity-popup-${name}View`, anchor);
}
// If an element is focused that's not the anchor, clear the focus.
// Elements of hidden views have -moz-user-focus:ignore but setting that
--- a/browser/base/content/test/general/head.js
+++ b/browser/base/content/test/general/head.js
@@ -875,17 +875,16 @@ function assertMixedContentBlockingState
is(popupAttr.includes("passive-loaded"), passiveLoaded,
"identity-popup has expected attr for passiveLoaded");
is(bodyAttr.includes("passive-loaded"), passiveLoaded,
"securityView-body has expected attr for passiveLoaded");
// Make sure the correct icon is visible in the Control Center.
// This logic is controlled with CSS, so this helps prevent regressions there.
let securityView = doc.getElementById("identity-popup-securityView");
- let securityContent = doc.getElementById("identity-popup-security-content");
let securityViewBG = tabbrowser.ownerGlobal.getComputedStyle(securityView, "").
getPropertyValue("background-image");
let securityContentBG = tabbrowser.ownerGlobal.getComputedStyle(securityView, "").
getPropertyValue("background-image");
if (stateInsecure) {
is(securityViewBG, "url(\"chrome://browser/skin/controlcenter/conn-not-secure.svg\")",
"CC using 'not secure' icon");