-
Notifications
You must be signed in to change notification settings - Fork 131
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
Two questions about the <a>
element
#26
Comments
For 1., the HTML spec has an authoring requirement that |
Regarding the action, quick testing shows that in HTML the inner link is activated, so again I think we should just require that. |
Think I'm missing some terminology here. |
Activated as in when you click it it's that element's href that is navigated to. |
RESOLUTION: the content model of the a element in SVG will allow nested a elements
The plan is also to bring the other attributes onto the SVG a element. |
Looking again at @heycam's test. I'm assuming the reason the nested link is inserted by script is because the HTML 5 parser would treat this as an authoring error, and close off the outer link when you start the inner link. So I don't think that should really be used as an example of "it works in HTML, so it should work in SVG". That said, the HTML 5 parser is much less fussy once it gets to SVG, so if we say it is OK, it's OK. It is definitely useful to be able to define an image map with specific link regions as well as a generic "background" link. (Although that doesn't require nested links, it could be done simply with layering.) |
Test case for SVG links inside links: http://jsbin.com/nidixomute/1/edit?html,output Currently, Chrome and Safari do not render the content inside the nested link (the orange ellipse is visible, no blue link to the GitHub issue). Firefox, Edge, and Batik Squiggle render the blue ellipse and link it as specified by the nested Technically, Chrome & WebKit are correct by SVG 1.1: don't render SVG elements that are in places they don't belong, and don't put a link inside a link. However, given the lack of compatibility, I don't see a problem with making the Firefox/Edge/etc behavior correct for SVG 2. |
On adding attributes: the whole purpose is consistency with HTML, but we already have an existing inconsistency that Which means either I introduce the new properties in a way that's inconsistent with HTML (make them also animated string) or inconsistent with the existing properties). |
Important: The resolution above about "allowing nested links" was revised based on accessibility testing: Current advice (and SVG 2 spec) is that the nested link should render but would not be treated as an actual link. |
1. Are links allowed to be nested?
https://svgwg.org/svg2-draft/linking.html#Links
And then its content model description states it can contain
<a>
elements. Am I misunderstanding the spec? If the ability to nest links is being removed, why?2. Should the
<a>
element gain the additional attributes it has from HTML?In particular:
rel
has a very popular use with thenofollow
valuedownload
referrer
type
,hreflang
, andmedia
are rather useless, but leaving them out while allowing the above would be a bit inconsistent.The text was updated successfully, but these errors were encountered: