Bug 1520301 - Fix scroll frame default positioning r=jrmuizel
authorDzmitry Malyshau <dmalyshau@mozilla.com>
Thu, 17 Jan 2019 16:43:08 +0000
changeset 514277 c3d4685b58a5eabb34d6a04fa1cd4e7d5e53c7c9
parent 514276 ed843bb514f9e7c6c52914663d62d663f5658f19
child 514278 7949c9530cfe66194fa012b7b9b66d9e3f3d43e1
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [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,5 @@
+<body style="margin-left: 0px">
+<div style="margin-left: 200px; width: 200px; height: 100px; overflow: auto;">
+    <div style="background-color: red; height: 200px;"/>
+</div>
+</body>
new file mode 100644
--- /dev/null
+++ b/gfx/tests/reftest/1519754.html
@@ -0,0 +1,5 @@
+<body>
+<div style="left: 400px; position: fixed; transform: translateX(-200px); width: 200px; height: 100px; overflow: auto;">
+    <div style="background-color: red; height: 200px;"/>
+</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
+== 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;