Add "auto" to ScrollLogicalPosition per https://github.com/w3c/csswg-drafts/issues/9576. Fragment navigation now passes WhereToScroll::Auto so that scroll-snap-align is respected when present, falling back to the spec defaults (start for block, nearest for inline) when absent. Explicit scrollIntoView() alignment values are no longer overridden by snap alignment. GetScrollSnapAlignFor previously returned None for all axes when the scroll container had scroll-snap-type: none. Remove that early return so that fragment navigation (which uses WhereToScroll::Auto) can still honor the target's scroll-snap-align even on non-snapping containers, as the spec permits. Differential Revision: https://phabricator.services.mozilla.com/D298959
38 lines
860 B
HTML
38 lines
860 B
HTML
<!DOCTYPE html>
|
|
<title>iframe for #target fragment navigation without scroll-snap-align</title>
|
|
<style type='text/css'>
|
|
html, body {
|
|
margin: 0; padding: 0;
|
|
}
|
|
html {
|
|
/* to make failing more obvious */
|
|
background: 0 0 1em linear-gradient(red, red) repeat-x fixed;
|
|
/* avoid anti-aliasing issues */
|
|
font: 20px/1 sans-serif;
|
|
scrollbar-width: none;
|
|
}
|
|
div {
|
|
height: 1em;
|
|
}
|
|
#target { background: green; }
|
|
.fail { color: red; } /* make failing more obvious */
|
|
|
|
/* emulate `scrollbar-width: none` for browsers that don't support it yet */
|
|
::-webkit-scrollbar { display: none; }
|
|
</style>
|
|
|
|
<div></div>
|
|
<div></div>
|
|
<div></div>
|
|
<div></div>
|
|
<div class="fail">FAIL</div>
|
|
<div id="target"></div>
|
|
<div></div>
|
|
<div></div>
|
|
<div></div>
|
|
<div class="fail">FAIL</div>
|
|
<div></div>
|
|
<div></div>
|
|
<div></div>
|
|
<div></div>
|