fix(object-alt): ignore unloaded objects#3680
Conversation
There was a problem hiding this comment.
I don't thing this is the right approach. Before we only failed 1 of the inapplicable examples (the one this pr fixed), but with the change we now fail 3 others. From reading the ACT rule I don't think it requires looking at if a resource loaded or not. The applicability states that it should only be run on object elements that match the following criteria:
- The object element is included in the accessibility tree; and
- The object element has no explicit role; and
- The object element embeds a resource whose MIME type is either image, or audio or video.
If we want to be more conformant, should we look at the 3rd point rather than if content is loaded or not?
| ></object> | ||
| <object | ||
| id="violation8" | ||
| role="img" |
There was a problem hiding this comment.
ACT Covers this in a different rule. We don't.
| <object id="violation2" data="data:text/html,Object%20content"> | ||
| <div></div> | ||
| </object> | ||
| <object id="violation3" data="data:text/html,Object%20content"> |
There was a problem hiding this comment.
ACT doesn't cover this, but this is still an issue.
| const vNode = await delayedQueryFixture( | ||
| `<object data="invalid" height="30" id="target"></object>` | ||
| ); | ||
| // Ideally, this should be false, don't know it can be done |
There was a problem hiding this comment.
Very helpful comment, thanks.
Skip objects on the object-alt rule if they either have no data attribute, or if any of their fallback content is visible.
Closes issue: #3656
I was having difficulty getting the ACT tests to pass because the server doesn't correctly map the URLs. I opened a separate PR for that: #3681