W3C home > Mailing lists > Public > www-style@w3.org > November 2011

[css3 multicol] Bug in line 21 of the pseudo-algorithm?

From: David Hyatt <hyatt@apple.com>
Date: Thu, 17 Nov 2011 15:58:17 -0600
Message-id: <BCB16D2E-437D-4088-A321-D211E8CC69FC@apple.com>
To: "www-style@w3.org list" <www-style@w3.org>
When I changed WebKit to match the newer pseudo algorithm, I hit a compatibility issue with existing multi-column content.  The specific compatibility issue is with line 21 of the pseudo algorithm, and it occurs when an author specifies both a column-count and a column-width inside an element whose available width is known.

The case in question is:

(19)  if (column-width != auto) and (column-count != auto) then
(20)    N := min(column-count, floor((available-width + column-gap) / (column-width + column-gap)))
(21)    W := ((available-width + column-gap) / N) - column-gap;
(22)  exit
Line 21 is causing the incompatibility for us, and I think there is a mistake here. When both column-count and column-width are specified, I would not expect the column-width to be increased just to fill an available width. It seems to me that the line in question should actually be:

(21)    W := min(column-width, ((available-width + column-gap) / N) - column-gap)
With this change, the column-width and column-count both act as maximum allowed values, rather than only having the column-count act as a maximum allowed value. This makes more sense to me, since if an author specifies width:600px, column-count:2; column-width:200px, it's odd to me that the columns would grow to be nearly 300px wide. The author's intent is pretty clear here, so we should honor it, even if it leaves leftover space.

dave
(hyatt@apple.com)
Received on Thursday, 17 November 2011 21:58:55 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:46 GMT