Re: [css3-grid-layout] grid-end / grid-after with <integer>

On Mon, Mar 11, 2013 at 11:01 AM, Julien Chaffraix
<julien.chaffraix@gmail.com> wrote:
>>> Mostly it opens us to a slew of complexity for the auto-placement
>>> algorithm as we would need to re-resolve our grid positions if the
>>> grid grows (which removes the current algorithm's guaranteed linear
>>> time). The other alternative is to ignore the author's intent and
>>> don't recompute which is equally bad.
>>
>> If we do change to always counting from before/start, we then want to
>> allow negative indexes to indicate counting from the after/end side.
>> We really can't avoid this - it's necessary for lots of things (such
>> as, for example, having an area span the entire grid).  So, this
>> complexity is unavoidable.
>
> From an implementation perspective, starting from the end / after edge
> or allowing negative indexes have the same challenges as it allows the
> issues I outlined.
>
> I am trying to understand the use case that you are trying to cover
> with these. An obvious use case would be inserting a grid item into an
> arbitrary grid element and have it span the whole grid, though I would
> wonder how prevalent this would be.

Largely it's just obvious convenience.  Sometimes it's convenient to
position things from the left edge, sometimes it's convenient to use
the right edge.  Left edge (start edge) is slightly more relevant to
English documents, but not so much (in this context) that it should be
the sole way to do it.

> The other use of negative indexes
> or starting from the end / after are less clear to me: e.g. grid-row:
> 2 / 2 would presumably ignore a row at the start / end of the grid but
> it's unclear what would happen if grid-definition-rows defines less
> than 3 grid tracks. The authors would definitely have 2 rows (per the
> implicit grid track creation) but as this would fit grid-end: 2, there
> is no need to grow the grid more in this case, which would violate the
> intent.

Sometimes you do have to violate author intent, because they are
expressing contradictory intents.  The way this would work (that is, a
grid-row:2 / 2; declaration with a 2-row grid) is that the start and
end would specify the same grid line, and error-correction would take
over, changing it to effectively be "2 / span 1" instead.

~TJ

Received on Monday, 11 March 2013 20:13:17 UTC