Skip to content
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

limit the allowed roles on img elements #212

Merged
merged 2 commits into from
Feb 15, 2020
Merged

limit the allowed roles on img elements #212

merged 2 commits into from
Feb 15, 2020

Conversation

scottaohara
Copy link
Member

@scottaohara scottaohara commented Feb 15, 2020

closes #166

this PR does the following:

  • limits the allowed roles on an img with alt=some_text.

    • button
    • link
    • menuitem
    • menuitemcheckbox
    • menuitemradio
    • option
    • radio
    • switch
    • tab
  • disallows any role on an img without an alt attribute (some screen readers will ignore an img without an alt. some will announce the file name. rather we not allow a role=button without an accessible name, or with a name "photo-1.jpg").

    If an img is provided an authored defined accessible name via other means (aria-label, aria-labelledby, title) then same allowances as img alt="some text".

I'd be more than open to whittling the allowed roles down further, or hearing reasons to add some back in.


Preview | Diff

closes #166

this PR does the following:

* limits the allowed roles on an `img` with `alt=some_text`.
* limits the disallows roles, or limits the allowed roles on an `img` without an `alt` attribute based on whether it is provided an accessible name via other means.
Copy link
Collaborator

@stevefaulkner stevefaulkner left a comment

Choose a reason for hiding this comment

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

LGTM

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@stevefaulkner stevefaulkner merged commit 67c4b9d into gh-pages Feb 15, 2020
@scottaohara scottaohara deleted the issue_166 branch February 15, 2020 12:22
@rdeltour
Copy link
Member

I believe doc-cover is missing in the list of allowed roles. Also, if link is allowed, then all the DPUB roles extending link should probably be allowed too.

@scottaohara
Copy link
Member Author

scottaohara commented Feb 15, 2020

@rdeltour, PRs welcome :)

scottaohara added a commit that referenced this pull request Dec 3, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
closes #380.
As noted in #212, `role=radio` was meant to be allowed on an `img alt=foo`.  This corrects the mistake of that allowance not making it into the spec.
scottaohara added a commit to scottaohara/validator that referenced this pull request Dec 3, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
related to ARIA in HTML PR w3c/html-aria#212, `role=radio` was meant to be kept as an allowance for an `img` with an accessible name, but it didn't make it into the spec.  

w3c/html-aria#381 will add this allowance
scottaohara added a commit to scottaohara/WAI-ARIA-Usage that referenced this pull request Dec 3, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
related to ARIA in HTML PR w3c/html-aria#212, `role=radio` was meant to be kept as an allowance for an `img` with an accessible name, but it didn't make it into the spec.  

w3c/html-aria#381 will add this allowance.  This PR adds this allowance.
scottaohara added a commit that referenced this pull request Dec 13, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
* Correction: adds missing radio role allowance for img

closes #380.
As noted in #212, `role=radio` was meant to be allowed on an `img alt=foo`.  This corrects the mistake of that allowance not making it into the spec.

* update changelog
sideshowbarker pushed a commit to validator/validator that referenced this pull request Jan 21, 2022
related to ARIA in HTML PR w3c/html-aria#212, `role=radio` was meant to be kept as an allowance for an `img` with an accessible name, but it didn't make it into the spec.  

w3c/html-aria#381 will add this allowance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disallow role of textbox on img elements
3 participants