forked from mirrors/gecko-dev
Automatic update from web-platform-testsChange parsing order for scroll-snap-align to block/inline. As in the newest spec[1], the parsing order for scroll-snap-align is changed to block/inline. [1] https://drafts.csswg.org/css-scroll-snap-1/#scroll-snap-align Bug: 854379 Cq-Include-Trybots: luci.chromium.try :android_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel Change-Id: I70d2e9d526ffa0564e260faacdb5f79857a69324 Reviewed-on: https://chromium-review.googlesource.com/1115701 Reviewed-by: Majid Valipour <majidvp@chromium.org> Reviewed-by: David Bokan <bokan@chromium.org> Commit-Queue: David Bokan <bokan@chromium.org> Cr-Commit-Position: refs/heads/master@{#572869} -- wpt-commits: 0ffa5aaa7809a1957bdf260aaf55c16403fbf3fe wpt-pr: 11691 MozReview-Commit-ID: 4HG0lm1atpj
53 lines
No EOL
1.3 KiB
HTML
53 lines
No EOL
1.3 KiB
HTML
<!DOCTYPE html>
|
|
<link rel="help" href="https://drafts.csswg.org/css-scroll-snap-1" />
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<style>
|
|
div {
|
|
position: absolute;
|
|
margin: 0px;
|
|
}
|
|
#scroller {
|
|
width: 400px;
|
|
height: 350px;
|
|
overflow: scroll;
|
|
scroll-snap-type: both mandatory;
|
|
}
|
|
#space {
|
|
width: 1000px;
|
|
height: 1000px;
|
|
}
|
|
#target {
|
|
width: 200px;
|
|
height: 200px;
|
|
left: 300px;
|
|
top: 300px;
|
|
scroll-snap-align: end start;
|
|
}
|
|
</style>
|
|
|
|
<div id="scroller">
|
|
<div id="space"></div>
|
|
<div id="target"></div>
|
|
</div>
|
|
|
|
<script>
|
|
var scroller = document.getElementById("scroller");
|
|
var width = scroller.clientWidth;
|
|
var height = scroller.clientHeight;
|
|
[
|
|
["horizontal-tb", 300, 500 - height],
|
|
["vertical-lr", 500 - width, 300],
|
|
["vertical-rl", 300, 300]
|
|
].forEach(([writing_mode, left, top]) => {
|
|
test(() => {
|
|
scroller.style.writingMode = writing_mode;
|
|
if (writing_mode == "vertical-rl")
|
|
document.getElementById("target").style.left = (width - 700) + "px";
|
|
scroller.scrollTo(0, 0);
|
|
assert_equals(scroller.scrollLeft, left, "aligns correctly on x");
|
|
assert_equals(scroller.scrollTop, top, "aligns correctly on y");
|
|
}, "Snaps correctly for " + writing_mode +
|
|
" writing mode with 'inline' and 'block' alignments");
|
|
})
|
|
</script> |