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

On 10/08/2015 10:43 PM, Tab Atkins Jr. wrote:
 > On Thu, Oct 8, 2015 at 11:40 AM, Mats Palmgren <mats@mozilla.com> wrote:
 >> 1. If a line 1 is always present and explicit then the start column
 >>     resolves to line 2 in the following example:
 >>
 >> <div style="display:grid; grid-auto-columns:50px">
 >> <span style="grid-column:A">A</span>
 >> </div>
 >
 > Why should it, tho?  If you had some explicit lines, it would start
 > one line past the end of the implicit grid, so it's already
 > established that this kind of error ends up putting you in the
 > *second* implicit track.

OK, good.  Placing this item in track 2 with an implicit track between
line 1 and 2 works fine for me.

 >> <div style="display:grid; position:relative; justify-content:center">
 >> <span style="position:absolute; grid-column:1">B</span>
 >> </div>
 >
 > We *could* do something like that, but adding more rules just to
 > handle a degenerate error case doesn't seem that great.

Fair enough, I can pretend there's a line 1 in the abs.pos. case as long
as it's positioned at the content start edge without any alignment,
is that OK?

 > Maybe your impl assumes that every line has an associated track to its
 > right/bottom?

No, it assumes that zero tracks means there are no lines.  And our
alignment works on tracks so without any tracks it's not possible to
align anything.  It also assumes that all numbered lines have a track
in-between them.  I think I can make an exception for the abs-pos-in-
empty-grid case though.

 > What's the precise issue?

There seems to be no issue, if doing no alignment in the abs-pos-in-
empty-grid case is spec compliant. :-)


/Mats

Received on Friday, 9 October 2015 12:24:18 UTC