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

Reflecting as URL and failing to resolve #561

Closed
zcorpan opened this issue Jan 26, 2016 · 4 comments
Closed

Reflecting as URL and failing to resolve #561

zcorpan opened this issue Jan 26, 2016 · 4 comments
Assignees

Comments

@zcorpan
Copy link
Member

zcorpan commented Jan 26, 2016

https://html.spec.whatwg.org/#reflecting-content-attributes-in-idl-attributes

If a reflecting IDL attribute is a DOMString attribute whose content attribute is defined to contain a URL, then on getting, the IDL attribute must resolve the value of the content attribute relative to the element and return the resulting absolute URL if that was successful, or the empty string otherwise

I'm not sure empty string is right. For a.href it returns the attribute's value instead:

https://html.spec.whatwg.org/multipage/semantics.html#dom-hyperlink-href

Also related is base href https://html.spec.whatwg.org/multipage/semantics.html#dom-base-href

http://software.hixie.ch/utilities/js/live-dom-viewer/saved/3843 - Gecko returns the attribute's value for both img src and base href.

I suggest we switch to that so it's consistent with a href.

cc @Ms2ger

@foolip
Copy link
Member

foolip commented Jan 27, 2016

For http://software.hixie.ch/utilities/js/live-dom-viewer/saved/3843 IE logs "http://[/" twice. It looks like interop for invalid URLs in base.href is as bad as it can be, so changing it should be low risk.

@zcorpan zcorpan self-assigned this Jan 27, 2016
@zcorpan
Copy link
Member Author

zcorpan commented Mar 11, 2016

The IDL attributes that reflect as a URL are:

base href
link href
blockquote cite
a href
ins cite
del cite
img src
iframe src
embed src
object data
video poster
source src
track src
video src
area href
input src
form action
button formAction
input formAction
script src
applet object
frame src
frame longDesc
iframe longDesc
img longDesc
img lowsrc
object codeBase

(This would be easier to find and be confident about being correct if reflecting was using IDL syntax instead...)

@zcorpan
Copy link
Member Author

zcorpan commented Mar 14, 2016

a href and area href don't use "reflect"; https://html.spec.whatwg.org/#dom-hyperlink-href

@zcorpan
Copy link
Member Author

zcorpan commented Mar 14, 2016

Value is "x" http://software.hixie.ch/utilities/js/live-dom-viewer/saved/3995
Value is "//[" http://software.hixie.ch/utilities/js/live-dom-viewer/saved/3996
Attribute absent http://software.hixie.ch/utilities/js/live-dom-viewer/saved/3997

zcorpan added a commit that referenced this issue Mar 14, 2016
When an attribute that reflects as a URL fails to parse, the IDL
attribute should return the content attribute's value. This matches
the HTMLHyperlinkElement#href getter behavior.
zcorpan added a commit that referenced this issue Mar 14, 2016
When an attribute that reflects as a URL fails to parse, the IDL
attribute should return the content attribute's value. Also do this
for HTMLBaseElement#href getter. This matches the
HTMLHyperlinkElement#href getter behavior.
@annevk annevk closed this as completed in f9567cd Mar 15, 2016
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