From cbecff24c84253751cd94a20fc1101db342a21da Mon Sep 17 00:00:00 2001 From: Scott O'Hara Date: Fri, 14 Feb 2020 23:39:48 -0500 Subject: [PATCH] limit the allowed roles on img elements closes #166 this PR does the following: * limits the allowed roles on an `img` with `alt=some_text`. * limits the disallows roles, or limits the allowed roles on an `img` without an `alt` attribute based on whether it is provided an accessible name via other means. --- index.html | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index f77e751a..27654426 100644 --- a/index.html +++ b/index.html @@ -1108,7 +1108,7 @@

- img with img with alt="some text" @@ -1116,9 +1116,21 @@

- Any `role` except - `none` - or `presentation`. + Roles: + `button`, + `checkbox`, + `link`, + `menuitem`, + `menuitemcheckbox`, + `menuitemradio`, + `option`, + `progressbar`, + `scrollbar`, + `separator`, + `slider`, + `switch`, + `tab` or + `treeitem`

Global `aria-*` attributes and @@ -1129,7 +1141,7 @@

- img with img with alt="" @@ -1149,19 +1161,18 @@

- img with no alt="" + img without alt attribute role=img

- Any `role` + If not provided an author defined accessible name by other methods: No `role`, and no `aria-*` attributes except + `aria-hidden`.

- Global `aria-*` attributes and - any `aria-*` attributes applicable to the allowed roles and - implied role (if any). + Otherwise, if the `img` has an author defined accessible name, see `img alt="some text"`.