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

Re: [css3-grid-layout] mismatched grid template strings

From: Bert Bos <bert@w3.org>
Date: Wed, 11 Apr 2012 13:33:39 +0200
To: www-style@w3.org
Message-Id: <201204111333.39470.bert@w3.org>
On Monday 19 March 2012 07:05:48 Phil Cupp wrote:
> I agree the spec should say so.  The grid-template property is
> underspecified compared to Bert's template layout module.  I've
> opened another issue to declare that non-rectangular grid cells are
> not allowed [1].  Specifically, non-rectangular grid cells or
> multiple grid cells with the same letter are invalid and cause the
> declaration to be dropped.

The Template Layout spec says about short rows[1][2]:

    Rows with fewer columns than other rows are implicitly padded with
    periods (“.”).

And about non-rectangular slots:

    Non-rectangular slots and multiple slots with the same letter are
    illegal. A template without any letter or “@” is illegal. A template
    with more than one “@” slot is illegal. These errors cause the
    declaration to be ignored.

    Note: non-rectangular and disconnected regions may be permitted in a
    future update of CSS.


I think the ability to omit letters from the end of a row isn't very 
useful in itself. Padding them automatically with empty space just seems 
slightly more friendly than declaring them a syntax error.


Non-rectangular regions are certainly useful. They are no doubt more 
difficult for implementers (although computationally of the same 
complexity, so no slower to compute) and thus better reserved for a 
possible level 4.

Even if you can make a chain of multiple rectangular slots (another 
feature postponed to level 4) you cannot quite do without non-
rectangular slots: how would you make a 3 line-heights high L-shaped 
slot like this out of two separate slots?

    "a." / 1.8em
    "aa" / 1.8em

I'm also not sure that Shapes and Exclusions will be able to replace 
them: it will depend on whether you can define shapes whose size depends 
on the amount of content. (For the moment, the Shapes and Exclusions 
draft allows 'em' units, but nothing equivalent to the 'min-content' or 
'max-content' sizes allowed in grid templates.)


[1] Editor's draft of the next WD, with merged grid template syntax:
    http://dev.w3.org/csswg/css3-layout/#grid-template
[2] Current WD:
    http://www.w3.org/TR/2011/WD-css3-layout-20111129/#declaring-
templates-the-display-property



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 Wednesday, 11 April 2012 11:34:17 GMT

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