Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fall back to main thread if scroll hit test is affected by rounded corners #45797

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions css/css-overflow/scroll-with-ancestor-border-radius.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<!doctype html>
<meta charset=utf-8>
<title>Should not scroll out of rounded corner</title>
<link rel="help" href="https://crbug.com/40277896">
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/dom/events/scrolling/scroll_support.js"></script>
<style>
#container {
width: 300px;
height: 300px;
border-radius: 100px;
overflow: hidden;
border: 2px solid blue;
}

#scroller {
overflow: auto;
width: 300px;
height: 300px;
will-change: scroll-position;
}

.spacer {
height: 200vh;
}

</style>

<div id="container">
<div id="scroller">
<div class="spacer"></div>
</div>
</div>
<div class="spacer"></div>

<script>
promise_test(async (t) => {
await waitForCompositorCommit();
let scrolled = new Promise((resolve) => {
let scrollers = [window, document.getElementById("scroller")];
let onscroll = (evt) => {
for (const scroller of scrollers) {
scroller.removeEventListener("scroll", onscroll);
}
resolve(evt.target.id || "root");
}
for (const scroller of scrollers) {
scroller.addEventListener("scroll", onscroll);
}
});
const actions = new test_driver.Actions().scroll(20, 20, 0, 50, { duration: 50 });
actions.send();
assert_equals(await scrolled, "root", "Incorrect element scrolled");
}, "Wheel-scroll out of rounded corner skips that scroller");
</script>
51 changes: 51 additions & 0 deletions css/css-overflow/scroll-with-border-radius.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!doctype html>
<meta charset=utf-8>
<title>Should not scroll out of rounded corner</title>
<link rel="help" href="https://crbug.com/40277896">
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/dom/events/scrolling/scroll_support.js"></script>
<style>
#scroller {
border-radius: 100px;
overflow: auto;
width: 300px;
height: 300px;
border: 2px solid blue;
will-change: scroll-position;
}

.spacer {
height: 200vh;
}

</style>

<div id="scroller">
<div class="spacer"></div>
</div>
<div class="spacer"></div>

<script>
promise_test(async (t) => {
await waitForCompositorCommit();
let scrolled = new Promise((resolve) => {
let scrollers = [window, document.getElementById("scroller")];
let onscroll = (evt) => {
for (const scroller of scrollers) {
scroller.removeEventListener("scroll", onscroll);
}
resolve(evt.target.id || "root");
}
for (const scroller of scrollers) {
scroller.addEventListener("scroll", onscroll);
}
});
const actions = new test_driver.Actions().scroll(20, 20, 0, 50, { duration: 50 });
actions.send();
assert_equals(await scrolled, "root", "Incorrect element scrolled");
}, "Wheel-scroll out of rounded corner skips that scroller");
</script>