Automatic update from web-platform-tests Execute scrollIntoView scrolls in parallel Blink currently handles scrolls generated by scrollIntoView by executing the scrolls one after the other. To manage this, Blink would have a new sequence abort the old sequence. This led to a limitation where smooth scrollIntoViews could not be run on separate scrollers at the same time. This patch changes this behavior so that Blink will run all the scrolls generated by scrollIntoView in parallel. This allows smooth scrollIntoViews to be run on separate scrollers simultaneously and allows scrollIntoView scrolls to be ticked on the compositor thread. It is also similar to what Firefox and Safari do. Additional Notes: active_smooth_scroll_into_view_type_ is introduced to ScrollableArea so that we can preserve our filtering logic but enforce it on a per-scroller basis, e.g. as tested by ScrollIntoViewTest.SmoothUserScrollNotAbortedByProgrammaticScrolls. The modification to scrollend-event-fired-for-scrollIntoView.html makes sure that both the out_div and the target_div have finished scrolling before verifying their scroll offsets. scrollIntoView-smooth.html is modified because now that scrollIntoView is ticked on the compositor thread, counting frames is not a reliable way to signal the end of the scroll. Instead, we wait for the scrollend event. The method of counting frames is not deleted so the test can remain passing on browsers that don't have scrollend enabled as this is a fairly old test. Bug: 325081538 Change-Id: Ia004b5e94ade5c5dae836a0996143476157a132a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5560484 Reviewed-by: Robert Flack <flackr@chromium.org> Commit-Queue: David Awogbemila <awogbemila@chromium.org> Cr-Commit-Position: refs/heads/main@{#1315794} -- wpt-commits: 5ae52272e1ad26f63f2473ab63c9e5f33b44182b wpt-pr: 46786
89 lines
3.1 KiB
HTML
89 lines
3.1 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>CSSOM View - Simultaneous scrollIntoViews</title>
|
|
<link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-element-scrollintoview">
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="/dom/events/scrolling/scroll_support.js"></script>
|
|
<script src="/css/css-scroll-snap/support/common.js"></script>
|
|
<script src="resources/simultaneousScrollIntoViews.js"></script>
|
|
</head>
|
|
<body>
|
|
<style>
|
|
.scroller {
|
|
overflow-y: scroll;
|
|
height: 200px;
|
|
width: 200px;
|
|
background-color: teal;
|
|
border: solid 1px black;
|
|
position: relative;
|
|
display: inline-block;
|
|
}
|
|
.space {
|
|
height: 200vh;
|
|
width: 200vw;
|
|
}
|
|
.box {
|
|
height: 50px;
|
|
width: 50px;
|
|
background-color: purple;
|
|
}
|
|
.target {
|
|
position: absolute;
|
|
top: 150%;
|
|
}
|
|
</style>
|
|
<div id="scroller1" class="scroller">
|
|
<div class="space"></div>
|
|
<div class="box target" id="target1"></div>
|
|
</div>
|
|
<div id="scroller2" class="scroller">
|
|
<div class="space"></div>
|
|
<div class="box target" id="target2"></div>
|
|
</div>
|
|
<script>
|
|
const scroller1 = document.getElementById("scroller1");
|
|
const scroller2 = document.getElementById("scroller2");
|
|
const target1 = document.getElementById("target1");
|
|
const target2 = document.getElementById("target2");
|
|
|
|
const targets = [target1, target2];
|
|
const scrollers = [scroller1, scroller2];
|
|
const target_offsets = [target1.offsetTop, target2.offsetTop];
|
|
|
|
promise_test(async (t) => {
|
|
await simultaneousScrollIntoViewsTest(t,
|
|
["smooth", "smooth"],
|
|
targets,
|
|
scrollers,
|
|
target_offsets);
|
|
}, "Simultaneous smooth scrollIntoViews run to completion");
|
|
|
|
promise_test(async (t) => {
|
|
await simultaneousScrollIntoViewsTest(t,
|
|
["smooth", "instant"],
|
|
targets,
|
|
scrollers,
|
|
target_offsets);
|
|
}, "Simultaneous smooth,instant scrollIntoViews run to completion");
|
|
|
|
promise_test(async (t) => {
|
|
await simultaneousScrollIntoViewsTest(t,
|
|
["instant", "smooth"],
|
|
targets,
|
|
scrollers,
|
|
target_offsets);
|
|
}, "Simultaneous instant,smooth scrollIntoViews run to completion");
|
|
|
|
promise_test(async (t) => {
|
|
await simultaneousScrollIntoViewsTest(t,
|
|
["instant", "instant"],
|
|
targets,
|
|
scrollers,
|
|
target_offsets);
|
|
}, "Simultaneous instant scrollIntoViews run to completion");
|
|
</script>
|
|
</body>
|
|
</html>
|