Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 9ae5950375c63dc99428d4d384a8b603ae6a61f5
https://github.com/WebKit/WebKit/commit/9ae5950375c63dc99428d4d384a8b603ae6a61f5
Author: Ahmad Saleem <[email protected]>
Date: 2026-10-13 (Tue, 13 Oct 2026)
Changed paths:
M
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-shorthand-valid-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-shorthand-valid.html
M Source/WebCore/css/parser/CSSPropertyParserCustom.h
Log Message:
-----------
grid-template shorthand: empty [] line-names before a row's leading
line-names overwrites the previous row's track size
https://bugs.webkit.org/show_bug.cgi?id=327186
rdar://189769011
Reviewed by Sammy Gill.
This patch aligns WebKit with Gecko / Firefox and Blink / Chromium.
In the `[ <line-names>? <string> <track-size>? <line-names>? ]+` form of
grid-template, consumeGridTemplateShorthand() keeps the trailing
<line-names> from one row so it can merge them with the next row's
leading <line-names> (e.g. `"a" [a] [b] "b"` becomes `"a" [a b] "b"`).
The merge works by replacing the track list's last entry, which assumes
the trailing names were appended.
An empty trailing `[]` is never appended, but it is still kept as a
non-null value. So with `"a" 10px [] [b] "b" 20px`, the leading `[b]` took
the merge path and replaced the last entry, which was the `10px` track
size. The result serialized as `[b] "a" 20px`.
Only merge when the previous line-names are non-empty. Otherwise append
the leading line-names as a new entry.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-shorthand-valid-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-shorthand-valid.html:
* Source/WebCore/css/parser/CSSPropertyParserCustom.h:
(WebCore::CSS::PropertyParserCustom::consumeGridTemplateShorthand):
Canonical link: https://commits.webkit.org/323665@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications