[Masonry] Update grid-lanes-direction syntax [chromium/src : main]

0 views
Skip to first unread message

Kurt Catti-Schmidt (Gerrit)

unread,
Jan 9, 2026, 6:40:03 PM (2 days ago) Jan 9
to Alison Maher, Ian Kilpatrick, Celeste Pan, Yanling Wang, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Javier Fernandez, apavlo...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from Alison Maher and Ian Kilpatrick

Kurt Catti-Schmidt added 7 comments

File third_party/blink/renderer/core/css/cssom_utils.cc
Line 78, Patchset 4 (Latest): CHECK_EQ(value->GetValueID(), CSSValueID::kNormal);
Kurt Catti-Schmidt . unresolved

What about just `row` or `column`? Per the grammar above, this is allowed:

`'grid-lanes-direction: normal | [ row | column ] [ fill-reverse
|| track-reverse ]?'`

EDIT: Looking below, it looks like those get parsed as a list with one entry. Could use a comment here indicating that.

Line 88, Patchset 4 (Latest): CHECK_GE(list->length(), 1u);
return To<CSSIdentifierValue>(&list->Item(0))->GetValueID() ==
CSSValueID::kColumn;
Kurt Catti-Schmidt . unresolved

Same here, `row` and `column` are valid identifiers for this, so this looks like a bug. Could use a comment.

File third_party/blink/renderer/core/css/properties/css_parsing_utils.cc
Line 7278, Patchset 4 (Latest): CSSValueID second_reverse_id = stream.Peek().Id();
if ((second_reverse_id != CSSValueID::kFillReverse &&
second_reverse_id != CSSValueID::kTrackReverse) ||
second_reverse_id == first_reverse_id) {
return list;
}
Kurt Catti-Schmidt . unresolved

This will allow parsing the same reverse keyword twice, e.g. `row fill-reverse fill-reverse` or `row track-reverse track-reverse`. You'll need to add some bools to determine whether `fill-reverse` or `track-reverse` was previously parsed.

File third_party/blink/renderer/core/css/resolver/style_builder_converter.cc
Line 1876, Patchset 4 (Latest): bool has_both_reversals = list.length() == 3;
Kurt Catti-Schmidt . unresolved

nit: `const bool`

File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_direction.h
Line 46, Patchset 4 (Latest): GridLanesOrientation orientation;
Kurt Catti-Schmidt . unresolved

Nit: for consistency, this can be

```
GridLanesOrientation orientation = GridLanesOrientation::kNormal;
```

...and you can remove it from the default constructor

Line 36, Patchset 4 (Latest): bool operator==(const GridLanesDirection& other) const {
return orientation == other.orientation &&
is_fill_reverse == other.is_fill_reverse &&
is_track_reverse == other.is_track_reverse;
}

bool operator!=(const GridLanesDirection& other) const {
return !(*this == other);
}
Kurt Catti-Schmidt . unresolved

Since these are trivial memberwise comparisons, I believe they can both be `= default;` instead of the function body.

File third_party/blink/web_tests/external/wpt/css/css-grid/grid-lanes/tentative/parsing/grid-lanes-direction-invalid.html
Line 25, Patchset 4 (Latest): test_invalid_value("grid-lanes-direction", "column reverse");
Kurt Catti-Schmidt . unresolved

Could use cases for duplicated `fill-reverse` and `track-reverse` as mentioned above:

```
test_invalid_value("grid-lanes-direction", "row fill-reverse fill-reverse");
test_invalid_value("grid-lanes-direction", "row track-reverse track-reverse");
```

You also might want to add some `!important` tokens in the middle, e.g.


```
test_invalid_value("grid-lanes-direction", "row !important fill-reverse fill-reverse");
test_invalid_value("grid-lanes-direction", "row track-reverse !important fill-reverse");
```
Open in Gerrit

Related details

Attention is currently required from:
  • Alison Maher
  • Ian Kilpatrick
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I02ef728047dbea54610c7e3eae9d7a600f41f39c
Gerrit-Change-Number: 7425336
Gerrit-PatchSet: 4
Gerrit-Owner: Alison Maher <alm...@microsoft.com>
Gerrit-Reviewer: Alison Maher <alm...@microsoft.com>
Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Reviewer: Kurt Catti-Schmidt <ksc...@microsoft.com>
Gerrit-CC: Celeste Pan <celes...@microsoft.com>
Gerrit-CC: Javier Fernandez <jfern...@igalia.com>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-CC: Yanling Wang <yanli...@microsoft.com>
Gerrit-Attention: Alison Maher <alm...@microsoft.com>
Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Comment-Date: Fri, 09 Jan 2026 23:39:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Alison Maher (Gerrit)

unread,
Jan 9, 2026, 7:22:05 PM (2 days ago) Jan 9
to Kurt Catti-Schmidt, Ian Kilpatrick, Celeste Pan, Yanling Wang, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Javier Fernandez, apavlo...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from Ian Kilpatrick and Kurt Catti-Schmidt

Alison Maher voted and added 7 comments

Votes added by Alison Maher

Commit-Queue+1

7 comments

File third_party/blink/renderer/core/css/cssom_utils.cc
Line 78, Patchset 4: CHECK_EQ(value->GetValueID(), CSSValueID::kNormal);
Kurt Catti-Schmidt . resolved

What about just `row` or `column`? Per the grammar above, this is allowed:

`'grid-lanes-direction: normal | [ row | column ] [ fill-reverse
|| track-reverse ]?'`

EDIT: Looking below, it looks like those get parsed as a list with one entry. Could use a comment here indicating that.

Alison Maher

Yeah, if normal also allowed the revsere keywords, I would have done everything as a list so we didn't have different paths for this. But comment added to make it more obvious

Line 88, Patchset 4: CHECK_GE(list->length(), 1u);

return To<CSSIdentifierValue>(&list->Item(0))->GetValueID() ==
CSSValueID::kColumn;
Kurt Catti-Schmidt . resolved

Same here, `row` and `column` are valid identifiers for this, so this looks like a bug. Could use a comment.

Alison Maher

Done

File third_party/blink/renderer/core/css/properties/css_parsing_utils.cc
Line 7278, Patchset 4: CSSValueID second_reverse_id = stream.Peek().Id();

if ((second_reverse_id != CSSValueID::kFillReverse &&
second_reverse_id != CSSValueID::kTrackReverse) ||
second_reverse_id == first_reverse_id) {
return list;
}
Kurt Catti-Schmidt . resolved

This will allow parsing the same reverse keyword twice, e.g. `row fill-reverse fill-reverse` or `row track-reverse track-reverse`. You'll need to add some bools to determine whether `fill-reverse` or `track-reverse` was previously parsed.

Alison Maher

This is actually covered by the check that `second_reverse_id == first_reverse_id`, we will return early, then the callers will check if we are at the end of the stream, and treat it as invalid if not.

Added additional test cases, though

File third_party/blink/renderer/core/css/resolver/style_builder_converter.cc
Line 1876, Patchset 4: bool has_both_reversals = list.length() == 3;
Kurt Catti-Schmidt . resolved

nit: `const bool`

Alison Maher

Done

File third_party/blink/renderer/core/layout/grid_lanes/grid_lanes_direction.h
Line 46, Patchset 4: GridLanesOrientation orientation;
Kurt Catti-Schmidt . resolved

Nit: for consistency, this can be

```
GridLanesOrientation orientation = GridLanesOrientation::kNormal;
```

...and you can remove it from the default constructor

Alison Maher

Done

Line 36, Patchset 4: bool operator==(const GridLanesDirection& other) const {

return orientation == other.orientation &&
is_fill_reverse == other.is_fill_reverse &&
is_track_reverse == other.is_track_reverse;
}

bool operator!=(const GridLanesDirection& other) const {
return !(*this == other);
}
Kurt Catti-Schmidt . resolved

Since these are trivial memberwise comparisons, I believe they can both be `= default;` instead of the function body.

Alison Maher

Done

File third_party/blink/web_tests/external/wpt/css/css-grid/grid-lanes/tentative/parsing/grid-lanes-direction-invalid.html
Line 25, Patchset 4: test_invalid_value("grid-lanes-direction", "column reverse");
Kurt Catti-Schmidt . resolved

Could use cases for duplicated `fill-reverse` and `track-reverse` as mentioned above:

```
test_invalid_value("grid-lanes-direction", "row fill-reverse fill-reverse");
test_invalid_value("grid-lanes-direction", "row track-reverse track-reverse");
```

You also might want to add some `!important` tokens in the middle, e.g.


```
test_invalid_value("grid-lanes-direction", "row !important fill-reverse fill-reverse");
test_invalid_value("grid-lanes-direction", "row track-reverse !important fill-reverse");
```
Alison Maher

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Ian Kilpatrick
  • Kurt Catti-Schmidt
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I02ef728047dbea54610c7e3eae9d7a600f41f39c
    Gerrit-Change-Number: 7425336
    Gerrit-PatchSet: 5
    Gerrit-Owner: Alison Maher <alm...@microsoft.com>
    Gerrit-Reviewer: Alison Maher <alm...@microsoft.com>
    Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
    Gerrit-Reviewer: Kurt Catti-Schmidt <ksc...@microsoft.com>
    Gerrit-CC: Celeste Pan <celes...@microsoft.com>
    Gerrit-CC: Javier Fernandez <jfern...@igalia.com>
    Gerrit-CC: Menard, Alexis <alexis...@intel.com>
    Gerrit-CC: Yanling Wang <yanli...@microsoft.com>
    Gerrit-Attention: Kurt Catti-Schmidt <ksc...@microsoft.com>
    Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
    Gerrit-Comment-Date: Sat, 10 Jan 2026 00:21:55 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Kurt Catti-Schmidt <ksc...@microsoft.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages