Bug 1522455 - Position sticky can be handled by the compositor, so should be considered an async AGR. r=miko
authorMatt Woodrow <mwoodrow@mozilla.com>
Fri, 03 May 2019 13:22:27 +0000
changeset 531438 267df62ca84ea961b13ab7cf1531c29a8dfdcf42
parent 531437 1d35f8d88bdd007e01d42c4ff76c6d10d7c01a98
child 531439 7637b7b1a6d24f9b172665929b7e026e0a3a3dc7
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmiko
bugs1522455
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 1522455 - Position sticky can be handled by the compositor, so should be considered an async AGR. r=miko Differential Revision: https://phabricator.services.mozilla.com/D29796
layout/painting/nsDisplayList.cpp
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -1951,16 +1951,22 @@ nsDisplayListBuilder::AGRState nsDisplay
   }
 
   nsIFrame* parent = nsLayoutUtils::GetCrossDocParentFrame(aFrame);
   if (!parent) {
     aIsAsync = true;
     return AGR_YES;
   }
 
+  if (aFrame->StyleDisplay()->mPosition == NS_STYLE_POSITION_STICKY &&
+      IsStickyFrameActive(this, aFrame, parent)) {
+    aIsAsync = true;
+    return AGR_YES;
+  }
+
   if (aFrame->IsTransformed()) {
     aIsAsync = EffectCompositor::HasAnimationsForCompositor(
         aFrame, DisplayItemType::TYPE_TRANSFORM);
     return AGR_YES;
   }
 
   LayoutFrameType parentType = parent->Type();
   if (parentType == LayoutFrameType::Scroll ||
@@ -1999,21 +2005,16 @@ nsDisplayListBuilder::AGRState nsDisplay
 
   if (!aFrame->GetParent() &&
       nsLayoutUtils::ViewportHasDisplayPort(aFrame->PresContext())) {
     // Viewport frames in a display port need to be animated geometry roots
     // for background-attachment:fixed elements.
     return AGR_YES;
   }
 
-  if (aFrame->StyleDisplay()->mPosition == NS_STYLE_POSITION_STICKY &&
-      IsStickyFrameActive(this, aFrame, parent)) {
-    return AGR_YES;
-  }
-
   // Fixed-pos frames are parented by the viewport frame, which has no parent.
   if (nsLayoutUtils::IsFixedPosFrameInDisplayPort(aFrame)) {
     return AGR_YES;
   }
 
   if (aParent) {
     *aParent = parent;
   }