mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Update web-platform-tests to revision b'ceb972b009e1b43c589dce3f36b050121493d2e0'
This commit is contained in:
parent
88ff668147
commit
3c4c34479c
196 changed files with 5979 additions and 848 deletions
|
@ -1,18 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-scroll-snap-1/#scroll-snap-type" />
|
||||
<link rel="help" href="https://drafts.csswg.org/css-writing-modes-4/#principal-flow" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style>
|
||||
html {
|
||||
height: 3000px;
|
||||
height: 8000px;
|
||||
width: 3000px;
|
||||
}
|
||||
|
||||
#target {
|
||||
position: absolute;
|
||||
background-color: blue;
|
||||
top: 1000px;
|
||||
top: 2000px;
|
||||
left: 100px;
|
||||
|
||||
width: 100vw;
|
||||
|
@ -35,10 +36,10 @@ test(t => {
|
|||
document.documentElement.style.scrollSnapType = "y mandatory";
|
||||
target.style.scrollSnapAlign = "end none";
|
||||
|
||||
window.scrollTo(0, 800);
|
||||
window.scrollTo(0, 1800);
|
||||
|
||||
// `target y (1000px)` + `target height (100px)` - document height.
|
||||
assert_equals(document.scrollingElement.scrollTop, 1100 - documentHeight);
|
||||
// `target y (2000px)` + `target height (100px)` - document height.
|
||||
assert_equals(document.scrollingElement.scrollTop, 2100 - documentHeight);
|
||||
assert_equals(document.scrollingElement.scrollLeft, 0, "x should not snap");
|
||||
}, "The scroll-snap-type on the root element is applied");
|
||||
|
||||
|
@ -49,11 +50,11 @@ test(t => {
|
|||
document.body.style.writingMode = "vertical-lr";
|
||||
target.style.scrollSnapAlign = "none end";
|
||||
|
||||
window.scrollTo(200, 800);
|
||||
window.scrollTo(200, 1800);
|
||||
|
||||
// Since inline axis is vertical, scrolling viewport vertically on block
|
||||
// axis should snap.
|
||||
assert_equals(document.scrollingElement.scrollTop, 1100 - documentHeight, "inline should snap");
|
||||
assert_equals(document.scrollingElement.scrollTop, 2100 - documentHeight, "inline should snap");
|
||||
// `target x (100px)`.
|
||||
assert_equals(document.scrollingElement.scrollLeft, 200, "block should not snap");
|
||||
}, "The writing-mode (vertical-lr) on the body is used");
|
||||
|
@ -65,9 +66,9 @@ test(t => {
|
|||
document.body.style.writingMode = "horizontal-tb"; // inline is horizontal
|
||||
target.style.scrollSnapAlign = "none start";
|
||||
|
||||
window.scrollTo(200, 800);
|
||||
window.scrollTo(200, 1800);
|
||||
|
||||
assert_equals(document.scrollingElement.scrollLeft, 100, "inline should snap");
|
||||
assert_equals(document.scrollingElement.scrollTop, 800, "block should not snap");
|
||||
assert_equals(document.scrollingElement.scrollTop, 1800, "block should not snap");
|
||||
}, "The writing-mode (horizontal-tb) on the body is used ");
|
||||
</script>
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue