Bug 1466256 - Fix how PageStyleHandler.jsm gets the message manager. r=Gijs
authorFelipe Gomes <felipc@gmail.com>
Mon, 18 Jun 2018 15:11:00 -0300
changeset 479614 99e9b6c6a801e4e1df5ced3eb58b511fd533715d
parent 479613 4eae98be3a4fe1a0454509537f886ad7a32c2fb9
child 479615 dce162499c06632bdff5bb7775cb5f476d781f1a
push id1757
push userffxbld-merge
push dateFri, 24 Aug 2018 17:02:43 +0000
treeherdermozilla-release@736023aebdb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1466256
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1466256 - Fix how PageStyleHandler.jsm gets the message manager. r=Gijs This should make it work for both remote and non-remote pages. MozReview-Commit-ID: CpnGd0PoTGn
browser/modules/PageStyleHandler.jsm
--- a/browser/modules/PageStyleHandler.jsm
+++ b/browser/modules/PageStyleHandler.jsm
@@ -46,18 +46,20 @@ var PageStyleHandler = {
   },
 
   handleEvent(event) {
     let win = event.target.ownerGlobal;
     if (win != win.top) {
       return;
     }
 
-    let {docShell} = win.document;
-    this.sendStyleSheetInfo(docShell.tabChild.messageManager);
+    let mm = win.document.docShell
+                .QueryInterface(Ci.nsIInterfaceRequestor)
+                .getInterface(Ci.nsIContentFrameMessageManager);
+    this.sendStyleSheetInfo(mm);
   },
 
   _stylesheetSwitchAll(frameset, title) {
     if (!title || this._stylesheetInFrame(frameset, title)) {
       this._stylesheetSwitchFrame(frameset, title);
     }
 
     for (let i = 0; i < frameset.frames.length; i++) {