Skip to content

Commit 97e0714

Browse files
author
howcome
committed
revising pseudo-algorithm; revising text on paint order; revising description on clipping of floats
1 parent 41aea33 commit 97e0714

1 file changed

Lines changed: 34 additions & 84 deletions

File tree

css-multicol/Overview.src.html

Lines changed: 34 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -767,23 +767,11 @@ <h3>'columns'</h3>
767767
<h3>Pseudo-algorithm</h3>
768768

769769
<P>The pseudo-algorithm below determines the used values for
770-
'column-count' (N) and 'column-width' (W). There are two other
771-
variables in the pseudo-algorithm:
772-
773-
<ul>
774-
775-
<li><code>available-width</code>: if the used width of the
776-
multi-column element has not been determined when the 'column-count'
777-
and 'column-width' must be determined (e.g., if it is floating with a
778-
'width' of 'auto' as per CSS 2.1 section 10.3.5) this variable is
779-
<code>unknown</code>, otherwise it is the same as the used width of
780-
the multi-column element. In vertical text, the used height replaces used width in this calculation.
781-
782-
<li><code>shrink-to-fit</code>: this variable represents the result of
783-
a <em>shrink-to-fit</em> computation. CSS does not define the exact
784-
algorithm.
770+
'column-count' (N) and 'column-width' (W). There is one other variable
771+
in the pseudo-algorithm: U is the used width of the multi-column
772+
element.
785773

786-
</ul>
774+
<p class=note>The used width U of the multi-column element can depend on the element's contents, in which case it also depends on the computed values of the 'column-count' and 'column-width' properties. This specification does not define how U is calculated. Another module (probably the Basic Box Model [[CSS3BOX]] or the Intrinsic & Extrinsic Sizing Module [[CSS3-SIZING]]) is expected to define this.
787775

788776
<p>Two assumptions are being made by the pseudo-algorithm:
789777

@@ -792,52 +780,14 @@ <h3>Pseudo-algorithm</h3>
792780
<li>that no column breaks are added through style sheets
793781
</ul>
794782

795-
<p>The <code>floor()</code> function rounds a number to the next smaller integer.
783+
<p>The <code>floor(X)</code> function returns the largest integer Y ≤ X.
796784

797-
<!--
798-
<pre>
799-
(01) if ((column-width = auto) and (column-count = auto)) or
800-
(02) ((available-width = unknown) and (column-count = auto)) then
801-
(03) exit; /* no columns */
802-
(04) fi
803-
(05)
804-
(06) if (available-width = unknown) and (column-count != auto) and (column-width != auto) then
805-
(07) N := column-count;
806-
(08) W := column-width;
807-
(09) exit;
808-
(10) fi
809-
(11)
810-
(12) if (available-width = unknown) then
811-
(13) available-width := shrink-to-fit;
812-
(14) fi
813-
(15)
814-
(16) if (column-width = auto) then
815-
(18) N := column-count;
816-
(19) W := max(0, (available-width - ((N - 1) * column-gap))/N);
817-
(27) elsif (column-count = auto) then
818-
(28) if (column-width >= available-width) then
819-
(29) N := 1
820-
(30) W := available-width;
821-
(31) else
822-
(32) N := floor((available-width + column-gap) / (column-width + column-gap));
823-
(33) W := ((available-width + column-gap) / N) - column-gap;
824-
(34) fi
825-
(35) elsif (column-width >= available-width) then
826-
(36) N := 1
827-
(37) W := available-width;
828-
(38) else
829-
(39) N := min(column-count, floor((available-width + column-gap) / (column-width + column-gap)))
830-
(40) W := ((available-width + column-gap) / N) - column-gap;
831-
(41) fi
832-
</pre>
833-
834-
<p><span class=issue>Alternative encoding of pseudo-algorithm:
835-
-->
836785

837786
<pre>
838787
(01) if ((column-width = auto) and (column-count = auto)) then
839788
(02) exit; /* not a multicol element */
840789

790+
<!--
841791
(03) if ((available-width = unknown) and (column-count = auto)) then
842792
(04) exit; /* no columns */
843793
@@ -848,22 +798,23 @@ <h3>Pseudo-algorithm</h3>
848798
849799
(09) if (available-width = unknown) then
850800
(10) available-width := shrink-to-fit;
801+
-->
851802

852-
(11) if (column-width = auto) and (column-count != auto) then
853-
(12) N := column-count;
854-
(13) W := max(0, (available-width - ((N - 1) * column-gap)) / N);
855-
(14) exit;
856-
857-
(15) if (column-width != auto) and (column-count = auto) then
858-
(16) N := max(1, floor((available-width + column-gap) / (column-width + column-gap)));
859-
(17) W := ((available-width + column-gap) / N) - column-gap;
860-
(18) exit;
861-
862-
(19) if (column-width != auto) and (column-count != auto) then
863-
(20) N := min(column-count, floor((available-width + column-gap) / (column-width + column-gap)))
864-
(21) N := max(1, N);
865-
(22) W := ((available-width + column-gap) / N) - column-gap;
866-
(23) exit
803+
(03) if (column-width = auto) and (column-count != auto) then
804+
(04) N := column-count;
805+
(05) W := max(0, (U - ((N - 1) * column-gap)) / N);
806+
(06) exit;
807+
808+
(07) if (column-width != auto) and (column-count = auto) then
809+
(08) N := max(1, floor((U + column-gap) / (column-width + column-gap)));
810+
(09) W := ((U + column-gap) / N) - column-gap;
811+
(10) exit;
812+
813+
(11) if (column-width != auto) and (column-count != auto) then
814+
(12) N := min(column-count, floor((U + column-gap) / (column-width + column-gap)))
815+
(13) N := max(1, N);
816+
(14) W := ((U + column-gap) / N) - column-gap;
817+
(15) exit
867818
</pre>
868819

869820

@@ -874,7 +825,7 @@ <h3>Pseudo-algorithm</h3>
874825
'column-count' affect the layout. If 'column-width' has a value other
875826
than ''auto'', 'column-count' indicates the maximum number of columns.
876827
However, both 'column-width' and 'column-count' are honored when the
877-
width of the element has not been determined. This can, e.g., be the
828+
width of the element depends on its contents. This can, e.g., be the
878829
case for table cells and floats.
879830

880831

@@ -900,9 +851,9 @@ <h2>Column gaps and rules</h2>
900851
column rule will not alter the placement of anything else. If a column
901852
rule is wider than its gap, the adjacent column boxes will overlap the
902853
rule, and the rule may possibly extend outside the box of the multicol
903-
element. Column rules are painted just above the background of the
904-
multicol element. Column rules are only drawn between two columns that
905-
both have content.
854+
element. Column rules are painted in the inline content layer, but
855+
below all inline content inside the multicol element. Column rules are
856+
only drawn between two columns that both have content.
906857

907858
<h3>'column-gap'</h3>
908859

@@ -1627,13 +1578,12 @@ <h2>Filling columns</h2>
16271578

16281579
<p>There are two strategies for filling columns: columns can either be
16291580
balanced, or not. If columns are balanced, user agents should try to
1630-
fill all columns in a row so that the columns appear to have the same
1631-
amount of content, while also trying to minimize the overflow content.
1632-
If columns are not balanced, they are filled sequentially; some
1633-
columns may end up partially filled, or with no content at all. In any
1634-
case, user agents must honor forced page breaks and should try to
1635-
honor 'widows', 'orphans' and other properties that may affect column
1636-
lengths.
1581+
minimize the variation in content between columns, while also trying to
1582+
minimize the overflow content. If columns are not balanced, they are
1583+
filled sequentially; some columns may end up partially filled, or with
1584+
no content at all. In any case, user agents must honor forced page
1585+
breaks and should try to honor 'widows', 'orphans' and other
1586+
properties that may affect column lengths.
16371587

16381588
<h3 id='cf'>'column-fill'</h3>
16391589

@@ -1694,7 +1644,7 @@ <h2>Overflow</h2>
16941644

16951645
<h3>Overflow inside multicol elements</h3>
16961646

1697-
<p>Content in the normal flow that extends into column gaps (e.g.,
1647+
<p>Floated or in-flow content that extends into column gaps (e.g.,
16981648
long words or images) is clipped in the middle of the column gap.
16991649

17001650
<div class=example>
@@ -2091,7 +2041,7 @@ <h2 class=no-num id=acknowledgments>Acknowledgments</h2>
20912041
<p>This document is based on several older proposals and comments on
20922042
older proposals. Contributors include
20932043

2094-
Øyvind Stenhaug,
2044+
Øyvind Stenhaug,
20952045
Sylvain Galineau,
20962046
Giovanni Campagna,
20972047
David Hyatt,

0 commit comments

Comments
 (0)