Bug 1364364 - Part 6: Re-connect nsDocViewerFocusListener in nsDocumentViewer::Open. r=smaug
☠☠ backed out by 710a16034611 ☠ ☠
authorSamael Wang <freesamael@gmail.com>
Tue, 05 Sep 2017 18:16:10 +0800
changeset 428954 f562d0ea59ef5967b3dc74d1f836c04ed4b97286
parent 428953 0458fccefb5c19786f6ca73461234d20f54a4fb7
child 428955 14c9d45b617583a7aeb0807526ea229a930c52ef
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1364364
milestone57.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 1364364 - Part 6: Re-connect nsDocViewerFocusListener in nsDocumentViewer::Open. r=smaug I noticed this error message on fixing dom/workers/test/test_suspend.html: WARNING: NS_ENSURE_TRUE(mDocViewer) failed: file layout/base/nsDocumentViewer.cpp, line 3863 It happens when a nsDocumentViewer::Close() is followed by a nsDocumentViewer::Open(), the viewer would have been disconnected. Since it takes only one-line change to fix I just include it in this bug. MozReview-Commit-ID: LMT2PJkUqi1
layout/base/nsDocumentViewer.cpp
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -1502,16 +1502,18 @@ nsDocumentViewer::Open(nsISupports *aSta
       nsCOMPtr<nsIDocShell> shell = do_QueryInterface(item);
       AttachContainerRecurse(shell);
     }
   }
 
   SyncParentSubDocMap();
 
   if (mFocusListener && mDocument) {
+    // The focus listener may have been disconnected.
+    mFocusListener->Init(this);
     mDocument->AddEventListener(NS_LITERAL_STRING("focus"), mFocusListener,
                                 false, false);
     mDocument->AddEventListener(NS_LITERAL_STRING("blur"), mFocusListener,
                                 false, false);
   }
 
   // XXX re-enable image animations once that works correctly