Re: Comments on SVG Accessibility Mappings -- Default and Allowed Semantics

Thanks for the feedback Richard,

One question on the following:

>   * Default role none/presentation, no role may be applied.
> >   * However, it should be clear that authors are still allowed to
> > give these elements *other* accessibility attributes and child
> > content, in order to reference it through another element's `aria-
> > labelledby` or `aria-describedby` properties.  For example, if
> > colored gradients (or `<solidColor>` elements) are used to
> > categorize content on a map or chart, the author could add `<desc>`
> > elements to each gradient, explaining its semantic meaning.  Then,
> > whenever a shape is set to use that gradient as a fill, the author
> > could also set it to point to that element as `aria-describedby`.
> > Similarly, when an animation is triggered, that animation's label or
> > description could be added to the description of the target element.
> >  (Note: might need to clarify the accessible name/description
> > computation to ensure that this works!)
> If a role is none there is nothing to map. Perhaps that needs to be made
> clearer. If there is no role there is no accessible object. We need to
> discuss this more.
> If you want these to map we need to know what they are mapped to. Would it
> be group?

Can't an element that *isn't* in the accessibility tree (i.e., an element
with default role of none/presentation) still be used for
describedby/labelledby of another element?  That's what I was suggesting

Here are a couple simple-yet-realistic examples, and how I *think* they
would be processed.

Example 1, annotating the descriptive meaning of a paint server or other
graphical effect:

<svg viewBox="0 0 100 100" >
   <title>Connection Quality</title>
   <radialGradient id="flame" fy="70%">
      <desc>Highlighting to indicate danger state.</desc>
      <stop stop-color="red" offset="0" />
      <stop stop-color="yellow" offset="1" />

  <polygon points="0 100, 50 0, 100 100"
           aria-describedby="flame" >
     <title>Current Status</title>


Live example:

   - The accessibility tree would have two objects: the SVG and the polygon
   as a child.
   - The SVG's accessible name would be calculated from its <title> since
   there are no other ARIA attributes.  It would be identified as "Connection
   Quality graphic" (or "Connection Quality group" for now)
   - Similarly, the polygon's accessible name would be "Current Status
   shape" or "Current Status group".
   - For the polygon's description, following the computation
   modified for SVG
      - Start with the polygon itself.  It's not hidden, so step A is
      - For step B, process the ID tokens in the aria-describedby attribute.
      There's only one, and it points to radialGradient#flame.
      - The radialGradient node therefore becomes the current node for
      processing, restarting at step A.  Because it *was* referenced from
      aria-describedby, the fact that it is hidden (never displayed
      directly) doesn't have an effect.
      - The radialGradient doesn't have aria attributes, so steps B and C
      are skipped.
      - From step D, the content of the <desc> element gets used as the
      accessible text alternative for the radialGradient.
      - This description is therefore returned as the accessible
      description for the polygon as well.

Example 2, changing the name of an object when it is animated.  A little
more complex, and this time with full XML markup:

<svg viewBox="0 0 100 100"


  <title>Roll that Ball</title>

  <a id="go" xlink:href="#move"

     aria:aria-controls="b" >

    <text x="50%" dy="1em" text-anchor="middle"
          aria:role="none presentation">Go!</text>

  <circle id="b" r="5" fill="red"


  <animateMotion id="move" xlink:href="#b"
       begin="indefinite" dur="10s"
       path="M10,10 L10,90 90,90 90,10 Z" >

    <title>rolling around the edges of the canvas</title>


  <set xlink:href="#b"
       to="b move"
       begin="move.begin" end="move.end"
  <set xlink:href="#b"
       begin="move.begin" end="move.end"

Live example:

   - The accessibility tree again only represents perceivable objects:
   - svg
         - a
         - circle

         - The SVG gets its label from the <title>, nothing new there.

   - The link is recognized as a button because of the role attribute.  It
   has no label/description accessibility attributes, so it's name is derived
   from its contents, as "Go! Button".  The effect of using the button is
   suggested by the aria-controls attribute.

   - The text element has been explicitly excluded from the accessibility
   tree with an ARIA role of none, so its content is only used to generate the
   name of the link-as-button.

   - The circle element has an aria-label attribute, so it's accessible
   name is initially "Ball group" (or "Ball shape" or "Ball graphic" once more
   specific role names are available).  It also has an aria-live attribute,
   to indicate that its properties may be changed.

   - When you activate the link, it targets the main animation, which
   causes that animation to begin.

   - For the exact duration of the main animation, two other changes are
   made to the circle: a stroke change, which doesn't affect accessibility
   calculations, and a change to the aria-labelledby attribute.
    (Unfortunately, this doesn't currently work; with or without the explicit
   XML namespaces, in HTML 5 or pure SVG, neither Chrome nor Firefox apply SVG
   animation to attributes they don't recognize.)

   - If the aria-labelledby attribute was correctly updated by the <set>
   element, it would become a list of two ID tokens: "b move".  The two
   tokens are required because aria-labelledby takes precedence over

   - With the new attribute, the accessible name for the circle is
   calculated from the accessible names of the two referenced elements,
   concatenated together:
      - The first ID token (b) just refers back to the circle itself.  On a
      recursive reference like this, the aria-labelledby is ignored and the
      aria-label ("Ball") is used instead.
      - The second token (move) refers to the main animation element.  It's
      label is generated from its <title>, so that "rolling around the
      edges of the canvas" is appended to circle's computed label.
      - The resulting name for the circle, while the animation is in
      effect, is therefore "Ball rolling around the edges of the
canvas graphic".

Please let me know if I've missed or confused any important details in
either of those examples!

Received on Wednesday, 21 January 2015 21:59:46 UTC