- Button
- syntax:
button
or[role=button tabindex=0]
- syntax:
- Toggle Button
- syntax: Button +
[aria-pressed]
- syntax: Button +
- Menu button
- syntax: Button +
[aria-haspopup=true aria-expanded aria-controls]
- ref: https://www.w3.org/TR/wai-aria-practices-1.1/#menubutton
- syntax: Button +
- Menu
- syntax:
nav>ul[role=menubar aria-activedescendant]>(li[role=presentation aria-selected=true]>a[role=menuitem]+ul[role=menu hidden])
- todo: check above code
- ref: https://stackoverflow.com/a/12279190 & https://www.w3.org/TR/wai-aria-practices/#menu
- syntax:
- Inline SVG
- syntax:
svg[role=presentation]>g[role=img aria-label]
- syntax:
- Details element
- syntax:
details>summary[role=button tabindex=0 aria-controls=content]{title}+#content[hidden=""]{content}
- syntax:
Last active
September 5, 2017 18:29
-
-
Save lemnis/f5ef0d7bb5a01349d4c2320e615df34b to your computer and use it in GitHub Desktop.
Personal reference for accessible markup
<details><summary>Test</summary>content</details>
Safari 10 + VoiceOver | Firefox 55 + VoiceOver | Chrome 62 + VoiceOver | Chrome 62 + ChromeVox 53 | |
---|---|---|---|---|
Spoken output | Test, collapsed, summary | Test | Test, collapsed, disclosure triangle | Test (next) content |
Title / Name | Test | Test | Test | Test |
Label | ||||
Type / Role | summary | group | discolusre triangle | DisclosureTriangle |
API | Role: AXButton Subrole: AXSummary Expanded: false |
Role: AXButton Subrole: AXSummary |
Role: AXButton | Expanded: false |
<details open><summary>Test</summary>content</details>
Safari 10 + VoiceOver | Firefox 55 + VoiceOver | Chrome 62 + VoiceOver | Chrome 62 + ChromeVox 53 | |
---|---|---|---|---|
Spoken output | Test, expanded, summary (next) content | Test (next) content | Test, expanded, disclosure triangle (next) content | Test (next) content |
Title / Name | Test | Test | Test | Test (next) content |
Label | ||||
Type / Role | summary | group | disclosure triangle | DisclosureTriangle |
API | Role: AXButton Subrole: AXSummary Expanded: true |
Role: AXButton Subrole: AXSummary |
Role: AXButton | Expanded: true |
<details open>content</details>
Safari 10 + VoiceOver | Firefox 55 + VoiceOver | Chrome 62 + VoiceOver | Chrome 62 + ChromeVox 53 | |
---|---|---|---|---|
Spoken output | Details, expanded, summary | content (next) details | Details, disclosure triangle (next) content | Content |
Title / Name | Details | Details | ||
Label | ||||
Type / Role | summary | group | disclosure triangle | Details |
API | Role: AXButton Subrole: AXSummary Expanded: true |
Role: AXButton Subrole: AXSummary |
Role: AXButton |
Is shown / pronounced? 1st = screen, 2nd = screen reader
Code | Safari 10 | Firefox 55 | Chrome 62 |
---|---|---|---|
<div hidden> Test </div> |
✗ ✗ | ✗ ✗ | ✗ ✗ |
<div style=" display:none; "> Test </div> |
✗ ✗ | ✗ ✗ | ✗ ✗ |
<div style=" visibility:hidden; "> Test </div> |
✗ ✗ | ✗ ✗ | ✗ ✗ |
<div aria-hidden="true"> Test </div> |
✓ ✗ | ✓ ✓ | ✓ ✗ |
<div style="width:0; height: 0; overflow:hidden;"> Test </div> |
✗ ✓ | ✗ ✓ | ✗ ✓ |
<div style=" text-indent:-1000px; "> Test </div> |
✗ ✓ | ✗ ✓ | ✗ ✓ |
<div style=" clip: rect(1px, 1px, 1px, 1px); position: absolute;"> Test </div> |
✗ ✓ | ✗ ✓ | ✗ ✓ |
<div style=" position: absolute; left: -999px"> Test </div> |
✗ ✓ | ✗ ✓ | ✗ ✓ |
ref: https://www.paciellogroup.com/blog/2013/12/using-aria-enhance-svg-accessibility/
<svg role="img"><title>Test</title>...</svg>
Safari 10 + VoiceOver | Firefox 55 + VoiceOver | Chrome 62 + VoiceOver | Chrome 62 + ChromeVox 53 | |
---|---|---|---|---|
Spoken output | Test group | Test, image | Test, image | image |
Title / Name | Test | Test | Test | Test |
Label | ||||
Type / Role | group | image | image | img |
Value / Pressed | ||||
API | Role: AXGroup | Role: AXImage | Role: AXImage | Labeled by: title |
<svg role="img" aria-label="Test">...</svg>
Safari 10 + VoiceOver | Firefox 55 + VoiceOver | Chrome 62 + VoiceOver | Chrome 62 + ChromeVox 53 | |
---|---|---|---|---|
Spoken output | Test group | Test, image | Test, image | Test, image |
Title / Name | Test | Test | ||
Label | Test | Test | ||
Type / Role | group | image | image | img |
Value / Pressed | ||||
API | Role: AXGroup | Role: AXImage | Role: AXImage | aria-label: "Test" |
Note: ChromeVox currently doesn't pronounce <title>
or aria-labelby
while it's visible witin the automation API
<svg role="presentation"><g role="img" aria-label="Test">...</g></svg>
Safari 10 + VoiceOver | Firefox 55 + VoiceOver | Chrome 62 + VoiceOver | Chrome 62 + ChromeVox 53 | |
---|---|---|---|---|
Spoken output | Test, image | Test, image | Test, image | Test, image |
Title / Name | Test | Test | ||
Label | Test | Test | ||
Type / Role | image | image | image | img |
Value / Pressed | ||||
API | Role: AXImage | Role: AXImage | Role: AXImage | aria-label: "Test" |
Note: Adds Safari support, but the SVG can't have title
element as direct child
<svg role="presentation">
<use role="img" xlink:href="#r" />
</svg>
<svg>
<symbol id="r">
<title>Test</title>
...
</symbol>
</svg>
Safari 10 + VoiceOver | Firefox 55 + VoiceOver | Chrome 62 + VoiceOver | Chrome 62 + ChromeVox 53 | |
---|---|---|---|---|
Spoken output | Test, image | image | image | image |
Title / Name | ||||
Label | Test | |||
Type / Role | image | image | image | img |
Value / Pressed | ||||
API | Role: AXImage | Role: AXImage | Role: AXImage |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment