fune/testing/web-platform/tests/css/css-scroll-anchoring/nested-overflow-subtree-layout.html
Chris Harrelson 2efdd70684 Bug 1594624 [wpt PR 20141] - When performing subtree layout, perform scroll anchoring notifications on ancestors., a=testonly
Automatic update from web-platform-tests
When performing subtree layout, perform scroll anchoring notifications on ancestors.

Previously, we would fail to call NotifyBeforeLayout for all such ancestors
that are scrollers, causing subtree layouts to completely fail to maintain
a scroll anchor for such ancestors.

Bug: 920289

Change-Id: I899634949739f5d4f3af1f282b598cbc4ef0e3e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1902767
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: Nick Burris <nburris@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713561}

--
Use reftest-wait to make sure text content inserted before screenshot taken

--

wpt-commits: bb94093b7d776b9c05640864e712b79ed71ef90a, bce5534f6a747bc2a5cc2843afd9fbc82694af8e
wpt-pr: 20141
2019-11-29 10:55:59 +00:00

51 lines
1.1 KiB
HTML

<!DOCTYPE html>
<html class="reftest-wait">
<head>
<title>Test that subtree layout with nested overflow preserves scroll anchoring.</title>
<link rel="author" title="Chris Harrelson" href="mailto:chrishtr@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-scroll-anchoring/">
<link rel="match" href="nested-overflow-subtree-layout-ref.html">
<script src="/common/reftest-wait.js"></script>
</head>
<style>
#outer {
overflow: hidden;
width: 500px;
height: 500px;
}
#inner {
overflow: auto;
position: relative;
width: 500px;
height: 2000px;
}
p {
font: 48pt monospace;
}
</style>
</head>
<body>
<div id="outer">
<div id="inner">
<p>Anchor</p>
</div>
</div>
<script>
const outer = document.querySelector("#outer");
const inner = document.querySelector("#inner");
onload = () => {
requestAnimationFrame(() => {
requestAnimationFrame(() => {
outer.scrollTo(0, 70);
requestAnimationFrame(() => {
const elem = document.createElement("p");
elem.textContent = "FAIL";
inner.insertBefore(elem, inner.firstChild);
takeScreenshot();
});
});
});
};
</script>