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

Use HTML's 'document base URL' concept. #258

Merged
merged 1 commit into from
Jun 1, 2016
Merged

Conversation

Ms2ger
Copy link
Member

@Ms2ger Ms2ger commented May 31, 2016

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.

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>.
@annevk
Copy link
Member

annevk commented May 31, 2016

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?

@domenic
Copy link
Member

domenic commented May 31, 2016

Note that the conclusion of that thread was that the callback is only necessary for CSS; everything else is done lazily.

@annevk
Copy link
Member

annevk commented May 31, 2016

Also for custom elements that want that kind of behavior, no? Although I guess we could decide not to expose that primitive.

@domenic
Copy link
Member

domenic commented May 31, 2016

Yeah, I don't think it's a primitive really. Custom elements will probably want to do the same thing a and area do, and compute lazily. CSS could theoretically even be specced that way, although understandably implementations prefer a callback approach.

@annevk
Copy link
Member

annevk commented May 31, 2016

How can you compute this lazily? It's immediately visible.

@domenic
Copy link
Member

domenic commented May 31, 2016

When querying :visited, or when rendering, you figure out the resolved absolute URL.

@annevk
Copy link
Member

annevk commented May 31, 2016

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...

@domenic
Copy link
Member

domenic commented May 31, 2016

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.

@annevk annevk merged commit 60fac51 into whatwg:master Jun 1, 2016
@annevk
Copy link
Member

annevk commented Jun 1, 2016

Merged since as @Ms2ger indicated, this is more correct than the status quo.

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.

3 participants