mirror of
https://github.com/servo/servo.git
synced 2025-08-18 03:45:33 +01:00
Update web-platform-tests to revision 84af6c875d378944b39d895acdcfc170736b2d3d
This commit is contained in:
parent
d0bd2d5e44
commit
b81cdc75ce
246 changed files with 10836 additions and 1337 deletions
|
@ -35,16 +35,16 @@
|
|||
<script>
|
||||
test(function() {
|
||||
let bb = document.getElementById("block-block");
|
||||
assert_equals(bb.getBoxQuads({box: "border"})[0].bounds.width, 20, "Block layout border box is expected width.");
|
||||
assert_equals(bb.getBoxQuads({box: "margin"})[0].bounds.width, 100, "Block layout margin box is expected width.");
|
||||
assert_equals(bb.getBoxQuads({box: "border"})[0].getBounds().width, 20, "Block layout border box is expected width.");
|
||||
assert_equals(bb.getBoxQuads({box: "margin"})[0].getBounds().width, 100, "Block layout margin box is expected width.");
|
||||
|
||||
// For containers that expand items to fill block-axis space, measure the box heights also.
|
||||
let fb = document.getElementById("flex-block");
|
||||
assert_equals(fb.getBoxQuads({box: "border"})[0].bounds.width, 20, "Flex layout border box is expected width.");
|
||||
assert_equals(fb.getBoxQuads({box: "margin"})[0].bounds.width, 100, "Flex layout margin box is expected width.");
|
||||
assert_equals(fb.getBoxQuads({box: "border"})[0].getBounds().width, 20, "Flex layout border box is expected width.");
|
||||
assert_equals(fb.getBoxQuads({box: "margin"})[0].getBounds().width, 100, "Flex layout margin box is expected width.");
|
||||
|
||||
assert_equals(fb.getBoxQuads({box: "border"})[0].bounds.height, 10, "Flex layout border box is expected height.");
|
||||
assert_equals(fb.getBoxQuads({box: "margin"})[0].bounds.height, 50, "Flex layout margin box is expected height.");
|
||||
assert_equals(fb.getBoxQuads({box: "border"})[0].getBounds().height, 10, "Flex layout border box is expected height.");
|
||||
assert_equals(fb.getBoxQuads({box: "margin"})[0].getBounds().height, 50, "Flex layout margin box is expected height.");
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE html>
|
||||
<title>position:sticky should operate correctly for the root scroller</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-position-3/#valdef-position-sticky">
|
||||
<link rel="help" href="https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior">
|
||||
<meta name="assert" content="This test checks that position:sticky elements work when using the root (document) scroller which has `scroll-behavior` property" />
|
||||
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="support/scroll-behavior.js"></script>
|
||||
|
||||
<style>
|
||||
html {
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
|
||||
body {
|
||||
/* Assumption: 3000px is taller than any user agents test window size. */
|
||||
height: 3000px;
|
||||
/* A property which propagates for <html>. */
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
#sticky {
|
||||
position: sticky;
|
||||
top: 50px;
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
background-color: green;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="sticky"></div>
|
||||
|
||||
<script>
|
||||
promise_test(async () => {
|
||||
window.scrollTo(0, 700);
|
||||
|
||||
await waitForScrollEnd(document.scrollingElement);
|
||||
|
||||
assert_equals(sticky.offsetTop, 700 + 50);
|
||||
}, 'Sticky elements work with the root (document) scroller');
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue