Backed out changeset bc4c5281f2c2 (bug 1379887) for causing regressions.
authorTimothy Nikkel <tnikkel@gmail.com>
Sat, 29 Jul 2017 01:21:32 -0500
changeset 420594 58ec9fceb4acff9dfbb798d9cf9a859af6295521
parent 420593 a09d4e4b31bc001d2a050fa311d32fca37b28db4
child 420595 20cfd275556463d76fbf17197796291c8897901e
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1379887
milestone56.0a1
backs outbc4c5281f2c23c7d643c6c5580789047c5f0c0ec
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
Backed out changeset bc4c5281f2c2 (bug 1379887) for causing regressions.
layout/generic/nsGfxScrollFrame.cpp
layout/generic/nsSubDocumentFrame.cpp
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -3367,30 +3367,28 @@ ScrollFrameHelper::BuildDisplayList(nsDi
     !(mIsRoot && mOuter->PresContext()->PresShell()->GetIsViewportOverridden());
 
   // Whether we might want to build a scrollable layer for this scroll frame
   // at some point in the future. This controls whether we add the information
   // to the layer tree (a scroll info layer if necessary, and add the right
   // area to the dispatch to content layer event regions) necessary to activate
   // a scroll frame so it creates a scrollable layer.
   bool couldBuildLayer = false;
-  if (aBuilder->IsPaintingToWindow()) {
-    if (mWillBuildScrollableLayer) {
-      couldBuildLayer = true;
-    } else {
-      couldBuildLayer =
-        nsLayoutUtils::AsyncPanZoomEnabled(mOuter) &&
-        WantAsyncScroll() &&
-        // If we are using containers for root frames, and we are the root
-        // scroll frame for the display root, then we don't need a scroll
-        // info layer. nsDisplayList::PaintForFrame already calls
-        // ComputeFrameMetrics for us.
-        (!(gfxPrefs::LayoutUseContainersForRootFrames() && mIsRoot) ||
-         (aBuilder->RootReferenceFrame()->PresContext() != mOuter->PresContext()));
-    }
+  if (mWillBuildScrollableLayer) {
+    couldBuildLayer = true;
+  } else {
+    couldBuildLayer =
+      nsLayoutUtils::AsyncPanZoomEnabled(mOuter) &&
+      WantAsyncScroll() &&
+      // If we are using containers for root frames, and we are the root
+      // scroll frame for the display root, then we don't need a scroll
+      // info layer. nsDisplayList::PaintForFrame already calls
+      // ComputeFrameMetrics for us.
+      (!(gfxPrefs::LayoutUseContainersForRootFrames() && mIsRoot) ||
+       (aBuilder->RootReferenceFrame()->PresContext() != mOuter->PresContext()));
   }
 
   // Now display the scrollbars and scrollcorner. These parts are drawn
   // in the border-background layer, on top of our own background and
   // borders and underneath borders and backgrounds of later elements
   // in the tree.
   // Note that this does not apply for overlay scrollbars; those are drawn
   // in the positioned-elements layer on top of everything else by the call
@@ -3602,21 +3600,22 @@ ScrollFrameHelper::BuildDisplayList(nsDi
 bool
 ScrollFrameHelper::DecideScrollableLayer(nsDisplayListBuilder* aBuilder,
                                          nsRect* aDirtyRect,
                                          bool aAllowCreateDisplayPort)
 {
   // Save and check if this changes so we can recompute the current agr.
   bool oldWillBuildScrollableLayer = mWillBuildScrollableLayer;
 
+  bool wasUsingDisplayPort = false;
+  bool usingDisplayPort = false;
   nsIContent* content = mOuter->GetContent();
-  bool wasUsingDisplayPort = nsLayoutUtils::HasDisplayPort(content);
-  bool usingDisplayPort = wasUsingDisplayPort;
-
   if (aBuilder->IsPaintingToWindow()) {
+    wasUsingDisplayPort = nsLayoutUtils::HasDisplayPort(content);
+
     if (aAllowCreateDisplayPort) {
       nsLayoutUtils::MaybeCreateDisplayPort(*aBuilder, mOuter);
 
       nsRect displayportBase = *aDirtyRect;
       nsPresContext* pc = mOuter->PresContext();
       if (mIsRoot && (pc->IsRootContentDocument() || !pc->GetParentPresContext())) {
         displayportBase =
           nsRect(nsPoint(0, 0), nsLayoutUtils::CalculateCompositionSizeForFrame(mOuter));
--- a/layout/generic/nsSubDocumentFrame.cpp
+++ b/layout/generic/nsSubDocumentFrame.cpp
@@ -400,19 +400,17 @@ nsSubDocumentFrame::BuildDisplayList(nsD
 
     if (nsIFrame* rootScrollFrame = presShell->GetRootScrollFrame()) {
       nsIScrollableFrame* rootScrollableFrame = presShell->GetRootScrollFrameAsScrollable();
       MOZ_ASSERT(rootScrollableFrame);
       // Use a copy, so the dirty rect doesn't get modified to the display port.
       nsRect copy = dirty;
       haveDisplayPort = rootScrollableFrame->DecideScrollableLayer(aBuilder,
                           &copy, /* aAllowCreateDisplayPort = */ true);
-
-      if (!gfxPrefs::LayoutUseContainersForRootFrames() ||
-          !aBuilder->IsPaintingToWindow()) {
+      if (!gfxPrefs::LayoutUseContainersForRootFrames()) {
         haveDisplayPort = false;
       }
 
       ignoreViewportScrolling = presShell->IgnoringViewportScrolling();
       if (ignoreViewportScrolling) {
         savedIgnoreScrollFrame = aBuilder->GetIgnoreScrollFrame();
         aBuilder->SetIgnoreScrollFrame(rootScrollFrame);
       }