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

Re: [css3-multicol] unknown available width and shrink-to-fit

From: Bert Bos <bert@w3.org>
Date: Fri, 30 Nov 2012 14:29:42 +0100
Cc: Simon Sapin <simon.sapin@kozea.fr>, fantasai@inkedblade.net, Rossen.Atanassov@microsoft.com, www-style@w3.org
Message-Id: <462F656E-3C89-4485-A104-0D2091DAD93D@w3.org>
To: Håkon Wium Lie <howcome@opera.com>
On Nov 15, 2012, at 13:38, Håkon Wium Lie wrote:

> Hello Simon,
> 
>> We agree that the current spec has an issue: "available-width == 
>> unknown" is not well defined. I believe that the concept is not 
>> necessary so I proposed getting rid of it entirely. Since you rejected 
>> getting that, how do you suggest we define it?
> 
> I've asked Bert -- who wrote up the orignal pseudo-algorith to suggest
> a rewording.

Here is some text to define exactly (in terms of definitions from CSS 2.1) what the variable "available-width" is initialized to.

The old text:

    available-width: if the used width of the multi-column element has
    not been determined when the ‘column-count’ and ‘column-width’
    must be determined (e.g., if it is floating with a ‘width’ of
    ‘auto’ as per CSS 2.1 section 10.3.5) this variable is unknown,
    otherwise it is the same as the used width of the multi-column
    element. In vertical text, the used height replaces used width in
    this calculation.

The proposed new text:

    available-width: This variable is initialized to either the used
    width of the multi-column element or to unknown, depending,
    roughly, on whether the used width can be calculated before
    'column-width' and 'column-count or not. More precisely:

    * If the multi-column element is a table cell, there are two
      cases:

      + If the cell is part of a table to which the “fixed table
        layout” algorithm is applied (see 17.5.2.1 “Fixed table
        layout” in [[!CSS21]]), then available-width is initialized to
        the table cell's used width.

      + Otherwise (i.e., the cell is part of a table to which the
        “fixed table layout” algorithm is not applied), then
        available-width is initialized to unknown.

    * If the multi-column element is not a table cell, there are also
      two cases:

      + If the element is out of flow (see section 9.3 “Positioning
        schemes” in [[!CSS21]]) and its 'width' is either ''auto'' or
        a percentage of a containing block whose width depends on this
        multi-column element, then available-width is initialized to
        unknown.

      + Otherwise available-width is initialized to the element's used
        width (see section 10.3 “Calculating widths and margins” in
        [[!CSS21]]).


I think this captures all cases in which the used width of the element doesn't depend on whether it has columns.

“Out of flow” is defined by CSS 2.1 as positioned, floating or the root.

I left out the mention of vertical text, because there is no vertical text in CSS 2.1. (Once css3-box is ready, we can replace the references to CSS 2.1 by references to css3-box.)



Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos                               W3C/ERCIM
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France
Received on Friday, 30 November 2012 13:30:15 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:03 GMT