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

Using URL as map keys is problematic without defining equality #10315

Open
annevk opened this issue May 2, 2024 · 0 comments
Open

Using URL as map keys is problematic without defining equality #10315

annevk opened this issue May 2, 2024 · 0 comments

Comments

@annevk
Copy link
Member

annevk commented May 2, 2024

What is the issue with the HTML Standard?

Several possible ways forward here:

  1. We always serialize URLs before using them as keys. I suspect in pretty much all cases we want URL serialized equality.
  2. We define a way to define map key equality and use that here (or alternatively define somewhere in the URL Standard that when a URL is used as a key in a map, the map key equality algorithm is the URL equals algorithm).
  3. We say alongside each map how the keys are compared in prose, without anything formal.

I think I like 2 best, as it also suggests a way forward on how to resolve similar issues elsewhere. But I don't feel strongly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants
@annevk and others