-
Notifications
You must be signed in to change notification settings - Fork 137
[html-aam PR 451] clarify img mappings #2221
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
base: main
Are you sure you want to change the base?
Conversation
closes #439 This PR provides more detailed conditions for when an `img` element is mapped to the `img` role. This was originally brought up to address what should happen when an `img` lacks or has been given an `src` attribute set to the empty string, as HTML defines such instances as "representing nothing". However, in trying to just add in that condition, it made me realize the mappings were lacking additional nuance to how the element is exposed re: the existence of alternative naming mechanisms besides just `alt`.
Now pointing to main. |
✅ Deploy Preview for wai-aria ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Re-assigning reviewers @cookiecrook @smhigley @jnurthen. |
need to come back to this as whatwg/html#11300 was merged into HTML |
or <a class="core-mapping" href="#role-map-img">`img`</a> role | ||
<div> | ||
If element has a non-empty `src` or `srcset` attribute, an <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a>, or both, then map to the | ||
<a class="core-mapping" href="#role-map-image">`img`</a> or <a class="core-mapping" href="#role-map-img">`image`</a> role. |
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.
Are these typos? Link text for #…image
is "img", and vice versa link text for #…img
is "image"…
Regardless, these should both map to the primary synonym: "image"
<a class="core-mapping" href="#role-map-image">`img`</a> or <a class="core-mapping" href="#role-map-img">`image`</a> role. | |
<a class="core-mapping" href="#role-map-image">`image`</a> role. |
</div> | ||
<div> | ||
Otherwise, if the element has no `src` or `srcset` attribute, or if the attribute(s) are set to the empty string, and the `img` has no `alt` attribute or accessible name, then map to | ||
the <a class="core-mapping" href="#role-map-none">`none`</a> or <a class="core-mapping" href="#role-map-presentation">`presentation`</a> role. |
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.
none
, not presentation
.
the <a class="core-mapping" href="#role-map-none">`none`</a> or <a class="core-mapping" href="#role-map-presentation">`presentation`</a> role. | |
the <a class="core-mapping" href="#role-map-none">`none`</a> or <a class="core-mapping" href="#role-map-none">`none`</a> role. |
<th>Comments</th> | ||
<td> | ||
<p> | ||
An `img` with a non-empty `src`, `srcset`, or both and no `alt` attribute or <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a> will still map to the `image` role, |
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.
editorial
An `img` with a non-empty `src`, `srcset`, or both and no `alt` attribute or <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a> will still map to the `image` role, | |
An `img` with a non-empty `src`, `srcset`, or both and no `alt` attribute or <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a> will map to the `image` role, |
<p> | ||
The <sref>aria-expanded</sref> attribute is applied to a focusable, interactive element that toggles visibility of content of a different element. If the element with | ||
<sref>aria-expanded</sref> is also a <rref>treeitem</rref> in a <rref>tree</rref> or a <rref>row</rref> in a <rref>treegrid</rref>, then it SHOULD also be the | ||
<a>accessibility parent</a> of the content it expands and collapses. Otherwise, the element with <sref>aria-expanded</sref> SHOULD NOT be the <a>accessibility parent</a> of the content | ||
that is expanding or collapsing. Rather, identify that relationship between the interactive element and the element being controlled using <pref>aria-controls</pref>. | ||
</p> |
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.
Can't use passive voice in an RFC-2119. Are these author requirements or user agent requirements? Most in HTML-AAM are UA reqs, but this looks like an author req, so:
- It should start with: "Authors SHOULD" or "Authors SHOULD NOT" in order to disambiguate.
- It should be moved to from HTML-AAM to ARIA. Isn't this authoring rule more broadly applicable than HTML? Hooray for the monorepo!
Moved from w3c/html-aam#451
Preview | Diff