Bug 1540839 - Don't set embedder element to null; r=nika
authorKyle Machulis <kyle@nonpolynomial.com>
Wed, 08 May 2019 14:32:55 -0700
changeset 532669 40acaa39dc45c973d2eebc47aab8f5f94f2397e3
parent 532668 66e1bbe3436b8bf7fafad5055d79a00071c716eb
child 532670 8069a95120e0660496da92f8edb6c8fd89180b66
push id11270
push userrgurzau@mozilla.com
push dateWed, 15 May 2019 15:07:19 +0000
treeherdermozilla-beta@571bc76da583 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnika
bugs1540839
milestone68.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 1540839 - Don't set embedder element to null; r=nika When resetting the BrowsingContext embedder element, only do so if the FrameElement we're setting isn't already null. Differential Revision: https://phabricator.services.mozilla.com/D30562
dom/ipc/BrowserParent.cpp
--- a/dom/ipc/BrowserParent.cpp
+++ b/dom/ipc/BrowserParent.cpp
@@ -531,17 +531,17 @@ void BrowserParent::SetOwnerElement(Elem
   }
 
   if (mRenderFrame.IsInitialized()) {
     mRenderFrame.OwnerContentChanged();
   }
 
   // Set our BrowsingContext's embedder if we're not embedded within a
   // BrowserBridgeParent.
-  if (!GetBrowserBridgeParent() && mBrowsingContext) {
+  if (!GetBrowserBridgeParent() && mBrowsingContext && mFrameElement) {
     mBrowsingContext->SetEmbedderElement(mFrameElement);
   }
 
   VisitChildren([aElement](BrowserBridgeParent* aBrowser) {
     aBrowser->GetBrowserParent()->SetOwnerElement(aElement);
   });
 }