Skip to content

Commit 5beeecd

Browse files
committed
added alternate pseudo-algorithm
1 parent f5deafb commit 5beeecd

1 file changed

Lines changed: 43 additions & 1 deletion

File tree

css3-multicol/Overview.src.html

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ <h3>Pseudo-algorithm</h3>
779779
(04) fi
780780
(05)
781781
(06) if (available-width = unknown) and (column-count != auto) and (column-width != auto) then
782-
(07) N := column-count;
782+
(07) N := column-count;
783783
(08) W := column-width;
784784
(09) exit;
785785
(10) fi
@@ -808,6 +808,48 @@ <h3>Pseudo-algorithm</h3>
808808
(41) fi
809809
</pre>
810810

811+
<p><span class=issue>Alternative pseudo-algorithm:
812+
813+
<pre>
814+
815+
(01) if ((column-width = auto) and (column-count = auto)) or
816+
(02) ((available-width = unknown) and (column-count = auto)) then
817+
(03) exit; /* no columns */
818+
(04) fi
819+
(05)
820+
(06) if (available-width = unknown) and (column-count != auto) and (column-width != auto) then
821+
(07) N := column-count;
822+
(08) W := column-width;
823+
(09) exit;
824+
(10) fi
825+
826+
(12) if (available-width = unknown) then
827+
(13) available-width := shrink-to-fit;
828+
(14) fi
829+
830+
/* the next block is used when column-count is set, and column-width is auto */
831+
832+
(16) if (column-width = auto) then
833+
(18) N := column-count;
834+
(19) W := max(0, (available-width - ((N - 1) * column-gap))/N);
835+
exit;
836+
fi
837+
838+
/* the next block is used when column-width is set, and column-count is auto */
839+
840+
(27) if (column-count = auto) then
841+
(32) N := min(1, floor((available-width + column-gap) / (column-width + column-gap)));
842+
(33) W := ((available-width + column-gap) / N) - column-gap;
843+
exit;
844+
fi
845+
846+
/* the next block is used if both column-count and column-width are set */
847+
848+
(39) N := min(column-count, floor((available-width + column-gap) / (column-width + column-gap)))
849+
(40) W := ((available-width + column-gap) / N) - column-gap;
850+
851+
</pre>
852+
811853

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

0 commit comments

Comments
 (0)