Skip to content

Commit

Permalink
[Scroll Unif.] Make hit test see scroller behind preserve-3d layers.
Browse files Browse the repository at this point in the history
In FindAllLayersUpToAndIncludingFirstScrollable, if the first-hit layer
had a nonzero sorting_context_id on its transform node, we were ignoring
all layers in other 3D-rendering contexts.  But we might need to look at
them to find a scroller, rather than return a list consisting entirely
of non-scroller 3D-sorted layers, which triggers the viewport-fallback
case in InputHandler::HitTestScrollNode.

Bug: 1354905
Change-Id: I675034d51ac16b19dc6a2bf0739a8449a74515c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3851125
Commit-Queue: Steve Kobes <[email protected]>
Reviewed-by: David Bokan <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1038748}
  • Loading branch information
skobes-chromium authored and chromium-wpt-export-bot committed Aug 24, 2022
1 parent c7b6b57 commit 8af9a10
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions css/css-transforms/scroll-preserve-3d.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!DOCTYPE html>
<html>
<head>
<link rel="help" href="https://www.w3.org/TR/cssom-view-1/">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<style>
body, h1 { margin: 20px; }
#vp {
height: 400px;
width: 600px;
overflow: scroll;
left: 10px;
top: 10px;
border: 5px solid #8cf;
}
</style>
</head>
<body>
<div id="vp">
<div style="transform-style: preserve-3d">
<h1 style="height:2000px; transform: translateZ(0)">
Gazing into the stars
</h1>
</div>
</div>
<script>
promise_test(async () => {
let scroll_promise = new Promise((resolve, reject) => {
vp.addEventListener("scroll", resolve);
});
await new test_driver.Actions().scroll(100, 100, 0, 50).send();
await scroll_promise;
assert_true(vp.scrollTop > 0);
}, "Element is scrollable over preserve-3d descendant");
</script>
</body>
</html>

0 comments on commit 8af9a10

Please sign in to comment.