Re: [css-grid] Absolutely positioned items and static position

On 12/23/2014 01:40 AM, Manuel Rego Casasnovas wrote:
> On 18/12/14 21:00, Tab Atkins Jr. wrote:
>> This was all defined in the spec already:
>> http://dev.w3.org/csswg/css-grid/#static-position
>>
>> tl;dr: We don't care about the grid-placement properties when
>> determining the static position.
>
> Yeah, the definition of the static position was already there, just that
> I wasn't sure if it should care about the grid-placement properties or
> not. Thanks for the clarification.
>
> Now, my question is if the grid-placement properties are ignored or not
> to calculate the containing block of the abspos children when they don't
> have offsets. In that case we'd use the static position to place them,
> but I'm not sure about what would be their size if they use width/height
> 100%.
> [...]
> [1] http://dev.w3.org/csswg/css-grid/#abspos-items
> [2] http://dev.w3.org/csswg/css-grid/#static-position

So, I think the spec is pretty clear on how the width/height are calculated:
they're calculated wrt the containing block, which defined to be the grid area.
However, it is kindof weird: the static position is determined based on
a larger rectangle (the grid container) while the containing block is
a smaller rectangle (the grid area). I'm not sure that's a great definition.
It might make sense for static positioning to honor grid positioning as well.

Another issue you bring up is, if one of the grid lines is the padding edge
(which is what an 'auto' grid position indicates for abspos elements contained
by the grid container), and the second grid line is a span, where does it span
to? The padding edge doesn't have a defined relationship to the other grid lines.

A third issue is, what if there aren't enough lines for the abspos? Some possible
answers:
   * attach to the padding edge instead
   * attach to the last available grid line (if any)
   * create "invisible" grid lines to attach to -- that don't affect layout of the
     grid container's in-flow contents

(Does that about summarize the issues or did I miss one? :)

~fantasai

Received on Thursday, 8 January 2015 22:02:55 UTC