Skip to content

Commit 17f6d8d

Browse files
committed
[css-scroll-snap] Per WG resolution, when navigating to a fragment: UAs must use snap positions if snapping is on, may use them if snapping is off, should pay attention to scroll-snap-margin regardless. Fixes #1707.
1 parent 091f30a commit 17f6d8d

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

css-scroll-snap-1/Overview.bs

+23-2
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,13 @@ Scroll Snapping Area: the 'scroll-snap-margin' property {#scroll-snap-margin}
516516
Note: This ensures that the <a>scroll snap area</a> is always rectangular
517517
and axis-aligned to the <a>scroll container’s</a> coordinate space.
518518

519+
If a page is navigated to a fragment that defines a target element
520+
(one that would be matched by '':target'',
521+
or the target of {{scrollIntoView()}}),
522+
the UA should use the element's <a>scroll snap area</a>,
523+
rather than just its border box,
524+
to determine which area of the <a>scrollable overflow region</a> to bring into view.
525+
519526
<!--
520527
███ ██ ████ ██████ ██ ██
521528
██ ██ ██ ██ ██ ██ ███ ██
@@ -924,8 +931,9 @@ Choosing Snap Positions {#choosing}
924931
(one that would be matched by '':target'',
925932
or the target of {{Element/scrollIntoView()}}),
926933
and that element defines some <a>snap positions</a>,
927-
the user agent should <a>snap</a> to one of that element’s <a>snap positions</a>.
928-
The user agent may do this even when the <a>scroll container</a> has ''scroll-snap-type: none''.
934+
the user agent must <a>snap</a> to one of that element’s <a>snap positions</a>
935+
if its nearest <a>scroll container</a> is a <a>scroll snap container</a>.
936+
The user agent <em>may</em> also do this even when the <a>scroll container</a> has ''scroll-snap-type: none''.
929937

930938
<!--
931939
██ ███████ ██ ██ ██████ ██ ██ ███ ██ ██ ████████ ██████
@@ -1085,6 +1093,19 @@ Acknowledgements {#acknowledgements}
10851093
Changes {#changes}
10861094
==================
10871095

1096+
Changes Since 24 August 2017 CR {#changes-20170824}
1097+
---------------------------------------------------
1098+
1099+
Changes since the <a href="https://www.w3.org/TR/2017/CR-css-scroll-snap-1-20170824/">24 August 2017 Candidate Recommendation</a> include:
1100+
1101+
* '':target''/{{scrollIntoView()}}/etc must use snap positions if snapping is turned on,
1102+
and may use them even if it's off.
1103+
* '':target''/{{scrollIntoView()}}/etc should take 'scroll-snap-margin' into account,
1104+
regardless of whether snapping is turned on or not.
1105+
1106+
Changes Since 20 October 2016 CR {#changes-20161020}
1107+
----------------------------------------------------
1108+
10881109
Changes since the <a href="https://www.w3.org/TR/2016/CR-css-scroll-snap-1-20161020/">20 October 2016 Candidate Recommendation</a> include:
10891110

10901111
<ul>

0 commit comments

Comments
 (0)