[svgwg] [svg2] Defs element, misleading wording regarding "accessibility" (#1007)

codewordcreative has just created a new issue for https://github.com/w3c/svgwg:

== [svg2] Defs element, misleading wording regarding "accessibility" ==
I was advised to raise this as an issue in here.

I believe there is an issue with the wording about the defs element in relation to accessibility and therefore implied necessity.

> 
> 5.4.2
> The ‘[defs](https://www.w3.org/TR/SVG2/struct.html#DefsElement)’ element is a container element for [referenced elements](https://www.w3.org/TR/SVG2/struct.html#Head). For understandability and [accessibility](https://www.w3.org/TR/SVG2/access.html) reasons, it is recommended that, whenever possible, referenced elements be defined inside of a ‘[defs](https://www.w3.org/TR/SVG2/struct.html#DefsElement)’.
> 

The reference to accessibility in the SVG spec is confusing/misleading. 

The def element may be helpful for maintainability or generally avoiding mistakes, but it doesn't actually improve accessibility in relation to reused elements. 

From a sustainability and efficiency perspective, I would argue that defs is often unnecessary - at least when the designer wishes to reuse an element that they do also want displayed in its original form. Elements can be reused just by assigning an ID to that path, shape, etc..

The wording recommends using defs for these reasons:

- understandability
Perhaps it is worth keeping in the non-live version, similar to non-minified and commented versions of code. But generally, this is bloat, and given how human-readable the SVG format already is, this seems pointless. This is generally bloat. Equally, if the original shape is never actually rendered exactly as it appears in defs, there is likely to be inherent inefficiency - the original should be adjusted to avoid applying potentially costly transforms on use. The understandability argument is weak.

- accessibility
As discussed, it feels like the word is being misused here - it has nothing to do with accessibility. Indeed, it may confuse people and lead them to not do the things that do influence accessibility, adding a pointless task that may push more essential tasks down the list. The accessibility argument appears to be entirely incorrect.

It seems it was on this basis that the spec recommends the use of the def element for reusable elements. I would argue it is an optional, occasionally helpful container element, but in many cases, it will be more efficient to not use it.


Please view or discuss this issue at https://github.com/w3c/svgwg/issues/1007 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 11 September 2025 20:55:39 UTC