Re: [svg-aam] Implementation role mapping for SVG elements (#52)

Got some info from a Chrome graphics engineer with a11y background (who shall remain nameless)

Here is a quick dump on SVG to aria-graphics and IA2 mapping:
Based on the Chrome codebase, here is how Chrome currently maps the `<svg>` tag to the WAI-ARIA Graphics roles (`aria-graphics`) and IAccessible2 (IA2).

### 1. Mapping `<svg>` to `aria-graphics` Roles (Blink)
Chrome **does not** automatically map the `<svg>` tag to `graphics-document` (or any other ARIA graphics role), despite what the SVG-AAM specification might suggest.

If you look at `third_party/blink/renderer/modules/accessibility/ax_node_object.cc`, Chrome specifically diverges from the specification to avoid issues where screen readers ignore author-provided names:
```cpp
if (IsA<SVGSVGElement>(node)) {
  // Exposing a nested <svg> as a group (rather than a generic container)
  // increases the likelihood that an author-provided name will be presented
  // by assistive technologies. Note that this mapping is not yet in the
  // SVG-AAM, which currently maps all <svg> elements as graphics-document.
  // See https://github.com/w3c/svg-aam/issues/18.
  return GetLayoutObject()->IsSVGRoot() ? ax::mojom::blink::Role::kSvgRoot
                                        : ax::mojom::blink::Role::kGroup;
}
```
Instead of `graphics-document`, Chrome maps the `<svg>` tag to:
*   `ax::mojom::Role::kSvgRoot` (if it is the root SVG element)
*   `ax::mojom::Role::kGroup` (if it is a nested SVG element)

### 2. Mapping to IAccessible2 (IA2) on Windows
For Windows IA2 mappings, Chrome translates its internal accessibility roles to platform-specific APIs in `ui/accessibility/platform/ax_platform_node_win.cc`.

Because Chrome maps `<svg>` to `kSvgRoot` (rather than `kGraphicsDocument`), here is how the IA2 mapping is resolved:
*   **For `kSvgRoot`:** `ComputeIA2Role()` does not have an explicit `IA2_ROLE_` mapping for this internal role. Consequently, Chrome falls back to the underlying MSAA (Microsoft Active Accessibility) role, mapping it to **`ROLE_SYSTEM_GRAPHIC`**.
*   **For `kGroup`:** It falls back to the MSAA role **`ROLE_SYSTEM_GROUPING`**.

### What if a developer explicitly sets `role="graphics-document"`?
If an author explicitly adds `role="graphics-document"` to an `<svg>` tag in the HTML markup, Blink translates it to `ax::mojom::Role::kGraphicsDocument`.

On the IA2 platform side:
1.  **MSAA Role:** `kGraphicsDocument` maps to **`ROLE_SYSTEM_DOCUMENT`**.
2.  **IA2 Role:** There is no specific mapping in `ComputeIA2Role()`, so it also falls back to the MSAA role.
3.  **Object Attributes:** The IA2 API communicates the specific ARIA graphics role to assistive technologies via the **`xml-roles`** object attribute. Chrome's `AXPlatformNodeBase::ComputeAttributes` exposes the unmapped, raw string from the markup directly to IA2 as `xml-roles: graphics-document`.

-- 
GitHub Notification of comment by cyns
Please view or discuss this issue at https://github.com/w3c/svg-aam/issues/52#issuecomment-4172721212 using your GitHub account


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

Received on Wednesday, 1 April 2026 20:16:39 UTC