Skip to content

Commit 9aed33d

Browse files
committed
[css-scroll-snap] Swap order of strictness and axis sections and add subheadings. This keeps related sections together (the mandatory-snapping warning and resnapping requirements together with capturing rules) and also puts the required parameter first.
1 parent 1ba30ee commit 9aed33d

File tree

1 file changed

+39
-34
lines changed

1 file changed

+39
-34
lines changed

css-scroll-snap/Overview.bs

Lines changed: 39 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -255,41 +255,12 @@ Scroll Snapping Rules: the 'scroll-snap-type' property {#scroll-snap-type}
255255

256256
The 'scroll-snap-type' property specifies
257257
whether a <a>scroll container</a> is a <a>scroll snap container</a>,
258-
how strictly it <a>snaps</a>,
259-
and which axes are considered.
260-
261-
The <dfn noexport lt="strictness value">strictness values</dfn>
262-
(''scroll-snap-type/none'', ''proximity'', ''mandatory'')
263-
specify how strictly
264-
<a>snap positions</a> are enforced on the <a>scroll container</a>
265-
(by forcing an adjustment to the scroll position).
258+
how <a href="#snap-strictness">strictly</a> it <a>snaps</a>,
259+
and <a href="#snap-axis">which axes</a> are considered.
266260
If no strictness value is specified, ''proximity'' is assumed.
267-
Values are defined as follows:
268-
269-
<dl dfn-type="value" dfn-for="scroll-snap-type">
270-
<dt><dfn>none</dfn>
271-
<dd>
272-
If specified on a <a>scroll container</a>, the <a>scroll container</a> must not <a>snap</a>.
273-
274-
<dt><dfn>mandatory</dfn>
275-
<dd>
276-
If specified on a <a>scroll container</a>, the <a>scroll container</a> is required to be <a>snapped</a> to a snap position when there are no active scrolling operations. If a reachable snap position exists then the scroll container must <a>snap</a> at the termination of a scroll (if none exist then no <a>snapping</a> occurs).
277261

278-
279-
<dt><dfn>proximity</dfn>
280-
<dd>
281-
If specified on a <a>scroll container</a>, the <a>scroll container</a> may <a>snap</a> to a snap position at the termination of a scroll, at the discretion of the UA given the parameters of the scroll.
282-
</dl>
283-
284-
A box <dfn export>captures snap positions</dfn>
285-
if it is a <a>scroll container</a>
286-
<em>or</em> has a value other than ''scroll-snap-type/none'' for 'scroll-snap-type'.
287-
If a box’s nearest <a lt="captures snap positions">snap-position capturing</a> ancestor
288-
on its <a>containing block chain</a>
289-
is a <a>scroll container</a> with a non-''scroll-snap-type/none'' value for 'scroll-snap-type',
290-
that is the box’s <dfn export local-lt="snap container">scroll snap container</dfn>.
291-
Otherwise, the box has no <a>scroll snap container</a>,
292-
and its <a>snap positions</a> do not trigger <a>snapping</a>.
262+
<h4 id="snap-axis">
263+
Scroll Snap Axis: the ''x'', ''y'', ''block'', ''inline'', and ''both'' values</h4>
293264

294265
The <dfn noexport lt="axis value">axis values</dfn>
295266
specify what axis(es) are affected by <a>snap positions</a>,
@@ -325,6 +296,31 @@ Scroll Snapping Rules: the 'scroll-snap-type' property {#scroll-snap-type}
325296
(potentially snapping to different elements in each axis).
326297
</dl>
327298

299+
<h4 id="snap-strictness">
300+
Scroll Snap Strictness: the ''scroll-snap-type/none'', ''proximity'', and ''mandatory'' values</h4>
301+
302+
The <dfn noexport lt="strictness value">strictness values</dfn>
303+
(''scroll-snap-type/none'', ''proximity'', ''mandatory'')
304+
specify how strictly
305+
<a>snap positions</a> are enforced on the <a>scroll container</a>
306+
(by forcing an adjustment to the scroll position).
307+
Values are defined as follows:
308+
309+
<dl dfn-type="value" dfn-for="scroll-snap-type">
310+
<dt><dfn>none</dfn>
311+
<dd>
312+
If specified on a <a>scroll container</a>, the <a>scroll container</a> must not <a>snap</a>.
313+
314+
<dt><dfn>mandatory</dfn>
315+
<dd>
316+
If specified on a <a>scroll container</a>, the <a>scroll container</a> is required to be <a>snapped</a> to a snap position when there are no active scrolling operations. If a reachable snap position exists then the scroll container must <a>snap</a> at the termination of a scroll (if none exist then no <a>snapping</a> occurs).
317+
318+
319+
<dt><dfn>proximity</dfn>
320+
<dd>
321+
If specified on a <a>scroll container</a>, the <a>scroll container</a> may <a>snap</a> to a snap position at the termination of a scroll, at the discretion of the UA given the parameters of the scroll.
322+
</dl>
323+
328324
Advisement:
329325
Authors should use mandatory snap positions with consideration of
330326
varyingly-sized screens and (if applicable) varying-sized content.
@@ -334,7 +330,16 @@ Scroll Snapping Rules: the 'scroll-snap-type' property {#scroll-snap-type}
334330
content in between can become inaccessible
335331
in cases where it is longer than the screen.
336332

337-
<!-- mandatory and proximity -->
333+
A box <dfn export>captures snap positions</dfn>
334+
if it is a <a>scroll container</a>
335+
<em>or</em> has a value other than ''scroll-snap-type/none'' for 'scroll-snap-type'.
336+
If a box’s nearest <a lt="captures snap positions">snap-position capturing</a> ancestor
337+
on its <a>containing block chain</a>
338+
is a <a>scroll container</a> with a non-''scroll-snap-type/none'' value for 'scroll-snap-type',
339+
that is the box’s <dfn export local-lt="snap container">scroll snap container</dfn>.
340+
Otherwise, the box has no <a>scroll snap container</a>,
341+
and its <a>snap positions</a> do not trigger <a>snapping</a>.
342+
338343
If the content or layout of the document changes
339344
(e.g. content is added, moved, deleted, resized)
340345
such that the content of the <a>snapport</a> changes,

0 commit comments

Comments
 (0)