Bug 1548247 - Fully recurse frame tree from APZCCallbackHelper r=kats
authorDoug Thayer <dothayer@mozilla.com>
Tue, 18 Jun 2019 22:03:08 +0000
changeset 479135 e249cd75138b075397f22731aa94aa1ee9c803d6
parent 479134 bf1be740ee4ad47ef0d378c3222bf6c16eaf4a5c
child 479136 b0f2fc39f250ce173929d1f399cbe4818db118d1
push id36170
push usercbrindusan@mozilla.com
push dateWed, 19 Jun 2019 03:56:45 +0000
treeherdermozilla-central@5f0f37756053 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1548247
milestone69.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 1548247 - Fully recurse frame tree from APZCCallbackHelper r=kats I wasn't able to produce a situation in which this change matters, so I'm not certain that it's necessary, but it seems to be the correct thing to do given the problem fixed in nsGfxScrollFrame.cpp. Differential Revision: https://phabricator.services.mozilla.com/D31864
gfx/layers/apz/util/APZCCallbackHelper.cpp
gfx/thebes/gfxUtils.cpp
gfx/thebes/gfxUtils.h
--- a/gfx/layers/apz/util/APZCCallbackHelper.cpp
+++ b/gfx/layers/apz/util/APZCCallbackHelper.cpp
@@ -688,17 +688,18 @@ static bool PrepareForSetTargetAPZCNotif
   // Assuming that if there's no scrollAncestor, there's already a displayPort.
   nsCOMPtr<dom::Element> dpElement =
       scrollAncestor ? GetDisplayportElementFor(scrollAncestor)
                      : GetRootDocumentElementFor(aWidget);
 
   if (XRE_IsContentProcess()) {
     guid.mRenderRoot = gfxUtils::GetContentRenderRoot();
   } else {
-    guid.mRenderRoot = gfxUtils::RecursivelyGetRenderRootForElement(dpElement);
+    guid.mRenderRoot = gfxUtils::RecursivelyGetRenderRootForFrame(
+        target ? target : aRootFrame);
   }
 
 #ifdef APZCCH_LOGGING
   nsAutoString dpElementDesc;
   if (dpElement) {
     dpElement->Describe(dpElementDesc);
   }
   APZCCH_LOG("For event at %s found scrollable element %p (%s)\n",
--- a/gfx/thebes/gfxUtils.cpp
+++ b/gfx/thebes/gfxUtils.cpp
@@ -1516,33 +1516,16 @@ wr::RenderRoot gfxUtils::RecursivelyGetR
     if (renderRoot) {
       return *renderRoot;
     }
   }
 
   return wr::RenderRoot::Default;
 }
 
-wr::RenderRoot gfxUtils::RecursivelyGetRenderRootForElement(
-    const dom::Element* aElement) {
-  if (!gfxVars::UseWebRender() || !StaticPrefs::WebRenderSplitRenderRoots()) {
-    return wr::RenderRoot::Default;
-  }
-
-  for (const dom::Element* current = aElement; current;
-       current = current->GetParentElement()) {
-    auto renderRoot = gfxUtils::GetRenderRootForElement(current);
-    if (renderRoot) {
-      return *renderRoot;
-    }
-  }
-
-  return wr::RenderRoot::Default;
-}
-
 FILE* gfxUtils::sDumpPaintFile = stderr;
 
 namespace mozilla {
 namespace gfx {
 
 Color ToDeviceColor(Color aColor) {
   // aColor is pass-by-value since to get return value optimization goodness we
   // need to return the same object from all return points in this function. We
--- a/gfx/thebes/gfxUtils.h
+++ b/gfx/thebes/gfxUtils.h
@@ -315,18 +315,16 @@ class gfxUtils {
   static mozilla::wr::RenderRoot GetContentRenderRoot();
 
   static mozilla::Maybe<mozilla::wr::RenderRoot> GetRenderRootForFrame(
       const nsIFrame* aFrame);
   static mozilla::Maybe<mozilla::wr::RenderRoot> GetRenderRootForElement(
       const mozilla::dom::Element* aElement);
   static mozilla::wr::RenderRoot RecursivelyGetRenderRootForFrame(
       const nsIFrame* aFrame);
-  static mozilla::wr::RenderRoot RecursivelyGetRenderRootForElement(
-      const mozilla::dom::Element* aElement);
 };
 
 namespace mozilla {
 
 struct StyleRGBA;
 
 namespace gfx {