From 1ab11075de8a760cc5e3387158ed1a8746861f40 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Thu, 17 Jan 2019 16:43:08 +0000 Subject: [PATCH] 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 --HG-- extra : moz-landing-system : lando --- gfx/tests/reftest/1519754-ref.html | 5 +++++ gfx/tests/reftest/1519754.html | 5 +++++ gfx/tests/reftest/reftest.list | 1 + gfx/webrender_bindings/WebRenderAPI.cpp | 7 +++++-- 4 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 gfx/tests/reftest/1519754-ref.html create mode 100644 gfx/tests/reftest/1519754.html diff --git a/gfx/tests/reftest/1519754-ref.html b/gfx/tests/reftest/1519754-ref.html new file mode 100644 index 000000000000..4d1b6e7992eb --- /dev/null +++ b/gfx/tests/reftest/1519754-ref.html @@ -0,0 +1,5 @@ + +
+
+
+ diff --git a/gfx/tests/reftest/1519754.html b/gfx/tests/reftest/1519754.html new file mode 100644 index 000000000000..7db2093cfd37 --- /dev/null +++ b/gfx/tests/reftest/1519754.html @@ -0,0 +1,5 @@ + +
+
+
+ diff --git a/gfx/tests/reftest/reftest.list b/gfx/tests/reftest/reftest.list index ee26e543b38e..b7de0d048868 100644 --- a/gfx/tests/reftest/reftest.list +++ b/gfx/tests/reftest/reftest.list @@ -16,3 +16,4 @@ fuzzy(0-100,0-30) == 1149923.html 1149923-ref.html # use fuzzy due to few distor == 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 diff --git a/gfx/webrender_bindings/WebRenderAPI.cpp b/gfx/webrender_bindings/WebRenderAPI.cpp index ab8f0bb6a30c..155db006218b 100644 --- a/gfx/webrender_bindings/WebRenderAPI.cpp +++ b/gfx/webrender_bindings/WebRenderAPI.cpp @@ -797,10 +797,13 @@ wr::WrSpaceAndClip DisplayListBuilder::DefineScrollLayer( 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,