-
Notifications
You must be signed in to change notification settings - Fork 295
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
Use HTML's 'document base URL' concept. #258
Conversation
This definition is more correct right now, and using a getter rather than a mutable field makes it easier to figure out what is returned. CC <whatwg/html#421>.
Hmm, but we need some kind of callback for when it changes: #61. I guess defining that in HTML is not too bad, maybe a little weird? |
Note that the conclusion of that thread was that the callback is only necessary for CSS; everything else is done lazily. |
Also for custom elements that want that kind of behavior, no? Although I guess we could decide not to expose that primitive. |
Yeah, I don't think it's a primitive really. Custom elements will probably want to do the same thing |
How can you compute this lazily? It's immediately visible. |
When querying :visited, or when rendering, you figure out the resolved absolute URL. |
So whenever you render you have to go through all links in the document? Rather than only that rare time someone updates the base URL? I think I know why browsers have their current setup, and why theoretically custom elements might want that too... |
I mean, yes, whenever you render a link, you could resolve its URL lazily. With appropriate caching that seems like a totally reasonable strategy. It's certainly a reasonable model for the spec. I don't think there are any real-world custom element use cases here. |
Merged since as @Ms2ger indicated, this is more correct than the status quo. |
This definition is more correct right now, and using a getter rather than a
mutable field makes it easier to figure out what is returned.
CC whatwg/html#421.