W3C home > Mailing lists > Public > www-style@w3.org > October 2013

Re: [css-multicol] column-width bound (>0) is illegal

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 15 Oct 2013 10:46:59 -0700
Message-ID: <CAAWBYDB=ZN4yxExRt=tu+d4PMKXNTgcKVa-UnKo34MCQ6yPCNg@mail.gmail.com>
To: Morten Stenshorne <mstensho@opera.com>
Cc: www-style list <www-style@w3.org>
On Tue, Oct 15, 2013 at 10:43 AM, Morten Stenshorne <mstensho@opera.com> wrote:
> "Tab Atkins Jr." <jackalmage@gmail.com> writes:
>> Per our design patterns for CSS properties (apparently not written
>> down anywhere, unfortunately*), we don't use open continuous
>> intervals, because then whether something is valid or invalid depends
>> on unpredictable and UA-specific rounding behavior.
>>
>> However, 'column-width' states that its value must be a <length>
>> greater than zero.  This violates that constraint.
>>
>> I suggest that we instead state that there is a minimum size for
>> columns (1px? ua-specific?), and that values less than this minimum
>> are clamped to the minimum.  Values less than zero are still invalid,
>> as they're nonsensical.
>
> As far as I know, the only reason to disallow column-width:0 is to avoid
> an infinite used column-count, e.g. "column-width:0; column-gap:0;
> width:1000px;". So a minimum size seems necessary (I have no better
> suggestion, at least). It could be 1px. But I suppose 0.1px, 1em or 1mm
> are good candidates as well. :-P

Correct.

> Are there similar problems in other specs, and are there any solutions
> out there already that can be of inspiration?

Yes, there are a number of places where the natural range for some
value is open, and we've patched it into being closed.  If the error
preventing me from editting the wiki is fixed, I'll have a nice
write-up with these solutions.

The three solutions we've used are:

1. define a minimum size, and clamp things that are within the
boundary but less than the minimum.
2. find the limit behavior, and say that below a ua-specific limit,
it's just that limit behavior.  (Repeating gradients do this.)
3. define a completely different behavior for the boundary value
itself.  (background-size/repeat do this.)

> There's a similar issue if you combine paged or fragmented overflow [1]
> with zero height. You'd get an infinite page count. And, in fact, you
> have the exact same problem with multicol here. If the multicol
> container height is 0 (or, more accurately, if column height ends up as
> 0), you get an infinite number of columns (actual column-count). In the
> implementations I've been working on, I've typically forced a minimum
> height of 1px. That way at least you avoid an _infinite_ number of
> columns/pages, but you sure still get an _insane_ number of
> columns/pages, and really silly layout too.

Correct, it's the same issue.

~TJ
Received on Tuesday, 15 October 2013 17:47:49 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:51:03 UTC