mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Update web-platform-tests to revision 73bd4355b891665829c66e1b83d64bcc29197a16
This commit is contained in:
parent
e1cc38bea8
commit
db12fbb0be
146 changed files with 2401 additions and 798 deletions
|
@ -0,0 +1,46 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset="utf8">
|
||||
<title>CSS Scroll Anchoring: prioritize focused element</title>
|
||||
<link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-scroll-anchoring/#anchor-node-selection">
|
||||
<meta name="assert" content="anchor selection prioritized focused element">
|
||||
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<style>
|
||||
body { height: 4000px }
|
||||
.spacer { height: 100px }
|
||||
#growing { height: 100px }
|
||||
#focused { height: 10px }
|
||||
</style>
|
||||
|
||||
<div class=spacer></div>
|
||||
<div class=spacer></div>
|
||||
<div class=spacer></div>
|
||||
<div class=spacer></div>
|
||||
<div id=growing></div>
|
||||
<div class=spacer></div>
|
||||
<div id=focused tabindex=0></div>
|
||||
<div class=spacer></div>
|
||||
<div class=spacer></div>
|
||||
|
||||
<script>
|
||||
async_test((t) => {
|
||||
document.scrollingElement.scrollTop = 150;
|
||||
focused.focus();
|
||||
|
||||
const target_rect = focused.getBoundingClientRect();
|
||||
growing.style.height = "3000px";
|
||||
|
||||
requestAnimationFrame(() => {
|
||||
t.step(() => {
|
||||
const new_rect = focused.getBoundingClientRect();
|
||||
assert_equals(new_rect.x, target_rect.x, "x coordinate");
|
||||
assert_equals(new_rect.y, target_rect.y, "y coordinate");
|
||||
assert_not_equals(document.scrollingElement.scrollTop, 150, "scroll adjusted");
|
||||
});
|
||||
t.done();
|
||||
});
|
||||
}, "Anchor selection prioritized focused element.");
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue