Skip to content
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

SVG elements role treated differently by browsers #2288

Open
giacomo-petri opened this issue Feb 7, 2025 · 0 comments
Open

SVG elements role treated differently by browsers #2288

giacomo-petri opened this issue Feb 7, 2025 · 0 comments
Labels
accessibility support Accessibility support testing and tracking

Comments

@giacomo-petri
Copy link
Collaborator

giacomo-petri commented Feb 7, 2025

Accessibility support

I opened a PR to add an accessibility support note related to the fact that browsers are exposing SVG elements differently, causing accessibility issues:

svg elements expect an [implicit role][] of graphics-document per svg-aam. There are popular browsers that expose SVG elements with a different [semantic role][], such as image, generic or SvgRoot.

ACT Rules

Test cases

Test case 1

Focusable (non-nevative tabindex computed value) elements with presentational role

<svg height="100" width="100">
  <circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red"></circle>
</svg>
<svg height="130" width="500">
   <defs>
      <linearGradient id="grad1">
         <stop offset="0%" stop-color="yellow"></stop>
         <stop offset="100%" stop-color="red"></stop>
      </linearGradient>
   </defs>
   <ellipse cx="100" cy="70" rx="85" ry="55" fill="url(#grad1)"></ellipse>
   <text fill="#ffffff" font-size="45" font-family="Verdana" x="50" y="86">SVG</text>
</svg>
<svg>
  <symbol id="myDot" width="10" height="10" viewBox="0 0 2 2">
    <circle cx="1" cy="1" r="1"></circle>
  </symbol>
</svg>

Test instructions

  • Just run the test and check the element role

External links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility support Accessibility support testing and tracking
Projects
None yet
Development

No branches or pull requests

1 participant