Skip to content

Conversation

pkra
Copy link
Member

@pkra pkra commented May 24, 2024

scottaohara and others added 13 commits December 13, 2022 10:12
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`.
@pkra pkra changed the base branch from monorepo_history--html-aam to main June 12, 2024 19:22
@pkra pkra changed the title [Monorepo] [html-aam PR 451] clarify img mappings [html-aam PR 451] clarify img mappings Jun 12, 2024
@pkra
Copy link
Member Author

pkra commented Jun 12, 2024

Now pointing to main.

Copy link

netlify bot commented Aug 11, 2024

Deploy Preview for wai-aria ready!

Name Link
🔨 Latest commit 013cb49
🔍 Latest deploy log https://app.netlify.com/projects/wai-aria/deploys/68c05189623da70008ae7a57
😎 Deploy Preview https://deploy-preview-2221--wai-aria.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@rahimabdi
Copy link
Contributor

Re-assigning reviewers @cookiecrook @smhigley @jnurthen.

@scottaohara
Copy link
Member

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.
Copy link
Contributor

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"

Suggested change
<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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

none, not presentation.

Suggested change
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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

editorial

Suggested change
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,

Comment on lines 13684 to 13689
<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>
Copy link
Contributor

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:

  1. It should start with: "Authors SHOULD" or "Authors SHOULD NOT" in order to disambiguate.
  2. It should be moved to from HTML-AAM to ARIA. Isn't this authoring rule more broadly applicable than HTML? Hooray for the monorepo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

6 participants