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

Re: [css-grid] auto-placement algorithm step 2 doesnt' respect sparse/dense/stack choice

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 12 Feb 2015 09:55:19 +1100
Message-ID: <CAAWBYDBjx-kywN1Ho8ok4gqZCy_Ci1Ob4ZoQjNZdwsKVMqqY2g@mail.gmail.com>
To: Manuel Rego Casasnovas <rego@igalia.com>
Cc: www-style list <www-style@w3.org>
On Thu, Feb 12, 2015 at 2:23 AM, Manuel Rego Casasnovas <rego@igalia.com> wrote:
> On 22/01/15 20:15, fantasai wrote:
>> I'm sorry, we forgot to respond on the list. It seemed like an oversight,
>> that the 'sparse' keyword packed things densely if they happened to be
>> track-restricted, so we just fixed it.
> I've an extra question for elements spanning several rows.
> Let's use an example as it's going to be easier to explain:
> <div style="display: grid; grid-template-columns: auto auto auto;">
>   <div style="grid-row: 1; grid-column: 2;">item 1</div>
>   <div style="grid-row: 2; grid-column: 1;">item 2</div>
>   <div style="grid-row: 1 / span 2;">item 3</div>
>   <div style="grid-row: 1;">item 4</div>
>   <div style="grid-row: 2;">item 5</div>
> </div>
> The items will be placed at:
> * item 1: 1st row, 2nd column.
> * item 2: 2nd row, 1st column.
> * item 3: 1st and 2nd rows, 3rd column.
> * item 4: 1st row, 4th column.
> * item 5: 2st row, 4th column.
> I'm not completely sure about "item 5" position, I think it should be in
> the 4th column but the algorithm only talks about "this row", maybe it
> should be in the 2nd column:
> "Set the row-start line of its placement to the earliest (smallest
> positive index) line index that ensures this item’s grid area will not
> overlap any occupied grid cells and that is past any grid items
> previously placed in this row by this step."
> What is the expected behavior?

The spec requires it to be put in the 2nd column; it purposely doesn't
complicate things by tracking positions across rows.

Received on Wednesday, 11 February 2015 22:56:06 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:52:01 UTC