Fix silent column combinator parsing failure [chromium/src : main]

0 views
Skip to first unread message

Byungwoo Lee (Gerrit)

unread,
Jul 12, 2026, 10:44:29 PMJul 12
to Rune Lillesveen, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, Menard, Alexis, chromium...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
Attention needed from Rune Lillesveen

Byungwoo Lee added 1 comment

Patchset-level comments
File-level comment, Patchset 3 (Latest):
Byungwoo Lee . resolved

Hello Rune, this fixes the silent selector parsing error caused by the column combinator (||) which is not yet supported. (Found this after the CL 8061514 applied). Could you review this as well? Thank you!

Open in Gerrit

Related details

Attention is currently required from:
  • Rune Lillesveen
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not 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: I1848a2c1964d466675acb577b7741813a9601d70
Gerrit-Change-Number: 8061514
Gerrit-PatchSet: 3
Gerrit-Owner: Byungwoo Lee <bl...@igalia.com>
Gerrit-Reviewer: Byungwoo Lee <bl...@igalia.com>
Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-Attention: Rune Lillesveen <fut...@chromium.org>
Gerrit-Comment-Date: Mon, 13 Jul 2026 02:43:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Rune Lillesveen (Gerrit)

unread,
Jul 23, 2026, 8:16:09 AM (4 days ago) Jul 23
to Byungwoo Lee, Rune Lillesveen, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, Menard, Alexis, chromium...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
Attention needed from Byungwoo Lee

Rune Lillesveen added 1 comment

File third_party/blink/renderer/core/css/parser/css_selector_parser.cc
Line 2157, Patchset 4 (Latest): if (stream.Peek().GetType() == kColumnToken) {
Rune Lillesveen . unresolved

Why is this handled differently from other tokens which may become combinators in the future?

Open in Gerrit

Related details

Attention is currently required from:
  • Byungwoo Lee
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I1848a2c1964d466675acb577b7741813a9601d70
    Gerrit-Change-Number: 8061514
    Gerrit-PatchSet: 4
    Gerrit-Owner: Byungwoo Lee <bl...@igalia.com>
    Gerrit-Reviewer: Byungwoo Lee <bl...@igalia.com>
    Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
    Gerrit-CC: Menard, Alexis <alexis...@intel.com>
    Gerrit-Attention: Byungwoo Lee <bl...@igalia.com>
    Gerrit-Comment-Date: Thu, 23 Jul 2026 12:15:50 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Byungwoo Lee (Gerrit)

    unread,
    Jul 26, 2026, 8:23:25 PM (8 hours ago) Jul 26
    to Rune Lillesveen, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, Menard, Alexis, chromium...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from Rune Lillesveen

    Byungwoo Lee added 1 comment

    File third_party/blink/renderer/core/css/parser/css_selector_parser.cc
    Line 2157, Patchset 4 (Latest): if (stream.Peek().GetType() == kColumnToken) {
    Rune Lillesveen . unresolved

    Why is this handled differently from other tokens which may become combinators in the future?

    Byungwoo Lee

    I think that CSS column combinator (`||`) cannot be handled as kDelimiterToken since it has two characters. (and the single vertical bar (`|`) is already used for the namespace separator).

    Would it be better to have an enclosing switch/case for `stream.Peak().GetType()` so we can collect the cases close to each other?

    ```cpp
    switch (stream.Peek().GetType()) {
    case kDelimiterToken:
    switch (stream.Peek().Delimiter()) {
    case '+':
    stream.ConsumeIncludingWhitespace();
    return CSSSelector::kDirectAdjacent;
            case '~':
    stream.ConsumeIncludingWhitespace();
    return CSSSelector::kIndirectAdjacent;
            case '>':
    stream.ConsumeIncludingWhitespace();
    return CSSSelector::kChild;

    default:
    return fallback_result;
    }
    case kColumnToken:
    // TODO(crbug.com/461140887): Support CSS column combinator (||).
    failed_parsing_ = true;
    [[fallthrough]];
    default:
    return fallback_result;
    }
    ```
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Rune Lillesveen
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I1848a2c1964d466675acb577b7741813a9601d70
    Gerrit-Change-Number: 8061514
    Gerrit-PatchSet: 4
    Gerrit-Owner: Byungwoo Lee <bl...@igalia.com>
    Gerrit-Reviewer: Byungwoo Lee <bl...@igalia.com>
    Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
    Gerrit-CC: Menard, Alexis <alexis...@intel.com>
    Gerrit-Attention: Rune Lillesveen <fut...@chromium.org>
    Gerrit-Comment-Date: Mon, 27 Jul 2026 00:22:46 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Rune Lillesveen <fut...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Rune Lillesveen (Gerrit)

    unread,
    3:14 AM (1 hour ago) 3:14 AM
    to Byungwoo Lee, Rune Lillesveen, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, Menard, Alexis, chromium...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from Byungwoo Lee

    Rune Lillesveen added 1 comment

    File third_party/blink/renderer/core/css/parser/css_selector_parser.cc
    Rune Lillesveen

    But as far as Blink is currently concerned, "||" is not a valid combinator, right? What makes it different from "$$" or "++" or "~~"?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Byungwoo Lee
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I1848a2c1964d466675acb577b7741813a9601d70
    Gerrit-Change-Number: 8061514
    Gerrit-PatchSet: 4
    Gerrit-Owner: Byungwoo Lee <bl...@igalia.com>
    Gerrit-Reviewer: Byungwoo Lee <bl...@igalia.com>
    Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
    Gerrit-CC: Menard, Alexis <alexis...@intel.com>
    Gerrit-Attention: Byungwoo Lee <bl...@igalia.com>
    Gerrit-Comment-Date: Mon, 27 Jul 2026 07:13:57 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Rune Lillesveen <fut...@chromium.org>
    Comment-In-Reply-To: Byungwoo Lee <bl...@igalia.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Rune Lillesveen (Gerrit)

    unread,
    3:20 AM (1 hour ago) 3:20 AM
    to Byungwoo Lee, Rune Lillesveen, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, Menard, Alexis, chromium...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    File third_party/blink/renderer/core/css/parser/css_selector_parser.cc
    Rune Lillesveen

    Or perhaps something that's not currently a delim: "$=" => kSuffixMatchToken.

    What if "$=" becomes a combinator in the future?

    Gerrit-Comment-Date: Mon, 27 Jul 2026 07:20:16 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Byungwoo Lee (Gerrit)

    unread,
    3:56 AM (22 minutes ago) 3:56 AM
    to Rune Lillesveen, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, Menard, Alexis, chromium...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from Rune Lillesveen

    Byungwoo Lee added 1 comment

    File third_party/blink/renderer/core/css/parser/css_selector_parser.cc
    Byungwoo Lee

    Yes correct, `||` is not a valid combinator now.

    But it is a valid CSS token. Here is how `CSSTokenizer` produces tokens when it reach `|`, `$`, and `~`:

    ```cpp
    template <bool SkipComments>
    CSSParserToken CSSTokenizer::NextToken() {
    ...
    case '$':
    if (ConsumeIfNext('=')) {
    return CSSParserToken(kSuffixMatchToken);
    }
    return CSSParserToken(kDelimiterToken, '$');
    case '|':
    if (ConsumeIfNext('=')) {
    return CSSParserToken(kDashMatchToken);
    }
    if (ConsumeIfNext('|')) {
    return CSSParserToken(kColumnToken);
    }
    return CSSParserToken(kDelimiterToken, '|');
    case '~':
    if (ConsumeIfNext('=')) {
    return CSSParserToken(kIncludeMatchToken);
    }
    return CSSParserToken(kDelimiterToken, '~');
    ...
    ```

    Since `||` and `$=` each have a valid token, the selector parser can get `kColumnToken` or `kSuffixMatchToken` at the position where a combinator is expected (`CSSSelectorParser::ConsumeCombinator()`). So if `$=` becomes a combinator later, I think we can return its `RelationType` here, just as we do for `||`.

    The `~~` case is different. Since there is no valid token for a double tilde, it is tokenized as two adjacent delimiter tokens of tilde value(`~`). If the first tilde is consumed as a subsequent-sibling combinator, the next should be a compound selector. So when the parser sees an additional subsequent-sibling combinator with no compound selector in between, the parsing fails.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Rune Lillesveen
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I1848a2c1964d466675acb577b7741813a9601d70
    Gerrit-Change-Number: 8061514
    Gerrit-PatchSet: 4
    Gerrit-Owner: Byungwoo Lee <bl...@igalia.com>
    Gerrit-Reviewer: Byungwoo Lee <bl...@igalia.com>
    Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
    Gerrit-CC: Menard, Alexis <alexis...@intel.com>
    Gerrit-Attention: Rune Lillesveen <fut...@chromium.org>
    Gerrit-Comment-Date: Mon, 27 Jul 2026 07:56:06 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages