mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Update web-platform-tests to revision b'468d01bbd84da2babf265c6af46947be68713440'
This commit is contained in:
parent
35e95f55a1
commit
58e8ee674b
9438 changed files with 266112 additions and 106976 deletions
|
@ -0,0 +1,50 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="help" href="https://drafts.csswg.org/css-scroll-snap-1/#scroll-margin">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-scroll-snap-1/#scroll-padding">
|
||||
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1708303">
|
||||
<link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez">
|
||||
<link rel="author" href="https://mozilla.org" title="Mozilla">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style>
|
||||
body { margin: 0 }
|
||||
#scroller {
|
||||
height: 500px;
|
||||
width: 500px;
|
||||
scroll-padding: 10px;
|
||||
scrollbar-width: none;
|
||||
overflow: hidden;
|
||||
}
|
||||
#target {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
background-color: blue;
|
||||
scroll-margin: 10px;
|
||||
margin-left: 1000px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="scroller">
|
||||
<div style="width: 2000px; height: 2000px;"></div>
|
||||
<div id="target"></div>
|
||||
<div style="width: 2000px; height: 2000px;"></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let scroller = document.getElementById("scroller");
|
||||
let target = document.getElementById("target");
|
||||
test(() => {
|
||||
scroller.scrollTo(0, 0);
|
||||
target.scrollIntoView({ block: "start", inline: "start" });
|
||||
|
||||
assert_equals(scroller.scrollTop, 2000 - 20, "Top should account for margin + padding");
|
||||
assert_equals(scroller.scrollLeft, 1000 - 20, "Left should account for margin + padding");
|
||||
});
|
||||
|
||||
test(() => {
|
||||
scroller.scrollTo(0, 0);
|
||||
target.scrollIntoView({ block: "end", inline: "end" });
|
||||
assert_equals(scroller.scrollTop, 2000 - 500 + 100 + 20, "Top should account for margin + padding");
|
||||
assert_equals(scroller.scrollLeft, 1000 - 500 + 100 + 20, "Left should account for margin + padding");
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue