Skip to content

Conversation

@tcl3
Copy link
Member

@tcl3 tcl3 commented Jan 12, 2026

This makes navigation work when clicking on SVG <a> elements.

I had to move follow_the_hyperlink() and other hyperlink navigation logic from HTMLHyperlinkElementUtils to DOM::Element so that it could be shared by HTMLAnchorElement and SVGAElement. SVGAElement is supposed to implement HTMLHyperlinkElementUtils but can't as it stands because both HTMLHyperlinkElementUtils and SVGURIReference have a href() method that causes a naming conflict. See w3c/svgwg#312 for further details.

We also gain ~300 WPT subtests in the referrer-policy directory.

Closes: #6781

These could all be implemented in terms of
`hyperlink_element_utils_element()`.
@tcl3 tcl3 force-pushed the libweb_svg_a_element_activation_behavior branch from 0ee6b21 to 8382efa Compare January 12, 2026 20:48
tcl3 added 2 commits January 12, 2026 20:51
Previously we were using the IDL attribute value, which didn't follow
the specification.
This allows us to use these methods from `SVGAElement` without
inheriting  `HTMLHyperlinkElementUtils`, which we can't do for
`SVGAElement` due to a naming conflict with the `href()` method in
`SVGURIReferenceMixin`.
@tcl3 tcl3 force-pushed the libweb_svg_a_element_activation_behavior branch from 8382efa to a0980bb Compare January 12, 2026 20:51
This makes navigation work when clicking on SVG `<a>` elements.
@tcl3 tcl3 force-pushed the libweb_svg_a_element_activation_behavior branch from a0980bb to 8e0ecb0 Compare January 12, 2026 21:02
This aligns step 2 of `get_an_elements_target()` with the specification.
@tcl3
Copy link
Member Author

tcl3 commented Jan 12, 2026

Closes #6781.

I wasn't aware of this issue until now 😅.

@shannonbooth
Copy link
Member

Probably we will end up moving things around again if whatwg/html#12066 completes 😅

@gmta gmta merged commit a34c51a into LadybirdBrowser:master Jan 13, 2026
10 of 12 checks passed
@tcl3 tcl3 deleted the libweb_svg_a_element_activation_behavior branch January 13, 2026 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LibWeb: Support clickable <a> tags in SVGs

3 participants