Skip to content

Commit 3d121cf

Browse files
committed
[css-gaps-1][editorial] More reordering of content
1 parent 66b4170 commit 3d121cf

1 file changed

Lines changed: 77 additions & 73 deletions

File tree

css-gaps-1/Overview.bs

Lines changed: 77 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ Segment endpoints</h4>
229229
<li><dfn>end segment endpoint</dfn>: Point at which a segment ends.
230230
</ul>
231231

232-
<div algorithm="create segment endpoints for a gap">
233-
To <dfn>create segment endpoints for a gap</dfn> |G|:
232+
<div algorithm="create segment endpoints">
233+
To <dfn>create segment endpoints</dfn> for a gap |G|:
234234
<ol>
235235
<li>Bounds of a Gap:
236236
<p>Create endpoints at |G|'s two bounds:
@@ -335,20 +335,43 @@ Segment endpoints</h4>
335335
</div>
336336

337337
<h4 id="segments">
338-
Segments</h4>
338+
Gap decoration segments</h4>
339+
340+
<h5 class="no-toc no-num" id="segments-definitions">
341+
Definitions</h5>
339342

340343
A <dfn>gap decoration segment</dfn> is formed by pairing a [=start segment endpoint=] with an [=end segment endpoint=].
341344
Each [=gap=] forms a collection of [=gap decoration segments=].
342345

346+
In this section, we represent a [=gap decoration segment=] |s| as
347+
<code>|s| = [|s|.start, |s|.end]</code>,
348+
where <code>|s|.start</code> is the <a>start segment endpoint</a> of the segment,
349+
and <code>|s|.end</code> is the <a>end segment endpoint</a> of the segment.
350+
351+
Let <dfn>UNION</dfn>(|s1|, |s2|) be equal to [|s1|.start, |s2|.end].
352+
353+
A [=gap decoration segment=] is <dfn>flanked by spanning items</dfn> if, for
354+
every [=gap junction=] between its endpoints, there exist items on opposing sides of
355+
the gap that span across all perpendicular [=gaps=] contributing to that junction.
356+
357+
In the context of a given [=gap=], a pair of <a>segment endpoints</a> |a| and |b| is considered <dfn>discontiguous</dfn>
358+
if a line segment from |a| to |b|, with the same width as the [=gap=], intersects a child item in the container.
359+
360+
<h5 class="no-toc no-num" id="segments-algorithms">
361+
Algorithms</h5>
362+
343363
<div algorithm>
344364
To <dfn>determine the gap decoration segments</dfn> for a given [=gap=] |G|:
345365
<ol>
346366
<li>
347367
Let |S|, the collection of [=gap decoration segments=] for |G|, be an empty list.
348368
</li>
349369
<li>
350-
Let |endpoints| be the list of all <a>segment endpoints</a> <a lt="create segment endpoints for a gap">created</a> for |G|,
351-
ordered by their position along the centerline from start to end.
370+
Let |endpoints| be the result of [=creating segment endpoints=] for |G|,
371+
ordered by their position along |G|'s centerline from start to end.
372+
373+
Note: This list is guaranteed to contain an even number of elements that strictly alternate
374+
between [=start segment endpoint=] and [=end segment endpoint=], beginning with a [=start segment endpoint=].
352375
</li>
353376
<li>
354377
While |endpoints| is not empty:
@@ -364,9 +387,55 @@ Segments</h4>
364387
</li>
365388
</ol>
366389

367-
Note: Based on the algorithm for [=create segment endpoints for a gap|creating segment endpoints=],
368-
the list |endpoints| is guaranteed to contain an even number of elements that strictly alternate
369-
between [=start segment endpoint=] and [=end segment endpoint=], beginning with a [=start segment endpoint=].
390+
</div>
391+
392+
<div algorithm>
393+
To <dfn>determine painted segments</dfn> |C| from segments list |S|:
394+
395+
<ol>
396+
<li>Let |S| be the list of segments <a lt="determine the gap decoration segments">determined</a> for the given gap, ordered from start to end along the gap's axis.
397+
<li>Let |C| be an empty list of segments.
398+
<li>Let |break| be the used value of either 'column-rule-break' or 'row-rule-break', whichever applies to the gap.
399+
400+
<li>If |S| is empty, return |C|.
401+
402+
<li>If |break| is ''column-rule-break/none'':
403+
<ol>
404+
<li>Let |first| be the first segment in |S|.
405+
<li>Let |last| be the last segment in |S|.
406+
<li>Let |segment| be [=UNION=](|first|, |last|).
407+
<li>[=Apply offsets to a segment|Apply offsets to=] |segment|, then append it to |C|.
408+
<li>Return |C|.
409+
</ol>
410+
411+
<li>Remove the first segment from |S|. Let |s| be that segment.
412+
413+
<li>If |s|'s endpoints are <a>discontiguous</a>, go back to step 4.
414+
415+
<li>If |S| is not empty:
416+
<ol>
417+
<li>Let |next| be the first segment in |S|.
418+
<li>Let |candidate| be <a>UNION</a>(|s|, |next|).
419+
<li>If |candidate|'s endpoints are <a>discontiguous</a>, go to step 9.
420+
<li>If |break| is ''column-rule-break/intersection'' and |candidate| is not <a>flanked by spanning items</a>, go to step 9.
421+
<li>Remove the first segment from |S|.
422+
<li>Set |s| to <a>UNION</a>(|s|, |next|).
423+
<li>Go back to step 8.
424+
</ol>
425+
426+
<li>[=Apply offsets to a segment|Apply offsets to=] |s|, then append it to |C|.
427+
428+
<li>Go back to step 4.
429+
</ol>
430+
</div>
431+
432+
<div algorithm>
433+
To <dfn>apply offsets to a segment</dfn> |s| = [|start|, |end|]:
434+
<ol>
435+
<li>Offset |start| by the used value of the applicable [[#inset|rule-inset]] property.
436+
<li>Offset |end| by the used value of the applicable [[#inset|rule-inset]] property.
437+
<li>Update |s| with the adjusted [|start|, |end|].
438+
</ol>
370439
</div>
371440

372441
<div class="example">
@@ -424,71 +493,6 @@ Segments</h4>
424493
</figure>
425494
</div>
426495

427-
<h4 id="painted-segments">
428-
Painted segments</h4>
429-
430-
Recall that a <a>gap decoration segment</a>, |s|, can be represented as:
431-
|s| = [|s|.start, |s|.end]
432-
where |s|.start is the <a>start segment endpoint</a> of the segment, and |s|.end is the <a>end segment endpoint</a> of the segment.
433-
434-
In the context of a given gap, a pair of <a>segment endpoints</a> |a| and |b| is considered <dfn>discontiguous</dfn>
435-
if a line segment from |a| to |b|, with the same width as the gap, intersects a child item in the container.
436-
437-
Let <dfn>UNION</dfn>(|s1|, |s2|) be equal to [|s1|.start, |s2|.end].
438-
439-
A [=gap decoration segment=] is <dfn>flanked by spanning items</dfn> if, for
440-
every [=gap junction=] between its endpoints, there exist items on opposing sides of
441-
the gap that span across all perpendicular [=gaps=] contributing to that junction.
442-
443-
<div algorithm>
444-
To <dfn>determine painted segments</dfn> |C| from segments list |S|:
445-
446-
<ol>
447-
<li>Let |S| be the list of segments <a lt="determine the gap decoration segments">determined</a> for the given gap, ordered from start to end along the gap's axis.
448-
<li>Let |C| be an empty list of segments.
449-
<li>Let |break| be the used value of either 'column-rule-break' or 'row-rule-break', whichever applies to the gap.
450-
451-
<li>If |S| is empty, return |C|.
452-
453-
<li>If |break| is ''column-rule-break/none'':
454-
<ol>
455-
<li>Let |first| be the first segment in |S|.
456-
<li>Let |last| be the last segment in |S|.
457-
<li>Let |segment| be [=UNION=](|first|, |last|).
458-
<li>[=Apply offsets to a segment|Apply offsets to=] |segment|, then append it to |C|.
459-
<li>Return |C|.
460-
</ol>
461-
462-
<li>Remove the first segment from |S|. Let |s| be that segment.
463-
464-
<li>If |s|'s endpoints are <a>discontiguous</a>, go back to step 4.
465-
466-
<li>If |S| is not empty:
467-
<ol>
468-
<li>Let |next| be the first segment in |S|.
469-
<li>Let |candidate| be <a>UNION</a>(|s|, |next|).
470-
<li>If |candidate|'s endpoints are <a>discontiguous</a>, go to step 9.
471-
<li>If |break| is ''column-rule-break/intersection'' and |candidate| is not <a>flanked by spanning items</a>, go to step 9.
472-
<li>Remove the first segment from |S|.
473-
<li>Set |s| to <a>UNION</a>(|s|, |next|).
474-
<li>Go back to step 8.
475-
</ol>
476-
477-
<li>[=Apply offsets to a segment|Apply offsets to=] |s|, then append it to |C|.
478-
479-
<li>Go back to step 4.
480-
</ol>
481-
</div>
482-
483-
<div algorithm>
484-
To <dfn>apply offsets to a segment</dfn> |s| = [|start|, |end|]:
485-
<ol>
486-
<li>Offset |start| by the used value of the applicable [[#inset|rule-inset]] property.
487-
<li>Offset |end| by the used value of the applicable [[#inset|rule-inset]] property.
488-
<li>Update |s| with the adjusted [|start|, |end|].
489-
</ol>
490-
</div>
491-
492496
<wpt>
493497
flex/flex-gap-decorations-001.html
494498
flex/flex-gap-decorations-006.html

0 commit comments

Comments
 (0)