Skip to content

label-content-name-mismatch should not treat SVG titles as visible text #4065

Description

@WilcoFiers

This should not fail axe-core's label-content-name-mismatch rule:

<a href="#" aria-label="Hello world">
  <svg width="14" height="14" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
    <title>Circle</title>
    <circle cx="50" cy="50" r="50" />
  </svg>
  Hello World
</a>

Axe considers the SVG title here to be part of the visible text, when it clearly isn't. This is because it calls subtreeText. I'm not sure whether the problem is that it calls subtreeText instead of something different, or that maybe subtreeText just shouldn't return SVG titles here.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions