-
Notifications
You must be signed in to change notification settings - Fork 79
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
baseURI
should be factored into HTMLAnchorElement.href
#153
Comments
baseURI
should be factored into HTMLAnchorElement.hrefbaseURI
should be factored into HTMLAnchorElement.href
I guess it should also be removed if added as part of the href, right? |
At first sight, I would say |
One thing I can't figure out is that even though
Update: The definition for reflecting an attribute says:
So I guess this applies at least to:
|
In general, it seems like for reflecting content attributes we know to be URLs, it would be useful to implement a new attribute helper, something like: export const urlAttribute = {
get(element, name) {
let attr = element.getAttribute(name);
if (attr) {
try {
return new URL(attr, element.baseURI).href;
} catch (err) {
return attr;
}
}
return '';
},
set(element, name, value) {
element.setAttribute(name, value);
}
}; For That being said, I see no harm in supporting just |
Adding here as to not lose the conclusion in the PR discussion: Fixing URL-related IDL properties means including an evaluation of the document's If anyone wants to evaluate the performance story, I consider the PR to be otherwise in a good state. |
Node.baseURI
should be used when getting theHTMLAnchorElement.href
property. (It maybe needed for other properties as well, will add them here once I investigate.)The text was updated successfully, but these errors were encountered: