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

Re: [css-grid] How to resolve lines for absolutely positioned grid items

From: fantasai <fantasai.lists@inkedblade.net>
Date: Sat, 09 May 2015 17:33:53 -0700
Message-ID: <554EA771.9010101@inkedblade.net>
To: www-style@w3.org
On 05/08/2015 04:11 PM, fantasai wrote:
> On 03/24/2015 11:58 AM, Mats Palmgren wrote:
>
>> Q2. what is the end line for "grid-column: auto / span A" ?
>> http://dev.w3.org/csswg/css-grid/#grid-placement-errors
>> third paragraph says it should be treated as "span 1"
>> which seems undesirable for abs.pos. grid items.
>>
>> (I would like the answer to cover both when line A exists
>> and when it doesn't exist.)
>
> Since 'auto' contributes a line, not a span, for absolutely-positioned
> items, this case wouldn't trigger the "span 1" error handling, and
> would instead span from the start padding edge to line A.
>
> We didn't say what happens when line A doesn't exist, so we've added
> wording to create implicit lines (which have all names) for abspos
> items for lines that don't exist. We also defined that the new tracks
> so created have zero size, so this would therefore span to either
> line A (if it exists) or to an implicit line placed at the same
> position as the last grid line (if it doesn't).
>
> If you start with "grid-column: span A / span B", which gets around the
> "auto contributes a line" behavior, this first triggers the "two spans"
> error handling, then the "span 1" error-handling, *then* we have
> another error-handling step just for abspos that catches it and makes
> it the same as originally just specifying "auto / auto".
>
> This is just our initial thoughts; we haven't closed on this issue yet,
> so your thoughts on it are welcome.
>
> Handling missing lines for abspos positioning is tracked as
>    http://dev.w3.org/csswg/css-grid-1/issues-wd-20150108#issue-3
>
>> Q3. what is the start and end lines for "grid-column: 99 / 100"
>>      in a 3x3 grid?
>>
>> I think first clamping the lines to the implicit grid bounds
>> makes sense ("4 / 4").  And then the error handling:
>> http://dev.w3.org/csswg/css-grid/#grid-placement-errors
>> (first paragraph says "it instead contributes nothing")
>> makes it "4 / auto".  So the containing block will cover
>> the area between the end of the grid to the padding-edge on
>> the right side.  Is that correct?
>
> Since we didn't define this case, we're not sure which is correct. :)
> Your proposal makes sense. Another option, which we think is a bit
> simpler, is to add implicit lines as described above for missing
> named lines. This example would end up adding the abspos into a
> zero-width track at the end of the grid.

Been thinking about this, and I think it doesn't actually work.
We'll need to pick a line (last line or 'auto' line) that's the
magic line and clamp everything to stay within that grid. Otherwise
there's infinite lines between the last actual grid line and the
'auto' line, which makes spanning between it and anything other
than its adjacent line impossible.

~fantasai
Received on Sunday, 10 May 2015 00:34:25 UTC

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