-
Notifications
You must be signed in to change notification settings - Fork 75
Resolve TF feedback on "Object has accessible name" 8fc3b6 #1441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
18aee32
525638c
1e4b50d
3a2c3e1
1b9e5bb
b92f800
1c0043e
0926fd2
32d774c
66afd13
5350f12
94607a5
5266add
e83a92f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
--- | ||
id: 8fc3b6 | ||
name: Object element has non-empty accessible name | ||
name: Object element rendering non-text content has non-empty accessible name | ||
rule_type: atomic | ||
description: | | ||
This rule checks that each `object` element has a non-empty accessible name. | ||
This rule checks that each `object` element rendering non-text content has a non-empty accessible name. | ||
accessibility_requirements: | ||
wcag20:1.1.1: # Non-text Content (A) | ||
forConformance: true | ||
|
@@ -23,15 +23,15 @@ acknowledgments: | |
|
||
## Applicability | ||
|
||
This rule applies to any `object` element that is [included in the accessibility tree][]. | ||
This rule applies to any `object` element that is [included in the accessibility tree][] and embeds a resource with an [image MIME type](https://mimesniff.spec.whatwg.org/#image-mime-type) or an [audio or video MIME type](https://mimesniff.spec.whatwg.org/#audio-or-video-mime-type). | ||
|
||
## Expectation | ||
|
||
Each target element has an [accessible name][] that is not empty (`""`). | ||
|
||
## Assumptions | ||
|
||
_There are currently no assumptions._ | ||
The `object` element is not rendered for presentational purposes. If the `object` is decorative and not [marked as decorative][] then the rule might fail but the success criterion might still be satisfied. | ||
|
||
## Accessibility Support | ||
|
||
|
@@ -49,32 +49,31 @@ Testing that the [accessible name][] describes the purpose of the `object` eleme | |
|
||
#### Passed Example 1 | ||
|
||
This `object` element has a non-empty [accessible name][] through its `aria-label` attribute. | ||
This `object` element which embeds an audio resource has a non-empty [accessible name][] through its `aria-label` attribute. | ||
|
||
```html | ||
``` | ||
|
||
#### Passed Example 2 | ||
|
||
This `object` element has a non-empty [accessible name][] through its `title` attribute. | ||
This `object` element which embeds a video resource has a non-empty [accessible name][] through its `title` attribute. | ||
|
||
```html | ||
" data="/test-assets/moon-audio/moon-speech.mp3"> | ||
" data="/test-assets/rabbit-video/video.mp4"> | ||
``` | ||
|
||
#### Passed Example 3 | ||
|
||
This `object` element has a non-empty [accessible name][] through its `aria-labelledby` attribute. | ||
This `object` element which embeds an image resource has a non-empty [accessible name][] through its `aria-labelledby` attribute. | ||
|
||
```html | ||
Moon speech | ||
W3C | ||
``` | ||
|
||
#### Passed Example 4 | ||
|
||
This `object` element placed off screen has a non-empty [accessible name][] through its `title` attribute. | ||
This `object` element placed off screen, which embeds an audio resource, has a non-empty [accessible name][] through its `title` attribute. | ||
|
||
```html | ||
|
@@ -95,31 +94,31 @@ This `object` element placed off screen has a non-empty [accessible name][] thro | |
|
||
#### Failed Example 1 | ||
|
||
This `object` element has an empty [accessible name][]. | ||
This `object` element which embeds a video resource has an empty [accessible name][] because the `title` attribute is empty. | ||
|
||
```html | ||
"> | ||
"> | ||
``` | ||
|
||
#### Failed Example 2 | ||
|
||
This `object` element has an empty [accessible name][]. | ||
This `object` element which embeds an image resource has an empty [accessible name][] because the `span` element with `id="label"` is empty. | ||
|
||
```html | ||
"> | ||
"> | ||
``` | ||
|
||
#### Failed Example 3 | ||
|
||
This `object` element has an empty [accessible name][] because the `aria-labelledby` attribute references a non-existing id. | ||
This `object` element which embeds an audio resource has an empty [accessible name][] because the `aria-labelledby` attribute references a non-existing id. | ||
|
||
```html | ||
``` | ||
|
||
#### Failed Example 4 | ||
|
||
This `object` element has an empty [accessible name][]. | ||
This `object` element which embeds an audio resource has an empty [accessible name][] because it does not provide an accessible name through one of `title`, `aria-label` or `aria-labelledby` attributes. | ||
|
||
```html | ||
|
@@ -132,15 +131,15 @@ This `object` element has an empty [accessible name][]. | |
This `object` element is not [included in the accessibility tree][] due to `display:none`. | ||
|
||
```html | ||
" style="display: none;"> | ||
" style="display: none;"> | ||
``` | ||
|
||
#### Inapplicable Example 2 | ||
|
||
This `object` element is not [included in the accessibility tree][] due to `visibility:hidden`. | ||
|
||
```html | ||
" style="visibility: hidden;"> | ||
" style="visibility: hidden;"> | ||
``` | ||
|
||
#### Inapplicable Example 3 | ||
|
@@ -156,16 +155,26 @@ This `object` element is not [included in the accessibility tree][] due to `aria | |
This `object` element is not [included in the accessibility tree][] because it is marked as decorative through `role="presentation"`. | ||
|
||
```html | ||
``` | ||
|
||
#### Inapplicable Example 5 | ||
|
||
This `object` element embeds an HTML resource. | ||
|
||
```html | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This unusual scenario feels similar to an iframe. Just double checking, but presume for this rule/example it wouldn't matter if the HTML resource was non-text content? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is similar to an iframe (I seem to remember one of the browsers even treating this as an iframe in the DOM). |
||
``` | ||
|
||
#### Inapplicable Example 6 | ||
|
||
There is no `object` element. | ||
|
||
```html | ||
``` | ||
|
||
|
||
[accessible name]: #accessible-name 'Definition of accessible name' | ||
[included in the accessibility tree]: #included-in-the-accessibility-tree 'Definition of included in the accessibility tree' | ||
[marked as decorative]: #marked-as-decorative 'Definition of Marked as decorative' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
Welcome to My University |
||
We are currently working on getting our website up and running. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that ❤️ It does raise a few questions…
type
attribute?type
attribute? Looks like it is step 8 in the algo at https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-object-element which is somewhat complex :-/The question is especially relevant in "are we sure that the examples are going to be served with the correct MIME type?"
I think it might be worth to add a definition of "non-text MIME type" which would them be easy to update if needed (plus, can be reused, and makes the intention super clear in that rule: "an
object
which embeds a [non-text][non-text mime] resource")There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Jym77 I'll start by addressing question 2 and then 1 (before question 3)
I don't think we should dive into the algorithm (similar to what we do with accessible names, for instance). The browser determines the mime type of the resource (in the same way it builds the accessibility tree). I admit I haven't looked into the details of the process, but by looking at the headers in the HTTP response to the request for the object, the mime type is there and it is the correct one for all the examples we have.
Furthermore, even when I enter an incorrect mime type using the type attribute, I made two observations: 1) the response headers always have the correct type (ignoring what I entered in the type attribute); 2) the browser always renders the object correctly, apparently also ignoring the type attribute.
Given the observations above, I don't really think we need to have examples with the type attribute, because it doesn't seem to be used for any rendering decisions.
Not sure it that would be useful. SC 1.1.1 addresses non-text content that is presented to the user. Fonts and archives are not really presented to user, are they? And if they are, I supposed they would be presented as text. By including those, we then would have to write the applicability in a way to leave them out.
I'll wait for your input, to understand if you think we still need to change anything in the rule!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm OK with that 👍