Bug 1303761 - Disable paint skipping for all scroll frames between the fixed element and the scrolled clip. r=tnikkel, a=gchang
authorMarkus Stange <mstange@themasta.com>
Tue, 20 Sep 2016 19:39:02 -0400
changeset 355750 81325da0086efea3ddb70a61dc7ee5dd816fb962
parent 355749 282d0a432423597be53be0d43d061e7b41047402
child 355751 f48be812c11381b8a497ca5605c00a72359a263b
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstnikkel, gchang
bugs1303761
milestone51.0a2
Bug 1303761 - Disable paint skipping for all scroll frames between the fixed element and the scrolled clip. r=tnikkel, a=gchang MozReview-Commit-ID: 1FIQcJT55DJ
layout/base/DisplayListClipState.cpp
--- a/layout/base/DisplayListClipState.cpp
+++ b/layout/base/DisplayListClipState.cpp
@@ -37,20 +37,24 @@ DisplayListClipState::GetCurrentCombined
 
 void
 DisplayListClipState::SetScrollClipForContainingBlockDescendants(
     nsDisplayListBuilder* aBuilder,
     const DisplayItemScrollClip* aScrollClip)
 {
   if (aBuilder->IsPaintingToWindow() &&
       mClipContentDescendants &&
-      aScrollClip != mScrollClipContainingBlockDescendants &&
-      !DisplayItemScrollClip::IsAncestor(mClipContentDescendantsScrollClip, aScrollClip)) {
-    if (mClipContentDescendantsScrollClip && mClipContentDescendantsScrollClip->mScrollableFrame) {
-      mClipContentDescendantsScrollClip->mScrollableFrame->SetScrollsClipOnUnscrolledOutOfFlow();
+      aScrollClip != mScrollClipContainingBlockDescendants) {
+    // Disable paint skipping for all scroll frames on the way to aScrollClip.
+    for (const DisplayItemScrollClip* sc = mClipContentDescendantsScrollClip;
+         sc && !DisplayItemScrollClip::IsAncestor(sc, aScrollClip);
+         sc = sc->mParent) {
+      if (sc->mScrollableFrame) {
+        sc->mScrollableFrame->SetScrollsClipOnUnscrolledOutOfFlow();
+      }
     }
     mClipContentDescendantsScrollClip = nullptr;
   }
   mScrollClipContainingBlockDescendants = aScrollClip;
   mStackingContextAncestorSC = DisplayItemScrollClip::PickAncestor(mStackingContextAncestorSC, aScrollClip);
 }
 
 void