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

On Wed, Nov 26, 2014 at 10:52 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> On Tue, Nov 25, 2014 at 3:22 PM, Manuel Rego Casasnovas <rego@igalia.com> wrote:
>> Hi,
>>
>> I have an extra question regarding absolutely positioned items and the
>> static position.
>>
>> Again, let's use an example:
>> <style>
>>   .grid {
>>     display: grid;
>>     grid-template-columns: 100px 100px;
>>     grid-template-rows: 50px 50px;
>>     position: relative;
>>   }
>>
>>   .absolute {
>>     position: absolute;
>>     grid-row: 2 / 3;
>>     grid-column: 2 / 3;
>>   }
>>
>>   .item {
>>     grid-row: 1 / 2;
>>     grid-column: 1 / 2;
>>   }
>> </style>
>>
>> <div class="grid">
>>   <div class="absolute">absolute</div>
>> </div>
>>
>>
>> Where the "absolute" element should be placed?
>> A) 100x50
>> B) 0x0
>>
>> I guess the answer is A) as according to the spec [1]:
>> "The static-position containing block is the containing block of a
>> hypothetical box that would have been the first box of the element if
>> its specified 'position' value had been 'static' and its specified
>> 'float' had been 'none'."
>>
>> Because of if the position was "static" instead of "absolute", the
>> element would be placed at 2nd row and 2nd column (100x50).
>>
>> Is it right?
>
> Ooh, we don't really specify the static position of absposes with grid
> container parents.  Hmm.  Yeah, I guess that (A) falls out of the
> definition, and is consistent with our answer if you specify offsets.

Hahaha, ignore everything I just said. I'm dumb.

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.

~TJ

Received on Thursday, 18 December 2014 20:01:12 UTC