From 97f66357d044bdf371f3d565a0338e21e1acb4d2 Mon Sep 17 00:00:00 2001 From: Giacomo Petri Date: Fri, 7 Feb 2025 14:19:41 +0100 Subject: [PATCH 1/5] Add accessibility support note to cover SVG elements role inconsistently exposed --- .../image-non-empty-accessible-name-23a2a8.md | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/_rules/image-non-empty-accessible-name-23a2a8.md b/_rules/image-non-empty-accessible-name-23a2a8.md index 7157699d317..7c3df480645 100755 --- a/_rules/image-non-empty-accessible-name-23a2a8.md +++ b/_rules/image-non-empty-accessible-name-23a2a8.md @@ -58,6 +58,7 @@ There are no assumptions. - There are several popular browsers that do not treat images with an empty `alt` attribute (`alt=""`) as having a role of `presentation` but instead add the `img` element to the accessibility tree with a [semantic role][] of either `img` or `graphic`. - Implementation of [Presentational Roles Conflict Resolution][] varies from one browser or assistive technology to another. Depending on this, some [semantic][semantic role] `img` elements can fail this rule with some technology but users of other technologies would not experience any accessibility issue. - Images can have their role set to `presentation` through an empty `alt` attribute. [Presentational Roles Conflict Resolution][] does not specify what to do if such an image is [focusable][] (it only specifies what to do in case of explicit `role="none"` or `role="presentation"`). Some browsers expose these images and some don't. Thus, this rule may fail for technologies that expose these without creating an accessibility issue for users of other technologies. +- `svg` elements expect an [implicit role][] of `graphics-document` per [svg-aam](https://www.w3.org/TR/svg-aam-1.0/). There are popular browsers that expose SVG elements with a different [semantic role][], such as `image`, `generic` or `SvgRoot`. ### Bibliography @@ -196,16 +197,6 @@ This `img` element has an [explicit role][] of `none`. However, it is [focusable #### Inapplicable Example 1 -This `svg` element has an [implicit role][] of `graphics-document`. - -```html - - - -``` - -#### Inapplicable Example 2 - This [semantic][semantic role] `img` element is hidden with `aria-hidden` set to "true". ```html @@ -216,7 +207,7 @@ This [semantic][semantic role] `img` element is hidden with `aria-hidden` set to > ``` -#### Inapplicable Example 3 +#### Inapplicable Example 2 This `img` element is hidden with `aria-hidden` set to "true". @@ -224,7 +215,7 @@ This `img` element is hidden with `aria-hidden` set to "true". ``` -#### Inapplicable Example 4 +#### Inapplicable Example 3 This `img` element is hidden because its parent has `display: none`. @@ -234,7 +225,7 @@ This `img` element is hidden because its parent has `display: none`. ``` -#### Inapplicable Example 5 +#### Inapplicable Example 4 This `img` element is hidden with `visibility: hidden`. From d617f68b442509c1eca81042d552120dec297d0a Mon Sep 17 00:00:00 2001 From: Giacomo Petri Date: Fri, 7 Feb 2025 16:08:40 +0100 Subject: [PATCH 2/5] Update _rules/image-non-empty-accessible-name-23a2a8.md Co-authored-by: Kevin White --- _rules/image-non-empty-accessible-name-23a2a8.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_rules/image-non-empty-accessible-name-23a2a8.md b/_rules/image-non-empty-accessible-name-23a2a8.md index 7c3df480645..09b20280821 100755 --- a/_rules/image-non-empty-accessible-name-23a2a8.md +++ b/_rules/image-non-empty-accessible-name-23a2a8.md @@ -58,7 +58,7 @@ There are no assumptions. - There are several popular browsers that do not treat images with an empty `alt` attribute (`alt=""`) as having a role of `presentation` but instead add the `img` element to the accessibility tree with a [semantic role][] of either `img` or `graphic`. - Implementation of [Presentational Roles Conflict Resolution][] varies from one browser or assistive technology to another. Depending on this, some [semantic][semantic role] `img` elements can fail this rule with some technology but users of other technologies would not experience any accessibility issue. - Images can have their role set to `presentation` through an empty `alt` attribute. [Presentational Roles Conflict Resolution][] does not specify what to do if such an image is [focusable][] (it only specifies what to do in case of explicit `role="none"` or `role="presentation"`). Some browsers expose these images and some don't. Thus, this rule may fail for technologies that expose these without creating an accessibility issue for users of other technologies. -- `svg` elements expect an [implicit role][] of `graphics-document` per [svg-aam](https://www.w3.org/TR/svg-aam-1.0/). There are popular browsers that expose SVG elements with a different [semantic role][], such as `image`, `generic` or `SvgRoot`. +- `svg` elements expect an [implicit role][] of `graphics-document` per [svg-aam](https://www.w3.org/TR/svg-aam-1.0/#details-id-66). There are popular browsers that expose SVG elements with a different [semantic role][], such as `image`, `generic` or `SvgRoot`. ### Bibliography From 9b016aeb7b2a8cf67df4116b97b9e9375823bc42 Mon Sep 17 00:00:00 2001 From: Giacomo Petri Date: Fri, 7 Feb 2025 16:26:05 +0100 Subject: [PATCH 3/5] added SvgRoot term --- __tests__/spelling-ignore.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/__tests__/spelling-ignore.yml b/__tests__/spelling-ignore.yml index 5fe2885729f..106dbb404b5 100644 --- a/__tests__/spelling-ignore.yml +++ b/__tests__/spelling-ignore.yml @@ -295,3 +295,6 @@ - A-lum-min - B-lum-max - B-lum-min + +#Browsers Internal Roles +- SvgRoot From e36bdc5e5b6e045aa8522a33216ab89fb25105f6 Mon Sep 17 00:00:00 2001 From: Giacomo Petri Date: Thu, 13 Feb 2025 17:38:14 +0100 Subject: [PATCH 4/5] Apply suggestions from code review --- _rules/image-non-empty-accessible-name-23a2a8.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_rules/image-non-empty-accessible-name-23a2a8.md b/_rules/image-non-empty-accessible-name-23a2a8.md index 09b20280821..659b8c47de2 100755 --- a/_rules/image-non-empty-accessible-name-23a2a8.md +++ b/_rules/image-non-empty-accessible-name-23a2a8.md @@ -58,7 +58,7 @@ There are no assumptions. - There are several popular browsers that do not treat images with an empty `alt` attribute (`alt=""`) as having a role of `presentation` but instead add the `img` element to the accessibility tree with a [semantic role][] of either `img` or `graphic`. - Implementation of [Presentational Roles Conflict Resolution][] varies from one browser or assistive technology to another. Depending on this, some [semantic][semantic role] `img` elements can fail this rule with some technology but users of other technologies would not experience any accessibility issue. - Images can have their role set to `presentation` through an empty `alt` attribute. [Presentational Roles Conflict Resolution][] does not specify what to do if such an image is [focusable][] (it only specifies what to do in case of explicit `role="none"` or `role="presentation"`). Some browsers expose these images and some don't. Thus, this rule may fail for technologies that expose these without creating an accessibility issue for users of other technologies. -- `svg` elements expect an [implicit role][] of `graphics-document` per [svg-aam](https://www.w3.org/TR/svg-aam-1.0/#details-id-66). There are popular browsers that expose SVG elements with a different [semantic role][], such as `image`, `generic` or `SvgRoot`. +- `svg` elements expect an [implicit role][] of `graphics-document` per [svg-aam](https://www.w3.org/TR/svg-aam-1.0/#details-id-66). There are popular browsers that do not follow [svg-aam](https://www.w3.org/TR/svg-aam-1.0/#details-id-66) and instead expose SVG elements with a different [semantic role][], such as `image`, `generic` or `SvgRoot`. ### Bibliography From cadc07d09f4c535de37425eef6b09b8d2165b525 Mon Sep 17 00:00:00 2001 From: Giacomo Petri Date: Thu, 13 Feb 2025 17:40:39 +0100 Subject: [PATCH 5/5] Update _rules/image-non-empty-accessible-name-23a2a8.md --- _rules/image-non-empty-accessible-name-23a2a8.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_rules/image-non-empty-accessible-name-23a2a8.md b/_rules/image-non-empty-accessible-name-23a2a8.md index 659b8c47de2..807492b6b68 100755 --- a/_rules/image-non-empty-accessible-name-23a2a8.md +++ b/_rules/image-non-empty-accessible-name-23a2a8.md @@ -58,7 +58,7 @@ There are no assumptions. - There are several popular browsers that do not treat images with an empty `alt` attribute (`alt=""`) as having a role of `presentation` but instead add the `img` element to the accessibility tree with a [semantic role][] of either `img` or `graphic`. - Implementation of [Presentational Roles Conflict Resolution][] varies from one browser or assistive technology to another. Depending on this, some [semantic][semantic role] `img` elements can fail this rule with some technology but users of other technologies would not experience any accessibility issue. - Images can have their role set to `presentation` through an empty `alt` attribute. [Presentational Roles Conflict Resolution][] does not specify what to do if such an image is [focusable][] (it only specifies what to do in case of explicit `role="none"` or `role="presentation"`). Some browsers expose these images and some don't. Thus, this rule may fail for technologies that expose these without creating an accessibility issue for users of other technologies. -- `svg` elements expect an [implicit role][] of `graphics-document` per [svg-aam](https://www.w3.org/TR/svg-aam-1.0/#details-id-66). There are popular browsers that do not follow [svg-aam](https://www.w3.org/TR/svg-aam-1.0/#details-id-66) and instead expose SVG elements with a different [semantic role][], such as `image`, `generic` or `SvgRoot`. +- `svg` elements have an [implicit role][] of `graphics-document` in [svg-aam](https://www.w3.org/TR/svg-aam-1.0/#details-id-66). There are popular browsers that do not follow [svg-aam](https://www.w3.org/TR/svg-aam-1.0/#details-id-66) and instead expose SVG elements with a different [semantic role][], such as `image`, `generic` or `SvgRoot`. ### Bibliography