Skip to content

Commit dc1bce4

Browse files
author
howcome
committed
revising pseudo-algorithm, as per discussions on www-style
1 parent 4c90e3a commit dc1bce4

1 file changed

Lines changed: 13 additions & 38 deletions

File tree

css-multicol/Overview.src.html

Lines changed: 13 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -780,54 +780,29 @@ <h3>Pseudo-algorithm</h3>
780780
<li>that no column breaks are added through style sheets
781781
</ul>
782782

783-
<p>The <code>floor(X)</code> function returns the largest integer Y X.
783+
<p>The <code>floor(X)</code> function returns the largest integer Y &le; X.
784784

785785

786786
<pre>
787-
(01) if ((column-width = auto) and (column-count = auto)) then
788-
(02) exit; /* not a multicol element */
789-
790-
<!--
791-
(03) if ((available-width = unknown) and (column-count = auto)) then
792-
(04) exit; /* no columns */
793-
794-
(05) if (available-width = unknown) and (column-count != auto) and (column-width != auto) then
795-
(06) N := column-count;
796-
(07) W := column-width;
797-
(08) exit;
798-
799-
(09) if (available-width = unknown) then
800-
(10) available-width := shrink-to-fit;
801-
-->
787+
(01) if column-width = auto then
788+
(02) N := column-count
789+
(03) else if column-count = auto then
790+
(04) N := max(1,
791+
(05) floor((U + column-gap)/(column-width + column-gap)))
792+
(06) else
793+
(07) N := min(column-count, max(1,
794+
(08) floor((U + column-gap)/(column-width + column-gap))))
795+
</pre>
802796

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
797+
<p>And:
798+
<pre>
799+
(09) W := max(0, ((U + column-gap)/N - column-gap)
818800
</pre>
819801

820802

821803
<p>In paged media, user agents may perform this calculation on a
822804
per-page basis.
823805

824-
<p class=note>Note that, in most cases, only one of 'column-width' and
825-
'column-count' affect the layout. If 'column-width' has a value other
826-
than ''auto'', 'column-count' indicates the maximum number of columns.
827-
However, both 'column-width' and 'column-count' are honored when the
828-
width of the element depends on its contents. This can, e.g., be the
829-
case for table cells and floats.
830-
831806

832807

833808
<h3>Stacking context</h3>

0 commit comments

Comments
 (0)