Bug 1520301 - Fix scroll frame default positioning r=jrmuizel
☠☠ backed out by e3cb5a5ef667 ☠ ☠
authorDzmitry Malyshau <dmalyshau@mozilla.com>
Wed, 16 Jan 2019 21:00:05 +0000
changeset 511257 d4b7dbc0379f7166366dea5fcd45200ffc065c25
parent 511256 cfbd8823f3c5b9cfea52d1a519f0b0d2a4aa2345
child 511258 ef66755764d4c6cba370621b13b8a32a54eddeb4
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1520301
milestone66.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 1520301 - Fix scroll frame default positioning r=jrmuizel When scroll frames are created, and no explicit parent is provided, the old code used to take the ClipID from the c/s stack. The stack has been removed on WR side, and this parent assignment got lost. This change takes the SpatialID from the top of the stack on Gecko side to replicate the old behavior. Differential Revision: https://phabricator.services.mozilla.com/D16732
gfx/tests/reftest/1519754-ref.html
gfx/tests/reftest/1519754.html
gfx/tests/reftest/reftest.list
gfx/webrender_bindings/WebRenderAPI.cpp
new file mode 100644
--- /dev/null
+++ b/gfx/tests/reftest/1519754-ref.html
@@ -0,0 +1,16 @@
+<body style="margin-left: 0px">
+<div style="margin-left: 200px; width: 200px; height: 100px; overflow: auto;">
+    XXX XXX XXX XXX XXX XXX XXX XX XXX XXX XXX
+    XXX XXX XXX XXX XXX XXX XXX XX XXX XXX XXX
+    XXX XXX XXX XXX XXX XXX XXX XX XXX XXX XXX
+    XXX XXX XXX XXX XXX XXX XXX XX XXX XXX XXX
+    XXX XXX XXX XXX XXX XXX XXX XX XXX XXX XXX
+    XXX XXX XXX XXX XXX XXX XXX XX XXX XXX XXX
+    XXX XXX XXX XXX XXX XXX XXX XX XXX XXX XXX
+    XXX XXX XXX XXX XXX XXX XXX XX XXX XXX XXX
+    XXX XXX XXX XXX XXX XXX XXX XX XXX XXX XXX
+    XXX XXX XXX XXX XXX XXX XXX XX XXX XXX XXX
+    XXX XXX XXX XXX XXX XXX XXX XX XXX XXX XXX
+    XXX XXX XXX XXX XXX XXX XXX XX XXX XXX XXX
+</div>
+</body>
new file mode 100644
--- /dev/null
+++ b/gfx/tests/reftest/1519754.html
@@ -0,0 +1,16 @@
+<body>
+<div style="left: 400px; position: fixed; transform: translateX(-200px); width: 200px; height: 100px; overflow: auto;">
+    XXX XXX XXX XXX XXX XXX XXX XX XXX XXX XXX
+    XXX XXX XXX XXX XXX XXX XXX XX XXX XXX XXX
+    XXX XXX XXX XXX XXX XXX XXX XX XXX XXX XXX
+    XXX XXX XXX XXX XXX XXX XXX XX XXX XXX XXX
+    XXX XXX XXX XXX XXX XXX XXX XX XXX XXX XXX
+    XXX XXX XXX XXX XXX XXX XXX XX XXX XXX XXX
+    XXX XXX XXX XXX XXX XXX XXX XX XXX XXX XXX
+    XXX XXX XXX XXX XXX XXX XXX XX XXX XXX XXX
+    XXX XXX XXX XXX XXX XXX XXX XX XXX XXX XXX
+    XXX XXX XXX XXX XXX XXX XXX XX XXX XXX XXX
+    XXX XXX XXX XXX XXX XXX XXX XX XXX XXX XXX
+    XXX XXX XXX XXX XXX XXX XXX XX XXX XXX XXX
+</div>
+</body>
--- a/gfx/tests/reftest/reftest.list
+++ b/gfx/tests/reftest/reftest.list
@@ -11,8 +11,9 @@ fuzzy(0-100,0-30) == 1149923.html 114992
 == 1424673.html 1424673-ref.html
 == 1429411.html 1429411-ref.html
 == 1435143.html 1435143-ref.html
 == 1444904.html 1444904-ref.html
 == 1451168.html 1451168-ref.html
 == 1461313.html 1461313-ref.html
 fuzzy(5-32,21908-26621) fuzzy-if(webrender,0-1,0-3) == 1463802.html 1463802-ref.html
 fuzzy(0-11,0-4) == 1474722.html 1474722-ref.html
+fuzzy(0-50,0-10000) == 1519754.html 1519754-ref.html
--- a/gfx/webrender_bindings/WebRenderAPI.cpp
+++ b/gfx/webrender_bindings/WebRenderAPI.cpp
@@ -792,20 +792,23 @@ wr::WrSpaceAndClip DisplayListBuilder::D
     const layers::ScrollableLayerGuid::ViewID& aViewId,
     const Maybe<wr::WrSpaceAndClip>& aParent,
     const wr::LayoutRect& aContentRect, const wr::LayoutRect& aClipRect) {
   auto it = mScrollIds.find(aViewId);
   if (it != mScrollIds.end()) {
     return it->second;
   }
 
-  auto rootSpaceAndClip = wr::RootScrollNode();
   // We haven't defined aViewId before, so let's define it now.
+  wr::WrSpaceAndClip defaultParent = wr::RootScrollNode();
+  //Note: we are currently ignoring the clipId on the stack here
+  defaultParent.space = mCurrentSpaceAndClipChain.space;
+
   auto spaceAndClip = wr_dp_define_scroll_layer(
-      mWrState, aViewId, aParent ? aParent.ptr() : &rootSpaceAndClip,
+      mWrState, aViewId, aParent ? aParent.ptr() : &defaultParent,
       aContentRect, aClipRect);
 
   WRDL_LOG("DefineScrollLayer id=%" PRIu64 "/%zu p=%s co=%s cl=%s\n", mWrState,
            aViewId, spaceAndClip.space.id,
            aParent ? Stringify(aParent->space.id).c_str() : "(nil)",
            Stringify(aContentRect).c_str(), Stringify(aClipRect).c_str());
 
   mScrollIds[aViewId] = spaceAndClip;