Re: [css-grid] Grid Item Placement Algorithm: Step 3

On Thu, Nov 5, 2015 at 7:15 AM, Manuel Rego Casasnovas <rego@igalia.com> wrote:
> Hi,
>
> regarding 3rd step of placement algorithm: "Determine the number of
> columns in the implicit grid". I think there's a mistake in "the largest
> positive column-end line index, minus 1".
>
> This was ok when the implicit tracks could only be added after the
> explicit grid, but now that the spec allows to add implicit tracks
> before the explicit grid this is not true anymore.
>
> So for example, imagine that we've a 2 columns grid, the lines would be
> something like this:
>          |---|---|
>          1   2   3
>
> But when you place an item using "grid-column: -5;" it'd add 2 new
> columns before the explicit grid. The lines would be:
>          |---|---|---|---|
>                  1   2   3
>         -5  -4  -3  -2  -1
>
> So, if we've any auto-positioned items, when we need to calculate the
> number of columns, we should consider that it's 4. That's not the
> "largest positive column-end line". I guess this should be the distance
> between the left and right definite lines (not sure about the right
> wording for this).

Yup, you're right.  I've reworked step 3 slightly to explicitly and
correctly determine which additional rows the implicit grid needs, and
slightly tweaked step 4 to handle the fact that the minimum line index
might be less than 1.

~TJ

Received on Thursday, 10 December 2015 23:08:09 UTC