W3C home > Mailing lists > Public > www-style@w3.org > January 2016

Re: [css-grid] Undefined named lines placement

From: Eric A. Meyer <eric@meyerweb.com>
Date: Fri, 29 Jan 2016 15:18:07 -0500
To: "www-style list" <www-style@w3.org>
Cc: "Manuel Rego Casasnovas" <rego@igalia.com>, "Tab Atkins Jr." <jackalmage@gmail.com>
Message-ID: <9CF63C6B-EA28-40AC-AEF8-9E5AC694071C@meyerweb.com>
On 16 Dec 2014, at 14:22, Tab Atkins Jr. wrote:

> On Tue, Dec 16, 2014 at 7:55 AM, Manuel Rego Casasnovas 
> <rego@igalia.com> wrote:

>> 2) grid-column: foo;
>> As "foo" is not a named line, all lines in the implicit grid are
>> assumed to have that name.
>> We would consider that grid-template-columns is:
>> (left) 100px (right foo);
>> So, this will be placed again in the 2nd column (if we think that
>> "right" is the first line of the implicit grid).
>>
>> If I understand it right, even if we have both 1) and 2) at the same
>> time, both items should be placed in the 2nd column.
>
> No, (right) is the last line in the explicit grid.  The *next* line
> will be part of the implicit grid, and will be treated as having the
> name "foo", so the item will go in the third column.
>
>> 3) grid-column: 3 bar;
>> If 2) was right (and "right" is the first line of the implicit grid)
>> it'll be placed in the 4th column.
>
> Fifth column.

I'm resurrecting this so long after the fact due to a Twitter 
conversation I had today with Manuel Rego about the grid test I created 
for implicitly named areas 
(<http://meyerweb.com/eric/css/tests/grid-implicit-area-names.html>) per 
section 5.2.2.  In that thread, Manuel referenced the message to which 
I'm replying.

Firefox Nightly, and now Chrome 50+, act consistently on the test URL 
above, which examines situations where a named area is implied by 
gridline names along one axis, but not the other.  One example:

    .grid {grid-template-columns: 1fr [content-start] 1fr [content-end] 
1fr;
           grid-template-rows: 3em 1fr 3em;}
    .content {grid-area: content;}

What both FF and Chrome now do is place the `.content` element in the 
proper column track, but in a row after the explicitly defined rows, AND 
after an extra row that follows the defined tracks.  So there are a 
total of five row tracks in that example: the three created by 
`grid-template-rows`, an empty row, and then the row containing 
`.content`.

(All of this is analogous in the other direction, as the test URL shows, 
and consistent regardless of the value of `grid-auto-flow`.)

I'm checking to make sure this is the correct behavior, since it strikes 
me at first blush as a bit odd.  It would make more sense to me without 
that fourth, empty grid track.  If it is correct, documenting it will be 
very important, since I doubt it's what authors will expect.  (Of 
course, the weirdness of this could serve as an incentive to avoid doing 
it in the first placeā€¦).


--
Eric A. Meyer - http://meyerweb.com/
Received on Friday, 29 January 2016 20:18:34 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:35 UTC