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

Make dummyURL from the basic URL parser with a special scheme #269

Merged
merged 4 commits into from
Mar 26, 2025

Conversation

sisidovski
Copy link
Collaborator

@sisidovski sisidovski commented Mar 24, 2025

Based on the discussion in #252.

We should not use URL records directly to canonicalize components, we should specify a special scheme as a default scheme. When we create a dummy URL, it should be created from the basic URL parser. This is not ideal but this can be achieved by creating a dummy URL with this fixed URL string.


Preview | Diff

@sisidovski sisidovski requested a review from annevk March 24, 2025 17:14
@sisidovski
Copy link
Collaborator Author

@annevk Not sure if this kind of simple change address the issue. Could you give some advice? Thank you!

Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

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

Modulo a couple of nits I think this is the right approach, yeah. This is also pretty much how WebKit handles this.

@sisidovski
Copy link
Collaborator Author

Updated based on your suggestions, thank you!

spec.bs Outdated
</div>

<div algorithm>
To <dfn>canonicalize a username</dfn> given a string |value|:

1. If |value| is the empty string, return |value|.
1. Let |dummyURL| be a new [=URL record=].
1. Let |dummyURL| be the result of [=create a dummy URL=].
Copy link
Member

Choose a reason for hiding this comment

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

You want "creating" not "create" here (and below) to get a proper sentence (you don't have to change the <dfn> for that, as I mentioned Bikeshed takes care of making that work).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

My bad, fixed.

@annevk
Copy link
Member

annevk commented Mar 25, 2025

@sisidovski when merging this, please take care to follow https://github.com/whatwg/meta/blob/main/COMMITTING.md (in particular the Squash and merge section). I noticed this went wrong a few times for this repository. Feel free to reach out on https://whatwg.org/chat if you have questions or ask @domenic internally.

@sisidovski sisidovski merged commit 46c30fd into whatwg:main Mar 26, 2025
2 checks passed
@sisidovski sisidovski deleted the dummy-url branch March 26, 2025 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants