You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: css-gaps-1/Overview.bs
+23-40Lines changed: 23 additions & 40 deletions
Original file line number
Diff line number
Diff line change
@@ -361,10 +361,10 @@ Gap decoration segments</h4>
361
361
Algorithms</h5>
362
362
363
363
<div algorithm>
364
-
To <dfn>determine the gap decoration segments</dfn> for a given [=gap=] |G|:
364
+
To <dfn>determine gap decoration segments</dfn> for a given [=gap=] |G|:
365
365
<ol>
366
366
<li>
367
-
Let |S|, the collection of [=gap decoration segments=] for |G|, be an empty list.
367
+
Let |S| be an empty list.
368
368
</li>
369
369
<li>
370
370
Let |endpoints| be the result of [=creating segment endpoints=] for |G|,
@@ -374,58 +374,41 @@ Gap decoration segments</h4>
374
374
between [=start segment endpoint=] and [=end segment endpoint=], beginning with a [=start segment endpoint=].
375
375
</li>
376
376
<li>
377
-
While |endpoints| is not empty:
378
-
<ul>
379
-
<li>Let |u| be the first [=segment endpoint=] in |endpoints|, and remove it from the list.</li>
380
-
<li>Let |v| be the first [=segment endpoint=] in |endpoints|, and remove it from the list.</li>
381
-
<li>Create a new [=gap decoration segment=] starting at |u| and ending at |v|.</li>
382
-
<li>Append the new segment to |S|.</li>
383
-
</ul>
377
+
If |endpoints| is empty, return |S|.
384
378
</li>
385
379
<li>
386
-
Return |S|.
380
+
Let |break| be the used value of either 'column-rule-break' or 'row-rule-break', whichever applies to the gap.
387
381
</li>
388
-
</ol>
389
-
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
382
<li>If |break| is ''column-rule-break/none'':
403
383
<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|.
384
+
<li>Let |first| be the first item in |endpoints|.
385
+
<li>Let |last| be the last item in |endpoints|.
386
+
<li>Create a [=gap decoration segment=]|segment| = [|first|, |last|].
387
+
<li>[=Apply offsets to a segment|Apply offsets to=] |segment|, then append it to |S|.
388
+
<li>Return |S|.
409
389
</ol>
390
+
</li>
391
+
392
+
<li><em>Empty Check:</em> If |endpoints| is empty, return |S|.
410
393
411
-
<li>Remove the first segmentfrom |S|. Let |s| be that segment.
394
+
<li>Create a [=gap decoration segment=] |s| from the first two items in |endpoints|. Remove them both from the list.
412
395
413
-
<li>If |s|'s endpoints are <a>discontiguous</a>, go back to step 4.
396
+
<li>If |s|'s endpoints are <a>discontiguous</a>, go back to <em>Empty Check</em>.
414
397
415
-
<li>If |S| is not empty:
398
+
<li>While |endpoints| is not empty:
416
399
<ol>
417
-
<li>Let |next| be the first segment in |S|.
400
+
<li>Create a [=gap decoration segment=]|next| from the first two items in |endpoints|, leaving them both in the list.
418
401
<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|.
402
+
<li>If |candidate|'s endpoints are <a>discontiguous</a>, exit this loop.
403
+
<li>If |break| is ''column-rule-break/intersection'' and |candidate| is not <a>flanked by spanning items</a>, exit this loop.
404
+
<li>Remove the first two items from |endpoints|.
422
405
<li>Set |s| to <a>UNION</a>(|s|, |next|).
423
-
<li>Go back to step 8.
424
406
</ol>
407
+
</li>
425
408
426
-
<li>[=Apply offsets to a segment|Apply offsets to=] |s|, then append it to |C|.
409
+
<li>[=Apply offsets to a segment|Apply offsets to=] |s|, then append it to |S|.
427
410
428
-
<li>Go back to step 4.
411
+
<li>Go back to <em>Empty Check</em>.
429
412
</ol>
430
413
</div>
431
414
@@ -576,7 +559,7 @@ Break behaviors at intersections: The 'column-rule-break', 'row-rule-break', and
576
559
577
560
Sets the behavior for breaking decorations within a given gap into segments
578
561
at visible "T" or "cross" intersections formed by items in the container.
579
-
Precise details for how to apply these values are given in the steps to [=determine painted segments=].
562
+
Precise details for how to apply these values are given in the steps to [=determine gap decoration segments=].
0 commit comments