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

Document base URL does not conform to RFC3986 re. fragment identifiers #9843

Closed
namedgraph opened this issue Oct 9, 2023 · 5 comments
Closed

Comments

@namedgraph
Copy link

namedgraph commented Oct 9, 2023

What is the issue with the HTML Standard?

I was surprised to see that the baseURI property in Chrome returns URLs that include a fragment identifier.

I think it should be specified that document base URL should not include the fragment identifier.

This is because RFC3986 5.1 states:

A base URI must conform to the <absolute-URI> syntax rule (Section 4.3). If the base URI is obtained from a URI reference, then that reference must be converted to absolute form and stripped of any fragment component prior to its use as a base URI.

@annevk
Copy link
Member

annevk commented Oct 9, 2023

Browsers implement https://url.spec.whatwg.org which has no such rule. In particular a base URL is just a specially designated URL, that's it. There are certain places where we serialize without fragment identifier, but baseURI is not one of those places.

@namedgraph
Copy link
Author

How is it a "base URL" if it cannot be used as a base URL for resolution of relative URLs? I don't see resolution defined in the WHATWG spec.

@annevk
Copy link
Member

annevk commented Oct 9, 2023

The web platform doesn't have a relative URLs as a concept, only as string inputs for the URL parser (which also takes a base URL).

@namedgraph
Copy link
Author

Sorry, I cannot take the WHATWG specs seriously.

@annevk
Copy link
Member

annevk commented Oct 9, 2023

Okay. Meanwhile this seems invalid, so I'll close.

@annevk annevk closed this as not planned Won't fix, can't repro, duplicate, stale Oct 9, 2023
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