From 1a20c85c2d0b2953d2b868919741accdb834273a Mon Sep 17 00:00:00 2001 From: Jonathan Kingston Date: Tue, 28 Jun 2016 14:18:02 +0100 Subject: [PATCH] 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. r=gijs MozReview-Commit-ID: DxAX18vGXHN --HG-- extra : transplant_source : %5C%84%F0%E3%FE%B5%05%11%23g9r%5B%0AG%E2%06%92%7E%7E --- browser/base/content/browser.js | 18 +++++++++++++++--- browser/base/content/test/general/head.js | 1 - 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 0b6f29f8f771..6117295bdd1d 100755 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -6574,13 +6574,25 @@ var gIdentityHandler = { 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; @@ -6640,7 +6652,7 @@ var gIdentityHandler = { }, toggleSubView(name, anchor) { - let view = document.getElementById("identity-popup-multiView"); + let view = this._identityPopupMultiView; if (view.showingSubView) { view.showMainView(); } else { diff --git a/browser/base/content/test/general/head.js b/browser/base/content/test/general/head.js index c378b8769e50..056c24895041 100644 --- a/browser/base/content/test/general/head.js +++ b/browser/base/content/test/general/head.js @@ -767,7 +767,6 @@ function assertMixedContentBlockingState(tabbrowser, states = {}) { // 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, "").