Skip to content

Commit f73c0ca

Browse files
committed
added alternate pseudo-algorithm
1 parent 386e6e3 commit f73c0ca

1 file changed

Lines changed: 11 additions & 19 deletions

File tree

css3-multicol/Overview.src.html

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -812,42 +812,34 @@ <h3>Pseudo-algorithm</h3>
812812

813813
<pre>
814814

815-
(01) if ((column-width = auto) and (column-count = auto)) or
816-
(02) ((available-width = unknown) and (column-count = auto)) then
815+
(01) if ((column-width = auto) and (column-count = auto)) then
816+
exit; /* not a multicol element */
817+
818+
(02) if ((available-width = unknown) and (column-count = auto)) then
817819
(03) exit; /* no columns */
818-
(04) fi
819-
(05)
820+
820821
(06) if (available-width = unknown) and (column-count != auto) and (column-width != auto) then
821822
(07) N := column-count;
822823
(08) W := column-width;
823824
(09) exit;
824-
(10) fi
825825

826826
(12) if (available-width = unknown) then
827827
(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 */
831828

832-
(16) if (column-width = auto) then
829+
(16) if (column-width = auto) and (column-count != auto) then
833830
(18) N := column-count;
834831
(19) W := max(0, (available-width - ((N - 1) * column-gap))/N);
835832
exit;
836-
fi
837833

838-
/* the next block is used when column-width is set, and column-count is auto */
839-
840-
(27) if (column-count = auto) then
834+
(27) if (column-count = auto) and (column-width != auto) then
841835
(32) N := min(1, floor((available-width + column-gap) / (column-width + column-gap)));
842836
(33) W := ((available-width + column-gap) / N) - column-gap;
843837
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;
850838

839+
if (column-count != auto) and (column-width != auto) then
840+
(39) N := min(column-count, floor((available-width + column-gap) / (column-width + column-gap)))
841+
(40) W := ((available-width + column-gap) / N) - column-gap;
842+
exit
851843
</pre>
852844

853845

0 commit comments

Comments
 (0)