-
Notifications
You must be signed in to change notification settings - Fork 132
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
Update SVGScriptElement and SVGImageElement to use src? #410
Comments
Just I think the analogy between SVG |
For <svg><image src="icon.png" xlink:href="icon.svg" width="16" height="16"/></svg> (An I personally think that adding It's possible that authors were using the same trick for |
@prlbr it doesn`t really matter if HTML or SVG does a better job; a lot more developers know HTML than SVG and so would be the most expected behaviour. The DOM would be consistent is we went with src but indeed the tag name would be different. If it is possible to use src then perhaps we could look at aliasing img/image like HTML does. @AmeliaBR that is unfortunate :( (another case of non-standard usage biting us). Do we have any data on if that technique is actually popular or if it is just a few early adopters? We can't use the normal detecting if SVGImageElement.src is in use cause that of course is not supported. ChromeStatus is broken for me right now (showing an empty list) and I don't recall if it shows Content attribute usage or just IDL attributes. Although it probably isn't measured anyway with it being non-standard usage. I have fallen for the lack of src on SVGScriptElement myself recently (I assumed that was why the test case template uses html:script rather than SVG scripts until I looked at the spec and saw the href mixin. It would be kind of weird to fix script but not image though. |
Not blocking updated 2.0 CR publication - assigning 2.0 Recommendation milestone to clean this up before 2.0 REC |
Is there any reason why when deprecating xlink, we didn't allow src to be used for images and script? Currently this is confusing that href is used in SVG and src is used in HTML.
Assuming there are no issues, we could add src to these two interfaces, deprecated href, and do the same as xlink:href and href, where (to borrow a CSS term) src is more specific than href and href is more specific than xlink:href.
This gets around the SVGAnimatedString mess for these two interfaces, and will be especially important if we ever want to adopt srcset in the future (using href as a fallback for srcset would be weird).
The text was updated successfully, but these errors were encountered: