-
Notifications
You must be signed in to change notification settings - Fork 23
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
feat: support for case-insensitive matches #168
Conversation
This commit updates the specification document with the support of case-insensitive matches by introducing a third argument in the `URLPattern` constructor. This additional document contains a single boolean property named `ignoreCase`, which can be set to `true` to enable case-insensitive matches. By default this flag is set to `false`, thus enabling case-sensitive matches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for writing this! Overall it looks reasonable, but I have a few suggestions and requests. Also, I wouldn't mind having @domenic look at it for the object.assign usage.
@wanderview @domenic Thanks for the review. I have made the changes, outlined. I think it should now be ready for the next round of review or merge. |
More info: whatwg/urlpattern#168
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again. I found a few more issues in the pass.
Note, there will probably be some delay in landing this PR even when its ready. I'm unsure about landing this without starting the process to change chromium. If you want to help there you could file a bug at crbug.com and include a link to to it in the commit message for this PR.
If you are interested in helping with changes to chromium I can support you with that. Otherwise I will need to carve out some time to do that in the next few weeks.
@wanderview FYI created this to track the implementation task in Chrome: https://bugs.chromium.org/p/chromium/issues/detail?id=1345036 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks! Note I will probably wait to merge until implementation is close to landing.
@@ -120,7 +120,7 @@ typedef (USVString or URLPatternInit) URLPatternInput; | |||
|
|||
[Exposed=(Window,Worker)] | |||
interface URLPattern { | |||
constructor(optional URLPatternInput input = {}, optional USVString baseURL); | |||
constructor(optional URLPatternInput input = {}, optional USVString baseURL, optional URLPatternOptions options = {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we also need a second constructor form to do what you want:
constructor(optional URLPatternInput input = {}, optional URLPatternOptions options = {});
Otherwise you cannot specify options without also specifying a base URL second arg.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to fix this in a follow-up commit.
Implements spec changes from: whatwg/urlpattern#168 Bug: 1345036 Change-Id: I659784cff5420603f8805aeed9bcd5852f97b5ae
Implements spec changes from: whatwg/urlpattern#168 Bug: 1345036 Change-Id: I659784cff5420603f8805aeed9bcd5852f97b5ae
Implements spec changes from: whatwg/urlpattern#168 Bug: 1345036 Change-Id: I659784cff5420603f8805aeed9bcd5852f97b5ae Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3866651 Reviewed-by: Jeremy Roman <jbroman@chromium.org> Commit-Queue: Ben Kelly <wanderview@chromium.org> Cr-Commit-Position: refs/heads/main@{#1041730}
Implements spec changes from: whatwg/urlpattern#168 Bug: 1345036 Change-Id: I659784cff5420603f8805aeed9bcd5852f97b5ae Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3866651 Reviewed-by: Jeremy Roman <jbroman@chromium.org> Commit-Queue: Ben Kelly <wanderview@chromium.org> Cr-Commit-Position: refs/heads/main@{#1041730}
Implements spec changes from: whatwg/urlpattern#168 Bug: 1345036 Change-Id: I659784cff5420603f8805aeed9bcd5852f97b5ae Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3866651 Reviewed-by: Jeremy Roman <jbroman@chromium.org> Commit-Queue: Ben Kelly <wanderview@chromium.org> Cr-Commit-Position: refs/heads/main@{#1041730}
…estonly Automatic update from web-platform-tests URLPattern: Add ignoresCase option. Implements spec changes from: whatwg/urlpattern#168 Bug: 1345036 Change-Id: I659784cff5420603f8805aeed9bcd5852f97b5ae Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3866651 Reviewed-by: Jeremy Roman <jbroman@chromium.org> Commit-Queue: Ben Kelly <wanderview@chromium.org> Cr-Commit-Position: refs/heads/main@{#1041730} -- wpt-commits: 6d152e4018ca4f45ce93eea4985c516a518c3ad6 wpt-pr: 35729
This is necessary to allow options to be provided without the second `baseURL` argument.
Implements spec changes from: whatwg/urlpattern#168 Bug: 1345036 Change-Id: I659784cff5420603f8805aeed9bcd5852f97b5ae Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3866651 Reviewed-by: Jeremy Roman <jbroman@chromium.org> Commit-Queue: Ben Kelly <wanderview@chromium.org> Cr-Commit-Position: refs/heads/main@{#1041730} NOKEYCHECK=True GitOrigin-RevId: de7fdfdc52b4e01e709630eae6ebd29ad5524eed
This commit updates the specification document with the support of
case-insensitive matches by introducing a third argument in the
URLPattern
constructor. This additional document contains a singleboolean property named
ignoreCase
, which can be set totrue
toenable case-insensitive matches. By default, this flag is set to
false
,thus enabling case-sensitive matches.
Closes #148
Preview | Diff