From ae6ce2b8712e217c35bcd2698811ae0af49d3e2d Mon Sep 17 00:00:00 2001 From: Micah Tigley Date: Fri, 10 Jul 2020 16:55:35 +0000 Subject: [PATCH] Bug 1634497 - Remove `browser.outerBrowser` checks used for old-RDM. r=bgrins Differential Revision: https://phabricator.services.mozilla.com/D83132 --- browser/actors/AboutReaderParent.jsm | 4 ---- browser/actors/BrowserTabParent.jsm | 4 ---- browser/actors/ClickHandlerParent.jsm | 6 ------ browser/actors/ContentMetaParent.jsm | 5 ----- browser/actors/EncryptedMediaParent.jsm | 5 ----- browser/actors/LinkHandlerParent.jsm | 5 ----- browser/actors/PageStyleParent.jsm | 5 ----- browser/actors/WebRTCParent.jsm | 7 +------ browser/base/content/pageinfo/pageInfo.js | 5 ----- browser/components/translation/TranslationParent.jsm | 3 +-- browser/extensions/formautofill/FormAutofillParent.jsm | 4 ---- toolkit/actors/ControllersParent.jsm | 8 +------- toolkit/actors/PopupBlockingParent.jsm | 4 ---- toolkit/actors/SelectParent.jsm | 10 ---------- toolkit/components/pdfjs/content/PdfjsParent.jsm | 6 +----- 15 files changed, 4 insertions(+), 77 deletions(-) diff --git a/browser/actors/AboutReaderParent.jsm b/browser/actors/AboutReaderParent.jsm index 20bb1b3be315..d1647ad6f90d 100644 --- a/browser/actors/AboutReaderParent.jsm +++ b/browser/actors/AboutReaderParent.jsm @@ -144,10 +144,6 @@ class AboutReaderParent extends JSWindowActorParent { return undefined; } - if (browser.outerBrowser) { - browser = browser.outerBrowser; // handle RDM mode - } - if (message.data && message.data.isArticle !== undefined) { browser.isArticle = message.data.isArticle; } diff --git a/browser/actors/BrowserTabParent.jsm b/browser/actors/BrowserTabParent.jsm index bc14a74ce072..7a1dc62ba4fb 100644 --- a/browser/actors/BrowserTabParent.jsm +++ b/browser/actors/BrowserTabParent.jsm @@ -16,10 +16,6 @@ class BrowserTabParent extends JSWindowActorParent { return; // Can happen sometimes if browser is being destroyed } - if (browser.outerBrowser) { - browser = browser.outerBrowser; // handle RDM mode - } - let gBrowser = browser.ownerGlobal.gBrowser; switch (message.name) { diff --git a/browser/actors/ClickHandlerParent.jsm b/browser/actors/ClickHandlerParent.jsm index c0783ba4c1ad..75509b95ce7f 100644 --- a/browser/actors/ClickHandlerParent.jsm +++ b/browser/actors/ClickHandlerParent.jsm @@ -55,9 +55,6 @@ class ClickHandlerParent extends JSWindowActorParent { // This is heavily based on contentAreaClick from browser.js (Bug 903016) // The data is set up in a way to look like an Event. let browser = this.manager.browsingContext.top.embedderElement; - if (browser.outerBrowser) { - browser = browser.outerBrowser; // handle RDM mode - } let window = browser.ownerGlobal; if (!data.href) { @@ -124,9 +121,6 @@ class ClickHandlerParent extends JSWindowActorParent { for (let listener of gContentClickListeners) { try { let browser = this.browsingContext.top.embedderElement; - if (browser.outerBrowser) { - browser = browser.outerBrowser; // Special-case responsive design mode - } listener.onContentClick(browser, data); } catch (ex) { diff --git a/browser/actors/ContentMetaParent.jsm b/browser/actors/ContentMetaParent.jsm index 5c839378f0b0..ddad35883b39 100644 --- a/browser/actors/ContentMetaParent.jsm +++ b/browser/actors/ContentMetaParent.jsm @@ -11,11 +11,6 @@ class ContentMetaParent extends JSWindowActorParent { if (message.name == "Meta:SetPageInfo") { let browser = this.manager.browsingContext.top.embedderElement; if (browser) { - if (browser.outerBrowser) { - // Responsive design mode check - browser = browser.outerBrowser; - } - let gBrowser = browser.ownerGlobal.gBrowser; if (gBrowser) { gBrowser.setPageInfo( diff --git a/browser/actors/EncryptedMediaParent.jsm b/browser/actors/EncryptedMediaParent.jsm index a4a686a46846..ddddda997b09 100644 --- a/browser/actors/EncryptedMediaParent.jsm +++ b/browser/actors/EncryptedMediaParent.jsm @@ -92,11 +92,6 @@ class EncryptedMediaParent extends JSWindowActorParent { return; } - if (browser.outerBrowser) { - // Responsive design mode check - browser = browser.outerBrowser; - } - let parsedData; try { parsedData = JSON.parse(aMessage.data); diff --git a/browser/actors/LinkHandlerParent.jsm b/browser/actors/LinkHandlerParent.jsm index ef39489b08c0..a61a4dded031 100644 --- a/browser/actors/LinkHandlerParent.jsm +++ b/browser/actors/LinkHandlerParent.jsm @@ -31,11 +31,6 @@ class LinkHandlerParent extends JSWindowActorParent { return; } - if (browser.outerBrowser) { - // Responsive design mode check - browser = browser.outerBrowser; - } - let win = browser.ownerGlobal; let gBrowser = win.gBrowser; diff --git a/browser/actors/PageStyleParent.jsm b/browser/actors/PageStyleParent.jsm index 1638fbdcc0da..aba972ec0b82 100644 --- a/browser/actors/PageStyleParent.jsm +++ b/browser/actors/PageStyleParent.jsm @@ -22,11 +22,6 @@ class PageStyleParent extends JSWindowActorParent { switch (msg.name) { case "PageStyle:Add": - if (browser.outerBrowser) { - // We are in RDM mode and we probably - // want to work with the outer browser. - browser = browser.outerBrowser; - } styleMenu.addBrowserStyleSheets(msg.data, permanentKey); break; case "PageStyle:Clear": diff --git a/browser/actors/WebRTCParent.jsm b/browser/actors/WebRTCParent.jsm index a07e91ed72a4..f72c5ed35eec 100644 --- a/browser/actors/WebRTCParent.jsm +++ b/browser/actors/WebRTCParent.jsm @@ -52,12 +52,7 @@ class WebRTCParent extends JSWindowActorParent { } getBrowser() { - let browser = this.browsingContext.top.embedderElement; - if (browser && browser.outerBrowser) { - // Responsive design mode check - browser = browser.outerBrowser; - } - return browser; + return this.browsingContext.top.embedderElement; } receiveMessage(aMessage) { diff --git a/browser/base/content/pageinfo/pageInfo.js b/browser/base/content/pageinfo/pageInfo.js index 2f5b9471dac9..f2fc6aed7057 100644 --- a/browser/base/content/pageinfo/pageInfo.js +++ b/browser/base/content/pageinfo/pageInfo.js @@ -337,11 +337,6 @@ async function loadPageInfo(browsingContext, imageElement, browser) { browser = browser || window.opener.gBrowser.selectedBrowser; browsingContext = browsingContext || browser.browsingContext; - if (browser.outerBrowser) { - //We are in RDM mode - browser = browser.outerBrowser; - } - let actor = browsingContext.currentWindowGlobal.getActor("PageInfo"); let result = await actor.sendQuery("PageInfo:getData"); diff --git a/browser/components/translation/TranslationParent.jsm b/browser/components/translation/TranslationParent.jsm index cf8e310a66f6..a87a4a512725 100644 --- a/browser/components/translation/TranslationParent.jsm +++ b/browser/components/translation/TranslationParent.jsm @@ -132,8 +132,7 @@ class TranslationParent extends JSWindowActorParent { } get browser() { - let browser = this.browsingContext.top.embedderElement; - return browser.outerBrowser ? browser.outerBrowser : browser; + return this.browsingContext.top.embedderElement; } receiveMessage(aMessage) { diff --git a/browser/extensions/formautofill/FormAutofillParent.jsm b/browser/extensions/formautofill/FormAutofillParent.jsm index f6f01f898b62..4b895c4bd512 100644 --- a/browser/extensions/formautofill/FormAutofillParent.jsm +++ b/browser/extensions/formautofill/FormAutofillParent.jsm @@ -749,10 +749,6 @@ class FormAutofillParent extends JSWindowActorParent { } let browser = this.manager.browsingContext.top.embedderElement; - if (browser && browser.outerBrowser) { - // Responsive design mode check - browser = browser.outerBrowser; - } // Transmit the telemetry immediately in the meantime form submitted, and handle these pending // doorhangers at a later. diff --git a/toolkit/actors/ControllersParent.jsm b/toolkit/actors/ControllersParent.jsm index 09185f9b0dc2..3f912076cbcc 100644 --- a/toolkit/actors/ControllersParent.jsm +++ b/toolkit/actors/ControllersParent.jsm @@ -17,13 +17,7 @@ class ControllersParent extends JSWindowActorParent { } get browser() { - let browser = this.browsingContext.top.embedderElement; - if (browser) { - if (browser.outerBrowser) { - browser = browser.outerBrowser; // handle RDM - } - } - return browser; + return this.browsingContext.top.embedderElement; } // Update the set of enabled and disabled commands. diff --git a/toolkit/actors/PopupBlockingParent.jsm b/toolkit/actors/PopupBlockingParent.jsm index 54e26a20637b..8c7dc4ab335f 100644 --- a/toolkit/actors/PopupBlockingParent.jsm +++ b/toolkit/actors/PopupBlockingParent.jsm @@ -266,10 +266,6 @@ class PopupBlockingParent extends JSWindowActorParent { return; } - if (browser.outerBrowser) { - browser = browser.outerBrowser; // handle RDM mode - } - browser.popupBlocker._updateBlockedPopupEntries(this.browsingContext, data); } } diff --git a/toolkit/actors/SelectParent.jsm b/toolkit/actors/SelectParent.jsm index 669ae0591408..cc0e577fefe6 100644 --- a/toolkit/actors/SelectParent.jsm +++ b/toolkit/actors/SelectParent.jsm @@ -710,11 +710,6 @@ class SelectParent extends JSWindowActorParent { let topBrowsingContext = this.manager.browsingContext.top; let browser = topBrowsingContext.embedderElement; - if (browser.outerBrowser) { - // We are in RDM mode - browser = browser.outerBrowser; - } - if (!browser.hasAttribute("selectmenulist")) { return; } @@ -759,11 +754,6 @@ class SelectParent extends JSWindowActorParent { let topBrowsingContext = this.manager.browsingContext.top; let browser = topBrowsingContext.embedderElement; - if (browser.outerBrowser) { - // We are in RDM mode - browser = browser.outerBrowser; - } - SelectParentHelper.hide(this._menulist, browser); break; } diff --git a/toolkit/components/pdfjs/content/PdfjsParent.jsm b/toolkit/components/pdfjs/content/PdfjsParent.jsm index 005118a2ed32..e1ba74166a64 100644 --- a/toolkit/components/pdfjs/content/PdfjsParent.jsm +++ b/toolkit/components/pdfjs/content/PdfjsParent.jsm @@ -76,11 +76,7 @@ class PdfjsParent extends JSWindowActorParent { */ get browser() { - let browser = this.browsingContext.top.embedderElement; - if (browser.outerBrowser) { - browser = browser.outerBrowser; // handle RDM mode - } - return browser; + return this.browsingContext.top.embedderElement; } _updateControlState(aMsg) {