Skip to content

Validator failing when both "graphics-document" and "document" specified in SVG role #1987

@KDean-Dolphin

Description

@KDean-Dolphin

Summary

The validator is failing on an SVG tag like this:

<svg id="export-svg" width="100%" xmlns="http://www.w3.org/2000/svg" class="flowchart" style="max-width: 348.390625px; background: rgb(255, 255, 255);" viewBox="0 0 348.390625 491.765625" role="graphics-document document" aria-roledescription="flowchart-v2">...</svg>

The problem is the "role" attribute. The message coming back is:

error: Bad value “graphics-document document” for attribute “role” on element “svg”.

The "graphics-document" role is specified in WAI-ARIA Graphics Module, and the "role" attribute allows for multiple roles to be specified. You can see an example in the WAI-ARIA document itself in the linked section.

URL for document that reproduces the problem

n/a

HTML/CSS/SVG snippet that reproduces the problem

<svg id="export-svg" width="100%" xmlns="http://www.w3.org/2000/svg" class="flowchart" style="max-width: 348.390625px; background: rgb(255, 255, 255);" viewBox="0 0 348.390625 491.765625" role="graphics-document document" aria-roledescription="flowchart-v2">...</svg>

Checker error messages

error: Bad value “graphics-document document” for attribute “role” on element “svg”.

Spec links/citations

https://www.w3.org/TR/graphics-aria-1.0/#role_definitions

Steps to reproduce

Expected behavior

SVG passes cleanly.

Actual behavior

Error message.

Screenshots or screen recordings

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions