Incorporate SVG `a` element in the processing model and algorithms of HTML `a` element
What is the issue with the HTML Standard?
As per the resolution in SVGWG issue Specifying processing model and algorithm for ping and referrerPolicy in SVG a element the hyperlink processing model and algorithms defined in HTML specification should also apply to the SVG a element.
We would like to request feedback from HTML experts on the following:
- Is it appropriate to extend the existing hyperlink processing model to cover SVG
aelements, given their functional parity with the HTMLaelement? - If so, can the https://html.spec.whatwg.org/multipage/links.html#following-hyperlinks-2 be updated to explicitly include SVG
aelement?
This change would help ensure consistent behavior across HTML and SVG documents.
Doing this seems reasonable, but it's probably a bit more involved than that. You need to check for all references to the a element and see if they need adjusting to also account for SVG a.
Got it, I created the HTML issue for starting purposes I will compile the list of references in the HTML spec where such update is required as well. Thanks for the suggestion!
My suggestion for the update: Because of common functionality between HTML A element and SVG A element, any references of a tag should be upated to be explicitly written as HTML a and a reference of SVG a should be added accordingly along with it.
Below are the references in https://html.spec.whatwg.org/multipage/links.html which I found needs to be updated as per my above suggestion.
Section wise links:
https://html.spec.whatwg.org/multipage/links.html#introduction-2 - 2 references needs to be updated
https://html.spec.whatwg.org/multipage/links.html#links-created-by-a-and-area-elements - Title needs to be updated along
with 8 references
https://html.spec.whatwg.org/multipage/links.html#api-for-a-and-area-elements - Title needs to be updated
along with 3 references
https://html.spec.whatwg.org/multipage/links.html#following-hyperlinks - 4 references needs to be updated
https://html.spec.whatwg.org/multipage/links.html#downloading-resources - 2 references needs to be updated
https://html.spec.whatwg.org/multipage/links.html#hyperlink-auditing - 2 references needs to be updated
-
https://html.spec.whatwg.org/multipage/links.html#linkTypes - 1 reference along with a table column heading
https://html.spec.whatwg.org/multipage/links.html#rel-alternate - 1 reference
https://html.spec.whatwg.org/multipage/links.html#link-type-author - 3 references
https://html.spec.whatwg.org/multipage/links.html#link-type-bookmark - 1 reference
https://html.spec.whatwg.org/multipage/links.html#link-type-external - 1 reference
https://html.spec.whatwg.org/multipage/links.html#link-type-help - 3 reference
https://html.spec.whatwg.org/multipage/links.html#link-type-license - 1 reference
https://html.spec.whatwg.org/multipage/links.html#link-type-nofollow - 1 reference
https://html.spec.whatwg.org/multipage/links.html#link-type-noopener - 1 reference
https://html.spec.whatwg.org/multipage/links.html#link-type-noreferrer - 1 reference
https://html.spec.whatwg.org/multipage/links.html#link-type-opener - 1 reference
https://html.spec.whatwg.org/multipage/links.html#link-type-privacy-policy - 1 reference
https://html.spec.whatwg.org/multipage/links.html#link-type-search - 1 reference
https://html.spec.whatwg.org/multipage/links.html#link-type-tag - 1 reference
https://html.spec.whatwg.org/multipage/links.html#link-type-terms-of-service - 1 reference
https://html.spec.whatwg.org/multipage/links.html#link-type-next - 1 reference
https://html.spec.whatwg.org/multipage/links.html#link-type-prev - 1 reference
https://html.spec.whatwg.org/multipage/links.html#other-link-types - 6 references
Per https://github.com/w3c/mathml-core/issues/142 MathML will likely also get an element with the same functionality as HTML a.
HTML also has area which can be a hyperlink.
I think the right approach is not for HTML to mention SVG a and MathML a, but to create hooks so that SVG and MathML can easily specify that a particular element type supports the same features and has the same processing as HTML hyperlinks.
HTML already has some attributes that are common among multiple HTML elements, for example https://html.spec.whatwg.org/#cors-settings-attributes and the next few subsections.
I suppose we could have an "hyperlink element" concept and make HTML a and area elements use that. If we need a lot of type-specific branching that might get cumbersome though.
Given that there are other hyperlinks like MathML which may require the same behaviour I agree with @zcorpan that hooks for SVG and MathML might be better here (plus it can be extensible in the future if required)
@annevk "hyperlink element" concept is a good idea! will this concept include SVG a and MathML a element as well? in which spec should we include this concept?
I think it's appropriate to keep it in HTML.
should I open a draft PR for this and see what changes we will require?
Sure. Thank you!
I am thinking of Hyperlink element definition as below:
An element is a Hyperlink element if it follows the HTML processing model and its specification explicitly declares that it supports the Hyperlink element concept.
a and area are Hyperlink elements
@zcorpan I had a small question I tried making the change in https://github.com/whatwg/html/blob/main/review-drafts/2025-07.wattsi but I am not sure if that's the correct location to add such concept.
Can you point me to the correct repo for raising the PR?
One thing to be aware of is that the href value for an SVG element behaves differently to that of an html a, area and future MathML a. So we shouldn't reference the attribute too much (have a concept that is equivalent to its value and then SVG can set that concept slightly differently)
@goldenboy777 this is the correct repo, but the correct file is source