Skip to content

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

Merged
merged 14 commits into from
Oct 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 29 additions & 20 deletions _rules/object-has-acessible-name-8fc3b6.md
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
Expand All @@ -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).
Copy link
Collaborator

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…

  1. Should we have examples with a type attribute?
  2. How is the type determined without 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?"
  3. Can we add more types to this list (e.g. archives, fonts, …)? This is definitely not needed for the validity of the rule…
    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")

Copy link
Member Author

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)

  1. 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.

  2. 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.

  3. 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!

Copy link
Collaborator

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 👍


## 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

Expand All @@ -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
Moon speech" data="/test-assets/moon-audio/moon-speech.mp3">
Rabbit animated short" 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
Expand All @@ -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
moon-audio/moon-speech.mp3">
rabbit-video/video.mp4">
```

#### 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
moon-audio/moon-speech.mp3">
shared/w3c-logo.png">
```

#### 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
Expand All @@ -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
moon-audio/moon-speech.mp3" style="display: none;">
rabbit-video/video.mp4" style="display: none;">
```

#### Inapplicable Example 2

This `object` element is not [included in the accessibility tree][] due to `visibility:hidden`.

```html
moon-audio/moon-speech.mp3" style="visibility: hidden;">
shared/w3c-logo.png" style="visibility: hidden;">
```

#### Inapplicable Example 3
Expand All @@ -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
Copy link
Collaborator

@EmmaJP EmmaJP Sep 24, 2020

Choose a reason for hiding this comment

The 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?

Copy link
Member Author

Choose a reason for hiding this comment

The 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).
The rule was revised to be applicable only to images, audio or video mime types. That's why this was moved to an Inapplicable example.
Do let me know if you wish to change your approval!

```

#### 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'
11 changes: 11 additions & 0 deletions test-assets/shared/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
My University

Welcome to My University

We are currently working on getting our website up and running.