Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URLPattern: Implement compareComponent() method. #29791

Merged
merged 1 commit into from
Jul 28, 2021

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Jul 26, 2021

This CL adds a prototype URLPattern.compareComponent() to provide a
natural ordering to URLPattern pattern strings. This was based on
feedback from routing framework authors and there is some discussion
in:

whatwg/urlpattern#61

The general algorithm is to compare the component patterns Part by Part.
The PartType, Modifier, and text contents are compared for each Part,
but group names are not considered. The end result is a mostly
lexicographical ordering based on fixed text. Matching groups and
modifiers are ordered such that more restrictive patterns are greater.

Bug: 1232795
Change-Id: I8474cd7d7689e657c9c74c552ad630cdcdd86c95
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3052630
Commit-Queue: Ben Kelly <[email protected]>
Reviewed-by: Jeremy Roman <[email protected]>
Cr-Commit-Position: refs/heads/master@{#906025}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-3052630 branch 3 times, most recently from ffbb201 to 7c0f1ac Compare July 27, 2021 18:49
@chromium-wpt-export-bot chromium-wpt-export-bot changed the title URLPattern: Implement compare() method. URLPattern: Implement compareComponent() method. Jul 28, 2021
@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-3052630 branch 3 times, most recently from ebea48d to 5d0a922 Compare July 28, 2021 01:20
This CL adds a prototype URLPattern.compareComponent() to provide a
natural ordering to URLPattern pattern strings.  This was based on
feedback from routing framework authors and there is some discussion
in:

whatwg/urlpattern#61

The general algorithm is to compare the component patterns Part by Part.
The PartType, Modifier, and text contents are compared for each Part,
but group names are not considered.  The end result is a mostly
lexicographical ordering based on fixed text.  Matching groups and
modifiers are ordered such that more restrictive patterns are greater.

Bug: 1232795
Change-Id: I8474cd7d7689e657c9c74c552ad630cdcdd86c95
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3052630
Commit-Queue: Ben Kelly <[email protected]>
Reviewed-by: Jeremy Roman <[email protected]>
Cr-Commit-Position: refs/heads/master@{#906025}
@chromium-wpt-export-bot chromium-wpt-export-bot merged commit 2f4642d into master Jul 28, 2021
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-3052630 branch July 28, 2021 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants