Update web-platform-tests to revision d73b07b850fa51f23e846518bb6e8c59c58eef19

This commit is contained in:
WPT Sync Bot 2019-04-29 21:53:13 -04:00
parent 62031e3cb0
commit 7776ed79d7
107 changed files with 3306 additions and 538 deletions

View file

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<title>Reference</title>
<link rel='author' title='Elika J. Etemad' href='http://fantasai.inkedblade.net/contact'>
<style type='text/css'>
.container {
border: solid blue 4px;
height: 4em;
overflow: auto;
font: 20px/1 sans-serif;
}
.container > div {
height: 1em;
margin: 1em 0;
background: green;
}
</style>
<div id='instructions'>Test passes if there is a green stripe across the second quarter of the box below and no red.</div>
<div class="container">
<div></div>
</div>

View file

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<title>#target and snap position with snapping off (y-axis)</title>
<link rel='author' title='Elika J. Etemad' href='http://fantasai.inkedblade.net/contact'>
<link rel='help' href='https://www.w3.org/TR/css-scroll-snap-1/#choosing'>
<link rel='match' href='scroll-target-001-ref.html'>
<meta name="flags" content="may">
<meta name='assert'
content="Test passes if scroll snapping is honored
on a scroll container with 'scroll-snap-type: none'
when navigating to an element with the target fragment ID.">
<style type='text/css'>
iframe {
border: solid blue 4px;
height: 80px;
width: calc(100% - 8px);
}
</style>
<div id='instructions'>Test passes if there is a green stripe across the second quarter of the box below and no red.</div>
<iframe class="container" src="support/scroll-target-align-001-iframe.html#target">This UA doesn't support iframes; please request a custom version of this test!</iframe>

View file

@ -0,0 +1,57 @@
<!DOCTYPE html>
<html>
<title>scrollIntoView() and snap position with snapping off (y-axis)</title>
<link rel='author' title='Elika J. Etemad' href='http://fantasai.inkedblade.net/contact'>
<link rel='help' href='https://www.w3.org/TR/css-scroll-snap-1/#choosing'>
<link rel='match' href='scroll-target-001-ref.html'>
<meta name="flags" content="may">
<meta name='assert'
content="Test passes if scroll snapping is honored
on a scroll container with 'scroll-snap-type: none'
when scrolling an element into view
explicitly by script.">
<style type='text/css'>
.container {
border: solid blue 4px;
height: 4em;
overflow: auto;
/* to make failing more obvious */
background: 0 1em / 100% 1em linear-gradient(red, red) repeat-x;
/* avoid anti-aliasing issues */
font: 20px/1 sans-serif;
scrollbar-width: none;
}
.container > div {
height: 1em;
}
.container { scroll-padding: .5em 0 0; } /* set up a snap position */
#target { scroll-margin: .5em 0 0;
scroll-snap-align: center; }
#stripe { background: green; } /* color part of the snap area */
.fail { color: red; } /* make failing more obvious */
</style>
<div id='instructions'>Test passes if there is a green stripe across the second quarter of the box below and no red.</div>
<div class="container">
<div></div>
<div></div>
<div></div>
<div></div>
<div class="fail">FAIL</div>
<div></div>
<div id="stripe"></div>
<div id="target"></div>
<div></div>
<div class="fail">FAIL</div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<script>
document.getElementById('target').scrollIntoView();
</script>

View file

@ -0,0 +1,58 @@
<!DOCTYPE html>
<html>
<title>focus() and snap position with snapping off (y-axis)</title>
<link rel='author' title='Elika J. Etemad' href='http://fantasai.inkedblade.net/contact'>
<link rel='help' href='https://www.w3.org/TR/css-scroll-snap-1/#choosing'>
<link rel='match' href='scroll-target-001-ref.html'>
<meta name="flags" content="may">
<meta name='assert'
content="Test passes if scroll snapping is honored
on a scroll container with 'scroll-snap-type: none'
when scrolling an element into view
even if that operation is implied (in this case, by .focus()).">
<style type='text/css'>
.container {
border: solid blue 4px;
height: 4em;
overflow: auto;
/* to make failing more obvious */
background: 0 1em / 100% 1em linear-gradient(red, red) repeat-x;
/* avoid anti-aliasing issues */
font: 20px/1 sans-serif;
scrollbar-width: none;
}
.container > div, a {
height: 1em;
display: block;
outline: none;
}
.container { scroll-padding: .5em 0 0; } /* set up a snap position */
#target { scroll-margin: .5em 0 0;
scroll-snap-align: center; }
#stripe { background: green; } /* color part of the snap area */
.fail { color: red; } /* make failing more obvious */
</style>
<div id='instructions'>Test passes if there is a green stripe across the second quarter of the box below and no red.</div>
<div class="container">
<div></div>
<div></div>
<div></div>
<div></div>
<div class="fail">FAIL</div>
<div></div>
<div id="stripe"></div>
<a href="" id="target"></a>
<div></div>
<div class="fail">FAIL</div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<script>
document.getElementById('target').focus();
</script>

View file

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<title>#target and scroll-margin with snapping off (y-axis)</title>
<link rel='author' title='Elika J. Etemad' href='http://fantasai.inkedblade.net/contact'>
<link rel='help' href='https://www.w3.org/TR/css-scroll-snap-1/#scroll-margin'>
<link rel='match' href='scroll-target-001-ref.html'>
<meta name="flags" content="should">
<meta name='assert'
content="Test passes if scroll-margin is honored
on a scroll container with 'scroll-snap-type: none'
when navigating to an element with the target fragment ID.">
<style type='text/css'>
iframe {
border: solid blue 4px;
height: 80px;
width: calc(100% - 8px);
}
</style>
<div id='instructions'>Test passes if there is a green stripe across the second quarter of the box below and no red.</div>
<iframe class="container" src="support/scroll-target-margin-001-iframe.html#target">This UA doesn't support iframes; please request a custom version of this test!</iframe>

View file

@ -0,0 +1,54 @@
<!DOCTYPE html>
<html>
<title>scrollIntoView() and scroll-margin with snapping off (y-axis)</title>
<link rel='author' title='Elika J. Etemad' href='http://fantasai.inkedblade.net/contact'>
<link rel='help' href='https://www.w3.org/TR/css-scroll-snap-1/#scroll-margin'>
<link rel='match' href='scroll-target-001-ref.html'>
<meta name="flags" content="should">
<meta name='assert'
content="Test passes if scroll-margin is honored
on a scroll container with 'scroll-snap-type: none'
when scrolling an element into view
explicitly by script.">
<style type='text/css'>
.container {
border: solid blue 4px;
height: 4em;
overflow: auto;
/* to make failing more obvious */
background: 0 1em / 100% 1em linear-gradient(red, red) repeat-x;
/* avoid anti-aliasing issues */
font: 20px/1 sans-serif;
scrollbar-width: none;
}
.container > div {
height: 1em;
}
#target { scroll-margin: 2em 0 1em; } /* snap area is exact fit for snapport */
#stripe { background: green; } /* color part of the snap area */
.fail { color: red; } /* make failing more obvious */
</style>
<div id='instructions'>Test passes if there is a green stripe across the second quarter of the box below and no red.</div>
<div class="container">
<div></div>
<div></div>
<div></div>
<div></div>
<div class="fail">FAIL</div>
<div></div>
<div id="stripe"></div>
<div id="target"></div>
<div></div>
<div class="fail">FAIL</div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<script>
document.getElementById('target').scrollIntoView();
</script>

View file

@ -0,0 +1,56 @@
<!DOCTYPE html>
<html>
<title>focus() and scroll-margin with snapping off (y-axis)</title>
<link rel='author' title='Elika J. Etemad' href='http://fantasai.inkedblade.net/contact'>
<link rel='help' href='https://www.w3.org/TR/css-scroll-snap-1/#scroll-margin'>
<link rel='match' href='scroll-target-001-ref.html'>
<meta name="flags" content="should">
<meta name='assert'
content="Test passes if scroll-margin is honored
on a scroll container with 'scroll-snap-type: none'
when scrolling an element into view
even if that operation is implied (in this case, by .focus()).">
<style type='text/css'>
.container {
border: solid blue 4px;
height: 4em;
overflow: auto;
/* to make failing more obvious */
background: 0 1em / 100% 1em linear-gradient(red, red) repeat-x;
/* avoid anti-aliasing issues */
font: 20px/1 sans-serif;
scrollbar-width: none;
}
.container > div, a {
height: 1em;
display: block;
outline: none;
}
#target { scroll-margin: 2em 0 1em; } /* snap area is exact fit for snapport */
#stripe { background: green; } /* color part of the snap area */
.fail { color: red; } /* make failing more obvious */
</style>
<div id='instructions'>Test passes if there is a green stripe across the second quarter of the box below and no red.</div>
<div class="container">
<div></div>
<div></div>
<div></div>
<div></div>
<div class="fail">FAIL</div>
<div></div>
<div id="stripe"></div>
<a href="" id="target"></a>
<div></div>
<div class="fail">FAIL</div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<script>
document.getElementById('target').focus();
</script>

View file

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<title>#target and scroll-padding with snapping off (y-axis)</title>
<link rel='author' title='Elika J. Etemad' href='http://fantasai.inkedblade.net/contact'>
<link rel='help' href='https://www.w3.org/TR/css-scroll-snap-1/#scroll-padding'>
<link rel='match' href='scroll-target-001-ref.html'>
<meta name='assert'
content="Test passes if scroll-padding is honored
on a scroll container with 'scroll-snap-type: none'
when navigating to an element with the target fragment ID.">
<style type='text/css'>
iframe {
border: solid blue 4px;
height: 80px;
width: calc(100% - 8px);
}
</style>
<div id='instructions'>Test passes if there is a green stripe across the second quarter of the box below and no red.</div>
<iframe class="container" src="support/scroll-target-padding-001-iframe.html#target">This UA doesn't support iframes; please request a custom version of this test!</iframe>

View file

@ -0,0 +1,53 @@
<!DOCTYPE html>
<html>
<title>scrollIntoView() and scroll-padding with snapping off (y-axis)</title>
<link rel='author' title='Elika J. Etemad' href='http://fantasai.inkedblade.net/contact'>
<link rel='help' href='https://www.w3.org/TR/css-scroll-snap-1/#scroll-padding'>
<link rel='match' href='scroll-target-001-ref.html'>
<meta name='assert'
content="Test passes if scroll-padding is honored
on a scroll container with 'scroll-snap-type: none'
when scrolling an element into view
explicitly by script.">
<style type='text/css'>
.container {
border: solid blue 4px;
height: 4em;
overflow: auto;
/* to make failing more obvious */
background: 0 1em / 100% 1em linear-gradient(red, red) repeat-x;
/* avoid anti-aliasing issues */
font: 20px/1 sans-serif;
scrollbar-width: none;
}
.container > div {
height: 1em;
}
.container { scroll-padding: 2em 0 1em; } /* snap area is exact fit for snapport */
#stripe { background: green; } /* color part of the snap area */
.fail { color: red; } /* make failing more obvious */
</style>
<div id='instructions'>Test passes if there is a green stripe across the second quarter of the box below and no red.</div>
<div class="container">
<div></div>
<div></div>
<div></div>
<div></div>
<div class="fail">FAIL</div>
<div></div>
<div id="stripe"></div>
<div id="target"></div>
<div></div>
<div class="fail">FAIL</div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<script>
document.getElementById('target').scrollIntoView();
</script>

View file

@ -0,0 +1,55 @@
<!DOCTYPE html>
<html>
<title>focus() and scroll-padding with snapping off (y-axis)</title>
<link rel='author' title='Elika J. Etemad' href='http://fantasai.inkedblade.net/contact'>
<link rel='help' href='https://www.w3.org/TR/css-scroll-snap-1/#scroll-margin'>
<link rel='match' href='scroll-target-001-ref.html'>
<meta name='assert'
content="Test passes if scroll-padding is honored
on a scroll container with 'scroll-snap-type: none'
when scrolling an element into view
even if that operation is implied (in this case, by .focus()).">
<style type='text/css'>
.container {
border: solid blue 4px;
height: 4em;
overflow: auto;
/* to make failing more obvious */
background: 0 1em / 100% 1em linear-gradient(red, red) repeat-x;
/* avoid anti-aliasing issues */
font: 20px/1 sans-serif;
scrollbar-width: none;
}
.container > div, a {
height: 1em;
display: block;
outline: none;
}
.container { scroll-padding: 2em 0 1em; } /* snap area is exact fit for snapport */
#stripe { background: green; } /* color part of the snap area */
.fail { color: red; } /* make failing more obvious */
</style>
<div id='instructions'>Test passes if there is a green stripe across the second quarter of the box below and no red.</div>
<div class="container">
<div></div>
<div></div>
<div></div>
<div></div>
<div class="fail">FAIL</div>
<div></div>
<div id="stripe"></div>
<a href="" id="target"></a>
<div></div>
<div class="fail">FAIL</div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<script>
document.getElementById('target').focus();
</script>

View file

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<title>#target and snap position with snapping on (y-axis)</title>
<link rel='author' title='Elika J. Etemad' href='http://fantasai.inkedblade.net/contact'>
<link rel='help' href='https://www.w3.org/TR/css-scroll-snap-1/#choosing'>
<link rel='match' href='scroll-target-001-ref.html'>
<meta name='assert'
content="Test passes if scroll snapping is honored
when navigating to an element with the target fragment ID.">
<style type='text/css'>
iframe {
border: solid blue 4px;
height: 80px;
width: calc(100% - 8px);
}
</style>
<div id='instructions'>Test passes if there is a green stripe across the second quarter of the box below and no red.</div>
<iframe class="container" src="support/scroll-target-snap-001-iframe.html#target">This UA doesn't support iframes; please request a custom version of this test!</iframe>

View file

@ -0,0 +1,64 @@
<!DOCTYPE html>
<html>
<title>scrollIntoView() and snap position with snapping on (y-axis)</title>
<link rel='author' title='Elika J. Etemad' href='http://fantasai.inkedblade.net/contact'>
<link rel='help' href='https://www.w3.org/TR/css-scroll-snap-1/#choosing'>
<link rel='match' href='scroll-target-001-ref.html'>
<meta name='assert'
content="Test passes if scroll snapping is honored
when scrolling an element into view
explicitly by script.">
<style type='text/css'>
.container {
border: solid blue 4px;
height: 4em;
overflow: auto;
scroll-snap-type: block;
/* to make failing more obvious */
background: 0 1em / 100% 1em linear-gradient(red, red) repeat-x;
/* avoid anti-aliasing issues */
font: 20px/1 sans-serif;
scrollbar-width: none;
}
.container > div {
height: 1em;
}
#target { scroll-margin: 1em 0 0;
scroll-snap-align: center; } /* set up a snap position */
#stripe { background: green; } /* color part of the snap area */
.fail { color: red; } /* make failing more obvious */
/* Try to foil the UA */
.foilup { margin-bottom: -1em; scroll-snap-align: start; }
.foildn { margin-top: -1em; scroll-snap-align: end; }
</style>
<div id='instructions'>Test passes if there is a green stripe across the second quarter of the box below and no red.</div>
<div class="container">
<div></div>
<div></div>
<div></div>
<div></div>
<div class="foilup"></div>
<div class="fail">FAIL</div>
<div></div>
<div id="stripe"></div>
<div class="foilup"></div>
<div class="foildn"></div>
<div id="target"></div>
<div></div>
<div class="fail">FAIL</div>
<div class="foildn"></div>
<div></div>
<div class="foildn"></div>
<div></div>
<div></div>
<div></div>
</div>
<script>
document.getElementById('target').scrollIntoView();
</script>

View file

@ -0,0 +1,66 @@
<!DOCTYPE html>
<html>
<title>focus() and snap position with snapping on (y-axis)</title>
<link rel='author' title='Elika J. Etemad' href='http://fantasai.inkedblade.net/contact'>
<link rel='help' href='https://www.w3.org/TR/css-scroll-snap-1/#choosing'>
<link rel='match' href='scroll-target-001-ref.html'>
<meta name='assert'
content="Test passes if scroll snapping is honored
when scrolling an element into view
even if that operation is implied (in this case, by .focus()).">
<style type='text/css'>
.container {
border: solid blue 4px;
height: 4em;
overflow: auto;
scroll-snap-type: block;
/* to make failing more obvious */
background: 0 1em / 100% 1em linear-gradient(red, red) repeat-x;
/* avoid anti-aliasing issues */
font: 20px/1 sans-serif;
scrollbar-width: none;
}
.container > div, a {
height: 1em;
display: block;
outline: none;
}
#target { scroll-margin: 1em 0 0;
scroll-snap-align: center; } /* set up a snap position */
#stripe { background: green; } /* color part of the snap area */
.fail { color: red; } /* make failing more obvious */
/* Try to foil the UA */
.foilup { margin-bottom: -1em; scroll-snap-align: start; }
.foildn { margin-top: -1em; scroll-snap-align: end; }
</style>
<div id='instructions'>Test passes if there is a green stripe across the second quarter of the box below and no red.</div>
<div class="container">
<div></div>
<div></div>
<div></div>
<div></div>
<div class="foilup"></div>
<div class="fail">FAIL</div>
<div></div>
<div id="stripe"></div>
<div class="foilup"></div>
<a href="" id="target"></a>
<div class="foildn"></div>
<div></div>
<div class="fail">FAIL</div>
<div class="foildn"></div>
<div></div>
<div class="foildn"></div>
<div></div>
<div></div>
<div></div>
</div>
<script>
document.getElementById('target').focus();
</script>

View file

@ -22,7 +22,6 @@ div {
height: 200px;
left: 300px;
top: 300px;
scroll-snap-align: end start;
}
</style>
@ -32,22 +31,81 @@ div {
</div>
<script>
var scroller = document.getElementById("scroller");
var width = scroller.clientWidth;
var height = scroller.clientHeight;
const scroller_width = scroller.clientWidth;
const scroller_height = scroller.clientHeight;
[
["horizontal-tb", 300, 500 - height],
["vertical-lr", 500 - width, 300],
["vertical-rl", width - 700, 300]
["horizontal-tb", 300, 500 - scroller_height],
["vertical-lr", 500 - scroller_width, 300],
["vertical-rl", scroller_width - 700, 300]
].forEach(([writing_mode, left, top]) => {
test(() => {
const target_left = getComputedStyle(target).left;
scroller.style.writingMode = writing_mode;
if (writing_mode == "vertical-rl")
document.getElementById("target").style.left = (width - 700) + "px";
target.style.scrollSnapAlign = "end start";
if (writing_mode == "vertical-rl") {
target.style.left = (scroller_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");
target.style.left = target_left;
scroller.style.writingMode = "";
}, "Snaps correctly for " + writing_mode +
" writing mode with 'inline' and 'block' alignments");
})
" writing mode with 'scroll-snap-align: end start' alignment");
});
[
["horizontal-tb", 500 - scroller_width, 300],
["vertical-lr", 300, 500 - scroller_height],
["vertical-rl", target.clientWidth - 700, 500 - scroller_height]
].forEach(([writing_mode, left, top]) => {
test(() => {
const target_left = getComputedStyle(target).left;
scroller.style.writingMode = writing_mode;
target.style.scrollSnapAlign = "start end";
if (writing_mode == "vertical-rl") {
target.style.left = (scroller_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");
target.style.left = target_left;
scroller.style.writingMode = "";
}, "Snaps correctly for " + writing_mode +
" writing mode with 'scroll-snap-align: start end' alignment");
});
test(() => {
const target_left = getComputedStyle(target).left;
scroller.style.direction = "rtl";
target.style.scrollSnapAlign = "end start";
target.style.left = (scroller_width - 700) + "px";
scroller.scrollTo(0, 0);
assert_equals(scroller.scrollLeft, target.clientWidth - 700,
"aligns correctly on x");
assert_equals(scroller.scrollTop, 500 - scroller_height,
"aligns correctly on y");
target.style.left = target_left;
scroller.style.direction = "";
}, "Snaps correctly for 'direction: rtl' with 'scroll-snap-align: end start' " +
"alignment");
test(() => {
const target_left = getComputedStyle(target).left;
scroller.style.direction = "rtl";
target.style.scrollSnapAlign = "start end";
target.style.left = (scroller_width - 700) + "px";
scroller.scrollTo(0, 0);
assert_equals(scroller.scrollLeft, scroller_width - 700,
"aligns correctly on x");
assert_equals(scroller.scrollTop, 300, "aligns correctly on y");
target.style.left = target_left;
scroller.style.direction = "";
}, "Snaps correctly for 'direction: rtl' with 'scroll-snap-align: start end' " +
"alignment");
</script>

View file

@ -0,0 +1,38 @@
<!DOCTYPE html>
<title>iframe for #target and snap position with snapping off</title>
<style type='text/css'>
html, body {
margin: 0; padding: 0;
}
html {
/* to make failing more obvious */
background: 0 1em / 100% 1em linear-gradient(red, red) repeat-x fixed;
/* avoid anti-aliasing issues */
font: 20px/1 sans-serif;
scrollbar-width: none;
}
div {
height: 1em;
}
html { scroll-padding: .5em 0 0; } /* set up a snap position */
#target { scroll-margin: .5em 0 0;
scroll-snap-align: center; }
#stripe { background: green; } /* color part of the snap area */
.fail { color: red; } /* make failing more obvious */
}
</style>
<div></div>
<div></div>
<div></div>
<div></div>
<div class="fail">FAIL</div>
<div></div>
<div id="stripe"></div>
<div id="target"></div>
<div></div>
<div class="fail">FAIL</div>
<div></div>
<div></div>
<div></div>
<div></div>

View file

@ -0,0 +1,36 @@
<!DOCTYPE html>
<title>iframe for #target and scroll-margin with snapping off (y</title>
<style type='text/css'>
html, body {
margin: 0; padding: 0;
}
html {
/* to make failing more obvious */
background: 0 1em / 100% 1em linear-gradient(red, red) repeat-x fixed;
/* avoid anti-aliasing issues */
font: 20px/1 sans-serif;
scrollbar-width: none;
}
div {
height: 1em;
}
#target { scroll-margin: 2em 0 1em; } /* snap area is exact fit for snapport */
#stripe { background: green; } /* color part of the snap area */
.fail { color: red; } /* make failing more obvious */
}
</style>
<div></div>
<div></div>
<div></div>
<div></div>
<div class="fail">FAIL</div>
<div></div>
<div id="stripe"></div>
<div id="target"></div>
<div></div>
<div class="fail">FAIL</div>
<div></div>
<div></div>
<div></div>
<div></div>

View file

@ -0,0 +1,36 @@
<!DOCTYPE html>
<title>iframe for #target and scroll-snap-padding with snapping off (y</title>
<style type='text/css'>
html, body {
margin: 0; padding: 0;
}
html {
/* to make failing more obvious */
background: 0 1em / 100% 1em linear-gradient(red, red) repeat-x fixed;
/* avoid anti-aliasing issues */
font: 20px/1 sans-serif;
scrollbar-width: none;
}
div {
height: 1em;
}
html { scroll-padding: 2em 0 1em; } /* snap area is exact fit for snapport */
#stripe { background: green; } /* color part of the snap area */
.fail { color: red; } /* make failing more obvious */
}
</style>
<div></div>
<div></div>
<div></div>
<div></div>
<div class="fail">FAIL</div>
<div></div>
<div id="stripe"></div>
<div id="target"></div>
<div></div>
<div class="fail">FAIL</div>
<div></div>
<div></div>
<div></div>
<div></div>

View file

@ -0,0 +1,48 @@
<!DOCTYPE html>
<title>iframe for #target and snap position with snapping on</title>
<style type='text/css'>
html, body {
margin: 0; padding: 0;
}
html {
/* to make failing more obvious */
background: 0 1em / 100% 1em linear-gradient(red, red) repeat-x fixed;
/* avoid anti-aliasing issues */
font: 20px/1 sans-serif;
scrollbar-width: none;
/* turn on snapping */
scroll-snap-type: block;
}
div {
height: 1em;
}
#target { scroll-margin: 1em 0 0;
scroll-snap-align: center; } /* set up a snap position */
#stripe { background: green; } /* color part of the snap area */
.fail { color: red; } /* make failing more obvious */
/* Try to foil the UA */
.foilup { margin-bottom: -1em; scroll-snap-align: start; }
.foildn { margin-top: -1em; scroll-snap-align: end; }
</style>
<div></div>
<div></div>
<div></div>
<div></div>
<div class="foilup"></div>
<div class="fail">FAIL</div>
<div></div>
<div id="stripe"></div>
<div class="foilup"></div>
<div id="target"></div>
<div class="foildn"></div>
<div></div>
<div class="fail">FAIL</div>
<div class="foildn"></div>
<div></div>
<div class="foildn"></div>
<div></div>
<div></div>
<div></div>