Automatic update from web-platform-tests Do not send detached scrollable area info to the compositor We track scrollable areas on LocalFrameView, and these persist even if the local frame view is detached. For PaintArtifactCompositor::Update, we should ignore the scrollable areas from detached frames, as they will not be visible. Fixed: 475579183, 423245953 Change-Id: I38481df33ed2a3b6f8a3d7d30a9e7c82ff3129ff Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7486927 Reviewed-by: Stefan Zager <szager@chromium.org> Commit-Queue: Philip Rogers <pdr@chromium.org> Cr-Commit-Position: refs/heads/main@{#1570047} -- wpt-commits: b200561bc63dc0951a6df7d11fc333c71cb68e36 wpt-pr: 57195
58 lines
2.0 KiB
HTML
58 lines
2.0 KiB
HTML
<!DOCTYPE html>
|
|
<title>cssom-view - scroll-behavior: smooth after hiding iframe</title>
|
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
<link rel="help" href="https://drafts.csswg.org/cssom-view/#smooth-scrolling">
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="/dom/events/scrolling/scroll_support.js"></script>
|
|
<style>
|
|
#scroller {
|
|
width: 300px;
|
|
height: 300px;
|
|
overflow-y: scroll;
|
|
}
|
|
</style>
|
|
<body>
|
|
<div id="scroller">
|
|
<div id="firstTab">
|
|
<iframe srcdoc='<html><style>body { height: 200vh; }</style><body></body></html>'></iframe>
|
|
</div>
|
|
<div id="secondTab" style="display: none">
|
|
<div style="width: 200px; height: 5000px;"></div>
|
|
<div style="width: 100px; height: 100px; background: green;"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
promise_test(async (t) => {
|
|
await waitForCompositorReady();
|
|
|
|
// Wait for initial layout/paint
|
|
await waitForCompositorCommit();
|
|
|
|
const firstTab = document.getElementById('firstTab');
|
|
const secondTab = document.getElementById('secondTab');
|
|
const scroller = document.getElementById('scroller');
|
|
|
|
// Hide first tab
|
|
firstTab.style.display = 'none';
|
|
await waitForCompositorCommit();
|
|
|
|
// Show second tab and scroll.
|
|
secondTab.style.display = 'block';
|
|
|
|
const scrollEndPromise = new Promise(resolve => {
|
|
scroller.addEventListener('scrollend', resolve, {once: true});
|
|
});
|
|
|
|
// Smooth scroll to the end.
|
|
scroller.scroll({top: 999999, left: 0, behavior: "smooth" });
|
|
|
|
await scrollEndPromise;
|
|
|
|
const scrolledToBottom = Math.abs(scroller.scrollHeight - scroller.clientHeight - scroller.scrollTop) < 1;
|
|
assert_true(scrolledToBottom, "Scroller should be at the bottom after scrollend fires. Current scrollTop: " + scroller.scrollTop);
|
|
}, "Smooth scroll finishes correctly after hiding a tab with an iframe");
|
|
</script>
|
|
</body>
|