Skip to content

Commit 8a15f6c

Browse files
committed
[css-snappoints] Adding trapping behavior, deleting duplicate definitions so bikeshed will generate again and updating generated html.
1 parent eed931a commit 8a15f6c

File tree

2 files changed

+436
-163
lines changed

2 files changed

+436
-163
lines changed

css-snappoints/Overview.bs

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -216,16 +216,6 @@ Definitions {#definitions}
216216
<dd>
217217
An element which provides a scrolling user interface as described in [[!CSS21]], particularly in the section on overflow.
218218

219-
<dt><dfn export>snapport</dfn>
220-
<dd>
221-
A scroll container's snapport is the rectangle obtained by reducing its scrollport by its 'scroll-snap-padding'.
222-
223-
Issue: Better name for this concept?
224-
225-
<dt><dfn lt="scroll snap area" local-lt="snap area" export>snap area</dfn>
226-
<dd>
227-
An element's snap area is the rectangle obtained by expanding its border box by its 'scroll-snap-margin'.
228-
229219
<dt><dfn lt="scroll snap position" local-lt="snap position" export>snap position</dfn>
230220
<dd>
231221
For a scroll container, a particular value for its scroll offset is a snap position if when scrolled to that offset the scrollport of the scroll container would align with a descendent element in the manner specified by the scroll snap properties.
@@ -267,7 +257,7 @@ Scroll Snapping Rules: the 'scroll-snap-type' property {#scroll-snap-type}
267257
Animatable: no
268258
</pre>
269259

270-
The 'scroll-snap-type' property specifies how strictly a <a>scroll container</a> should <a>snap</a>, and which axes are considered.
260+
The 'scroll-snap-type' property specifies whether a <a>scroll container</a> is a <a>scroll snap container</a>, how strictly a <a>scroll container</a> should <a>snap</a>, and which axes are considered.
271261

272262
The <dfn noexport lt="strictness value">strictness values</dfn>
273263
(''scroll-snap-type/none'', ''proximity'', ''mandatory'')
@@ -283,21 +273,39 @@ Scroll Snapping Rules: the 'scroll-snap-type' property {#scroll-snap-type}
283273
<dl dfn-type="value" dfn-for="scroll-snap-type">
284274
<dt><dfn>none</dfn>
285275
<dd>
286-
The <a>scroll container</a> must not <a>snap</a>.
276+
If specified on a <a>scroll container</a>, the <a>scroll container</a> must not <a>snap</a>.
287277

288278
<dt><dfn>mandatory</dfn>
289279
<dd>
290-
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 no reachable snap position exists then no <a>snapping</a> occurs.
280+
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 no reachable snap position exists then no <a>snapping</a> occurs.
291281

292282
If the content changes such that the scroll container would no longer be <a>snapped</a> (e.g. content is added, moved, deleted, resized) to the same snap position it was snapped to before the content change, the scroll container must be re-snapped. If the same snap position it was snapped to before the content change still exists (e.g. its associated element was not deleted) and is reachable, the scroll container must be re-snapped to that same snap position after the content change.
293283

284+
If specified on a non-<a>scroll container</a>,
285+
this value “traps” descendant boxes’ <a>snap positions</a>,
286+
preventing them from affecting any ancestor <a>scroll containers</a>.
287+
294288
<dt><dfn>proximity</dfn>
295289
<dd>
296-
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.
290+
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.
297291

298292
If the content changes such that the scroll container would no longer be <a>snapped</a> (e.g. content is added, moved, deleted, resized) to the same snap position it was snapped to before the content change and that same snap position still exists (e.g. its associated element was not deleted) and is reachable, the scroll container must be re-snapped to that same snap position after the content change.
293+
294+
If specified on a non-<a>scroll container</a>,
295+
this value “traps” descendant boxes’ <a>snap positions</a>,
296+
preventing them from affecting any ancestor <a>scroll containers</a>.
299297
</dl>
300298

299+
A box <dfn export>captures snap positions</dfn>
300+
if it is a <a>scroll container</a>
301+
<em>or</em> has a value other than ''scroll-snap-type/none'' for 'scroll-snap-type'.
302+
If a box's nearest <a lt="captures snap positions">snap-position capturing</a> ancestor
303+
on its <a>containing block chain</a>
304+
is a <a>scroll container</a> with a non-''scroll-snap-type/none'' value for 'scroll-snap-type',
305+
that is the box's <dfn export local-lt="snap container">scroll snap container</dfn>.
306+
Otherwise, the box has no <a>scroll snap container</a>,
307+
and its <a>snap positions</a> do not trigger <a>snapping</a>.
308+
301309
The <dfn noexport lt="axis value">axis values</dfn>
302310
specify what axis(es) are affected by <a>snap positions</a>,
303311
and whether <a>snap positions</a> are evaluated independently per axis,
@@ -338,7 +346,7 @@ Scroll Snapping Rules: the 'scroll-snap-type' property {#scroll-snap-type}
338346
Authors should use mandatory snap positions with consideration of
339347
varyingly-sized screens and (if applicable) varying-sized content.
340348
In particular, although access to snapped elements larger than the viewport
341-
is <a href="#snap-overflow">handled by the UA</a>,
349+
is handled by the UA,
342350
if authors assign mandatory snapping to non-adjacent siblings,
343351
content in between can become inaccessible
344352
in cases where it is longer than the screen.

0 commit comments

Comments
 (0)