W3C home > Mailing lists > Public > www-style@w3.org > March 2015

[css-multicol][css-sizing] Intrinsic Sizes of Multi-column Elements

From: fantasai <fantasai.lists@inkedblade.net>
Date: Wed, 18 Mar 2015 21:40:10 -0700
Message-ID: <550A532A.5000707@inkedblade.net>
To: "www-style@w3.org" <www-style@w3.org>
Been looking into the intrinsic size of multi-column elements.
Testcase here:

Here's my suggestions:

col-count only
   min = #cols * min-content [of contents]
   max = #cols * max-content
   Implemented by: Firefox, Chrome, IE

     Width of columns is totally flexible,
     so pick a size that respects min/max-content

col-width only
   min = min(col-width, min-content)
   max = col-width
   Implemented by: Firefox, IE

     Widest possible column is column-width*2-ɛ.
     But if columns happen to be column-width (as requested),
     then any content outside that overflows and is clipped.
     It makes sense that the column-width becomes a limit
     on the content's size contribution.

     The narrowest possible column is zero. If the min-content
     is less than the column-width, then we can become that

col-width + col-count
   min = min(col-width, min-content)
   max = col-count * col-width
   Implemented by: Firefox, IE

     The layout as the container gets narrower (fewer columns)
     approaches the col-width only case (reduce columns as
     width reduces in order to keep each column >= col-width),
     so it makes sense to have the same behavior.

     The multi-column spec wanted column-width * column-count,
     when both were defined, to be the preferred width, and
     the implementations reflect this. Authors would probably
     prefer that shrink-to-fit sizing landed on this answer
     for maxed-out cases as well.

col-width + height
   min = used col-count == 1 ?
           min-content : column-width * used column count
   max = column-width * used column count
   Implemented by: Nobody

     Any other answer results in overflow, which no intrinsic
     size should ever result in.

     Also this case hits a number of real-world use cases,
     and they would like the max-content size to be as described.

   The original "definition" (goal, really) of max-content
   was the narrowest size that resulted in the shortest
   possible height. However, because of the desire of multicol
   elements to have their column-width respected, it's kindof
   less obvious what the max-content size ought to be.

   Chrome factors in the intrinsic size of the contents in a
   few more cases, e.g. using that as a minimum for the column
   widths. But since multi-column layout doesn't actually work
   that way, this isn't a valid approach. (Once the intrinsic
   size is greater than 2*column-width, the used column width
   *will* be less than the intrinsic size of the content.)

   (We could add the intrinsic size keywords to column-width if
   we want the ability to ensure they are wide enough for their
   contents. Right now said contents are required to be clipped.)

Received on Thursday, 19 March 2015 04:40:56 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:52 UTC