mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-09 12:51:09 +02:00
Automatic update from web-platform-tests ScrollAnchor: Skip inline elements with overflow-anchor: none. An inline element can't be the anchor node, but the anchor selection algorithm was descending into it indiscriminately instead of checking the exclusion API first. Bug: 918756 Change-Id: Ie9b5e5fdea7f23de1af0b5215956151e9af15d3a Reviewed-on: https://chromium-review.googlesource.com/c/1400941 Reviewed-by: David Bokan <bokan@chromium.org> Commit-Queue: Steve Kobes <skobes@chromium.org> Cr-Commit-Position: refs/heads/master@{#620761} -- wpt-commits: 88efc324547a2f44db5c6947dbb4026eac9db29d wpt-pr: 14754
34 lines
788 B
HTML
34 lines
788 B
HTML
<!DOCTYPE html>
|
|
<link rel="help" href="https://drafts.csswg.org/css-scroll-anchoring/">
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<style>
|
|
|
|
#expander {
|
|
margin-bottom: 50px;
|
|
}
|
|
#no {
|
|
overflow-anchor: none;
|
|
}
|
|
#spacing {
|
|
margin-bottom: 300vh;
|
|
}
|
|
|
|
</style>
|
|
<span>out of view</span>
|
|
<div id="expander"></div>
|
|
<span id="no">excluded subtree <span>[nested inline]</span></span>
|
|
<div id="spacing"></div>
|
|
<script>
|
|
|
|
// Tests that an inline element can be an excluded subtree.
|
|
|
|
test(() => {
|
|
scrollTo(0, 50);
|
|
document.querySelector('#expander').style = "margin-bottom: 100px";
|
|
assert_equals(document.scrollingElement.scrollTop, 50,
|
|
"Scroll anchoring should not anchor within the span.");
|
|
scrollTo(0, 0);
|
|
});
|
|
|
|
</script>
|