Bug 916125. Clip scroll layer items to the scroll port so the resulting layers have the proper clip. r=roc
authorTimothy Nikkel <tnikkel@gmail.com>
Thu, 17 Oct 2013 17:02:42 -0500
changeset 164986 2668b492d8527a3b5609293de82b8e5de511063c
parent 164985 999ed39dc0e721f9279ae38687c1188af91f0177
child 164987 185202a68dc9445ae333f90df6b6d3110c2ede98
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs916125
milestone27.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 916125. Clip scroll layer items to the scroll port so the resulting layers have the proper clip. r=roc
layout/generic/nsGfxScrollFrame.cpp
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -2361,16 +2361,23 @@ nsGfxScrollFrameInner::BuildDisplayList(
   }
 
   if (ShouldBuildLayer()) {
     // ScrollLayerWrapper must always be created because it initializes the
     // scroll layer count. The display lists depend on this.
     ScrollLayerWrapper wrapper(mOuter, mScrolledFrame);
 
     if (usingDisplayport) {
+      DisplayListClipState::AutoSaveRestore clipState(aBuilder);
+      nsRect clip = mScrollPort + aBuilder->ToReferenceFrame(mOuter);
+      if (mClipAllDescendants) {
+        clipState.ClipContentDescendants(clip);
+      } else {
+        clipState.ClipContainingBlockDescendants(clip);
+      }
       // Once a displayport is set, assume that scrolling needs to be fast
       // so create a layer with all the content inside. The compositor
       // process will be able to scroll the content asynchronously.
       wrapper.WrapListsInPlace(aBuilder, mOuter, scrolledContent);
     }
 
     // In case we are not using displayport or the nsDisplayScrollLayers are
     // flattened during visibility computation, we still need to export the