[RouteMatching] Add CSS @route rule. [chromium/src : main]

0 views
Skip to first unread message

Morten Stenshorne (Gerrit)

unread,
Dec 9, 2025, 2:28:38 PM (5 days ago) Dec 9
to Noam Rosenthal, Chromium LUCI CQ, Menard, Alexis, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, apavlo...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
Attention needed from Noam Rosenthal

New activity on the change

Open in Gerrit

Related details

Attention is currently required from:
  • Noam Rosenthal
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: I6e3083bae698ce11c25da5007a6117a9a33e4295
Gerrit-Change-Number: 7241475
Gerrit-PatchSet: 4
Gerrit-Owner: Morten Stenshorne <mste...@chromium.org>
Gerrit-Reviewer: Morten Stenshorne <mste...@chromium.org>
Gerrit-Reviewer: Noam Rosenthal <nrose...@google.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Noam Rosenthal <nrose...@google.com>
Gerrit-Comment-Date: Tue, 09 Dec 2025 19:28:19 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Kevin Babbitt (Gerrit)

unread,
Dec 9, 2025, 6:55:10 PM (5 days ago) Dec 9
to Morten Stenshorne, AyeAye, Noam Rosenthal, Chromium LUCI CQ, Menard, Alexis, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, ashleynewson+w...@chromium.org, android-web...@chromium.org, apavlo...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
Attention needed from Morten Stenshorne and Noam Rosenthal

Kevin Babbitt added 3 comments

File third_party/blink/renderer/core/css/css_route_rule.h
Line 17, Patchset 5 (Latest):class CORE_EXPORT CSSRouteRule final : public CSSRule {
Kevin Babbitt . unresolved

Should this be based on CSSConditionRule, and should DowncastTraits::AllowFrom allow the same downcast, to match the IDL?

File third_party/blink/renderer/core/css/parser/css_parser_token.h
Line 31, Patchset 5 (Latest): kUrlPatternToken,
Kevin Babbitt . unresolved

I'm surprised to see a new token type, and I'm a little confused because I can't find anything in the CL that produces a kUrlPatternToken.

Looking at the rest of the code... could we just handle these as `<function-token>` and look for the url-pattern function name? Or if there are places where they can appear outside `url-pattern()` could those be `<string-token>`?

File third_party/blink/renderer/core/route_matching/route_map.cc
Line 121, Patchset 5 (Latest):
if (name.StartsWith("--")) {
// Don't clash with CSS @route rules.
return ParseResult(ParseResult::kTypeError,
"Route names cannot start with '--'");
}
Kevin Babbitt . unresolved

Do we have a WPT for this case?

Open in Gerrit

Related details

Attention is currently required from:
  • Morten Stenshorne
  • Noam Rosenthal
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: I6e3083bae698ce11c25da5007a6117a9a33e4295
    Gerrit-Change-Number: 7241475
    Gerrit-PatchSet: 5
    Gerrit-Owner: Morten Stenshorne <mste...@chromium.org>
    Gerrit-Reviewer: Kevin Babbitt <kbab...@microsoft.com>
    Gerrit-Reviewer: Morten Stenshorne <mste...@chromium.org>
    Gerrit-Reviewer: Noam Rosenthal <nrose...@google.com>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Menard, Alexis <alexis...@intel.com>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Morten Stenshorne <mste...@chromium.org>
    Gerrit-Attention: Noam Rosenthal <nrose...@google.com>
    Gerrit-Comment-Date: Tue, 09 Dec 2025 23:54:59 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Morten Stenshorne (Gerrit)

    unread,
    Dec 11, 2025, 4:27:39 AM (4 days ago) Dec 11
    to Kevin Babbitt, AyeAye, Noam Rosenthal, Chromium LUCI CQ, Menard, Alexis, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, ashleynewson+w...@chromium.org, android-web...@chromium.org, apavlo...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
    Attention needed from Kevin Babbitt and Noam Rosenthal

    Morten Stenshorne added 3 comments

    File third_party/blink/renderer/core/css/css_route_rule.h
    Line 17, Patchset 5:class CORE_EXPORT CSSRouteRule final : public CSSRule {
    Kevin Babbitt . resolved

    Should this be based on CSSConditionRule, and should DowncastTraits::AllowFrom allow the same downcast, to match the IDL?

    Morten Stenshorne

    Thanks for spotting! It should be CSSRule, though. It's css_route_rule.idl that's wrong. Fixed it.

    File third_party/blink/renderer/core/css/parser/css_parser_token.h
    Line 31, Patchset 5: kUrlPatternToken,
    Kevin Babbitt . resolved

    I'm surprised to see a new token type, and I'm a little confused because I can't find anything in the CL that produces a kUrlPatternToken.

    Looking at the rest of the code... could we just handle these as `<function-token>` and look for the url-pattern function name? Or if there are places where they can appear outside `url-pattern()` could those be `<string-token>`?

    Morten Stenshorne

    Removed. Thanks! It was something I thought I needed, but then I removed most of it again (apart from this one, clearly).

    I'm unfamiliar with this code, and looked to the `url()` implementation for inspiration. Maybe not the best choice.

    File third_party/blink/renderer/core/route_matching/route_map.cc

    if (name.StartsWith("--")) {
    // Don't clash with CSS @route rules.
    return ParseResult(ParseResult::kTypeError,
    "Route names cannot start with '--'");
    }
    Kevin Babbitt . resolved

    Do we have a WPT for this case?

    Morten Stenshorne

    Added TODO. Most likely all this code will go away, so I won't bother spending any time on it right now.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Kevin Babbitt
    • Noam Rosenthal
    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: I6e3083bae698ce11c25da5007a6117a9a33e4295
      Gerrit-Change-Number: 7241475
      Gerrit-PatchSet: 7
      Gerrit-Owner: Morten Stenshorne <mste...@chromium.org>
      Gerrit-Reviewer: Kevin Babbitt <kbab...@microsoft.com>
      Gerrit-Reviewer: Morten Stenshorne <mste...@chromium.org>
      Gerrit-Reviewer: Noam Rosenthal <nrose...@google.com>
      Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
      Gerrit-CC: Kentaro Hara <har...@chromium.org>
      Gerrit-CC: Menard, Alexis <alexis...@intel.com>
      Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
      Gerrit-Attention: Kevin Babbitt <kbab...@microsoft.com>
      Gerrit-Attention: Noam Rosenthal <nrose...@google.com>
      Gerrit-Comment-Date: Thu, 11 Dec 2025 09:27:26 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Kevin Babbitt <kbab...@microsoft.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Noam Rosenthal (Gerrit)

      unread,
      Dec 11, 2025, 10:12:59 AM (3 days ago) Dec 11
      to Morten Stenshorne, Kevin Babbitt, AyeAye, Chromium LUCI CQ, Menard, Alexis, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, ashleynewson+w...@chromium.org, android-web...@chromium.org, apavlo...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
      Attention needed from Kevin Babbitt and Morten Stenshorne

      Noam Rosenthal added 1 comment

      File third_party/blink/public/mojom/use_counter/metrics/css_property_id.mojom
      Line 967, Patchset 7 (Latest): kUsername = 903,
      Noam Rosenthal . unresolved

      I'm not sure about username/password here yet. Perhaps let's start without them? CC @dbaron perhaps let's remove these from the spec for now?

      Also not sure about hostname.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Kevin Babbitt
      • Morten Stenshorne
      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: I6e3083bae698ce11c25da5007a6117a9a33e4295
        Gerrit-Change-Number: 7241475
        Gerrit-PatchSet: 7
        Gerrit-Owner: Morten Stenshorne <mste...@chromium.org>
        Gerrit-Reviewer: Kevin Babbitt <kbab...@microsoft.com>
        Gerrit-Reviewer: Morten Stenshorne <mste...@chromium.org>
        Gerrit-Reviewer: Noam Rosenthal <nrose...@google.com>
        Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
        Gerrit-CC: Kentaro Hara <har...@chromium.org>
        Gerrit-CC: Menard, Alexis <alexis...@intel.com>
        Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
        Gerrit-Attention: Morten Stenshorne <mste...@chromium.org>
        Gerrit-Attention: Kevin Babbitt <kbab...@microsoft.com>
        Gerrit-Comment-Date: Thu, 11 Dec 2025 15:12:42 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Morten Stenshorne (Gerrit)

        unread,
        Dec 11, 2025, 10:57:27 AM (3 days ago) Dec 11
        to Kevin Babbitt, AyeAye, Noam Rosenthal, Chromium LUCI CQ, Menard, Alexis, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, ashleynewson+w...@chromium.org, android-web...@chromium.org, apavlo...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
        Attention needed from Kevin Babbitt and Noam Rosenthal

        Morten Stenshorne added 1 comment

        File third_party/blink/public/mojom/use_counter/metrics/css_property_id.mojom
        Noam Rosenthal . unresolved

        I'm not sure about username/password here yet. Perhaps let's start without them? CC @dbaron perhaps let's remove these from the spec for now?

        Also not sure about hostname.

        Morten Stenshorne

        Since we're discussing... 😊

        In general, instead of all these descriptors, I think it would be great if `url-pattern()` could be used for everything. I don't know what's possible, and then collapse it all to:

        `@route --name (url-pattern(pathname:"/path/:id/", protocol:"https"));`

        Then we also don't have to define what should happen if `pattern` is specified alongside other component descriptors.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Kevin Babbitt
        • Noam Rosenthal
        Gerrit-Attention: Kevin Babbitt <kbab...@microsoft.com>
        Gerrit-Attention: Noam Rosenthal <nrose...@google.com>
        Gerrit-Comment-Date: Thu, 11 Dec 2025 15:57:09 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Noam Rosenthal <nrose...@google.com>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Morten Stenshorne (Gerrit)

        unread,
        Dec 11, 2025, 10:58:16 AM (3 days ago) Dec 11
        to David Baron, Kevin Babbitt, AyeAye, Noam Rosenthal, Chromium LUCI CQ, Menard, Alexis, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, ashleynewson+w...@chromium.org, android-web...@chromium.org, apavlo...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
        Attention needed from Kevin Babbitt and Noam Rosenthal

        Morten Stenshorne added 1 comment

        Patchset-level comments
        File-level comment, Patchset 7 (Latest):
        Morten Stenshorne . resolved

        (I don't think David got properly CCed)

        Gerrit-CC: David Baron <dba...@chromium.org>
        Gerrit-CC: Kentaro Hara <har...@chromium.org>
        Gerrit-CC: Menard, Alexis <alexis...@intel.com>
        Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
        Gerrit-Attention: Kevin Babbitt <kbab...@microsoft.com>
        Gerrit-Attention: Noam Rosenthal <nrose...@google.com>
        Gerrit-Comment-Date: Thu, 11 Dec 2025 15:58:00 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Kevin Babbitt (Gerrit)

        unread,
        Dec 11, 2025, 3:58:14 PM (3 days ago) Dec 11
        to Morten Stenshorne, David Baron, AyeAye, Noam Rosenthal, Chromium LUCI CQ, Menard, Alexis, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, ashleynewson+w...@chromium.org, android-web...@chromium.org, apavlo...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
        Attention needed from Morten Stenshorne and Noam Rosenthal

        Kevin Babbitt added 2 comments

        File third_party/blink/public/mojom/use_counter/metrics/css_property_id.mojom
        Noam Rosenthal . unresolved

        I'm not sure about username/password here yet. Perhaps let's start without them? CC @dbaron perhaps let's remove these from the spec for now?

        Also not sure about hostname.

        Morten Stenshorne

        Since we're discussing... 😊

        In general, instead of all these descriptors, I think it would be great if `url-pattern()` could be used for everything. I don't know what's possible, and then collapse it all to:

        `@route --name (url-pattern(pathname:"/path/:id/", protocol:"https"));`

        Then we also don't have to define what should happen if `pattern` is specified alongside other component descriptors.

        Kevin Babbitt

        Maybe pattern after the syntax for `if()`?

        File third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt
        Line 1036, Patchset 7 (Latest):interface CSSRouteRule : CSSConditionRule
        Kevin Babbitt . unresolved

        Should this be derived from CSSRule as well? (Same in android_webview/...)

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Morten Stenshorne
        • Noam Rosenthal
        Gerrit-Attention: Morten Stenshorne <mste...@chromium.org>
        Gerrit-Attention: Noam Rosenthal <nrose...@google.com>
        Gerrit-Comment-Date: Thu, 11 Dec 2025 20:58:04 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Morten Stenshorne <mste...@chromium.org>
        Comment-In-Reply-To: Noam Rosenthal <nrose...@google.com>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Morten Stenshorne (Gerrit)

        unread,
        Dec 11, 2025, 4:42:33 PM (3 days ago) Dec 11
        to David Baron, Kevin Babbitt, AyeAye, Noam Rosenthal, Chromium LUCI CQ, Menard, Alexis, Chromium Metrics Reviews, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, ashleynewson+w...@chromium.org, android-web...@chromium.org, apavlo...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
        Attention needed from Kevin Babbitt and Noam Rosenthal

        Morten Stenshorne added 1 comment

        File third_party/blink/web_tests/webexposed/global-interface-listing-expected.txt
        Line 1036, Patchset 7:interface CSSRouteRule : CSSConditionRule
        Kevin Babbitt . resolved

        Should this be derived from CSSRule as well? (Same in android_webview/...)

        Morten Stenshorne

        Indeed! I won't be able to land it otherwise. Thanks.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Kevin Babbitt
        • Noam Rosenthal
        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: I6e3083bae698ce11c25da5007a6117a9a33e4295
        Gerrit-Change-Number: 7241475
        Gerrit-PatchSet: 9
        Gerrit-Owner: Morten Stenshorne <mste...@chromium.org>
        Gerrit-Reviewer: Kevin Babbitt <kbab...@microsoft.com>
        Gerrit-Reviewer: Morten Stenshorne <mste...@chromium.org>
        Gerrit-Reviewer: Noam Rosenthal <nrose...@google.com>
        Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
        Gerrit-CC: David Baron <dba...@chromium.org>
        Gerrit-CC: Kentaro Hara <har...@chromium.org>
        Gerrit-CC: Menard, Alexis <alexis...@intel.com>
        Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
        Gerrit-Attention: Kevin Babbitt <kbab...@microsoft.com>
        Gerrit-Attention: Noam Rosenthal <nrose...@google.com>
        Gerrit-Comment-Date: Thu, 11 Dec 2025 21:42:19 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Kevin Babbitt <kbab...@microsoft.com>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy
        Reply all
        Reply to author
        Forward
        0 new messages