From 766cf606dee0d74cc890962de8b63c5ed84c9454 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 7157699d31..7c3df48064 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 ab894760d776dd242743d8507aa796050c2e0255 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 7c3df48064..09b2028082 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 6e92d270860fb5edb2b3d61a52a4023336652f27 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 3a0101090e..bec09474c6 100644 --- a/__tests__/spelling-ignore.yml +++ b/__tests__/spelling-ignore.yml @@ -294,3 +294,6 @@ - A-lum-min - B-lum-max - B-lum-min + +#Browsers Internal Roles +- SvgRoot From 254d1b30d87f8814be7e70dc542c11fa39f13d49 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 09b2028082..659b8c47de 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 9ce7aec39c4389fa711b4c83d1ebcb4b0d793f3f 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 659b8c47de..807492b6b6 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