[Webkit-unassigned] [Bug 236054] Add support for parsing 'subgrid' in grid-template-columns/row

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Feb 8 12:20:10 PST 2022


https://bugs.webkit.org/show_bug.cgi?id=236054

--- Comment #21 from Oriol Brufau <obrufau at igalia.com> ---
(In reply to Matt Woodrow from comment #19)
> Do you know why the non-sub grid code also does the same +1 after an
> auto-repeat?
> 
> I left it the same to match (and it means the code in
> CSSComputedStyleDeclaration/NamedLineCollection gets to be more similar),
> though I agree that it's probably better just to not bother.
> 
> I'll update this patch to not need it, but it might be nice to change the
> normal grid code at some point too.

The non-subgrid code increases currentNamedGridLine at every track size.
Then, it's necessary to also increase after an auto-repeat because in

   grid-template-columns: [a] repeat(auto-fill, 1px) [b]

we want [a] and [b] to have different indexes, even if there is no track size between them (outside the auto-repeat, which is stored separately).

But with subgrid, we are increasing at every line name list. Then,

   grid-template-columns: subgrid [a] repeat(auto-fill, [c]) [b]

the [a] and [b] already have different indices.

I don't think the subgrid and non-subgrid cases can be made much more consistent since line names have different behaviors around repeats:

    grid-template-columns: [a] repeat(2, [b] 1px [c]) [d]; /* same as: */
    grid-template-columns: [a b] 1px [c b] 1px [c d];

    grid-template-columns: subgrid [a] repeat(2, [b] [c]) [d]; /* same as: */
    grid-template-columns: subgrid [a] [b] [c] [b] [c] [d];

In the non-subgrid case, adjacent name lists are merged, that's why we count track sizes instead.
In the subgrid case, adjacent name lists are not merged and we don't have track sizes, so we count name lists.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220208/1314870c/attachment.htm>


More information about the webkit-unassigned mailing list