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

Update role for attachments #3583

Merged
merged 8 commits into from
Nov 4, 2020
Merged

Conversation

corinagum
Copy link
Contributor

@corinagum corinagum commented Nov 3, 2020

Fixes #3537

Changelog Entry

Description

I missed attachments.

Design

Specific Changes

-

  • I have added tests and executed them locally
  • I have updated CHANGELOG.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

Copy link
Contributor

@compulim compulim left a comment

Choose a reason for hiding this comment

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

I think we want to "make sure all elements with aria-roledescription will have role attribute set". So I think a better test would be:

  • For all elements with aria-roledescription
    • Make sure they have role attribute set

Converting the statement to code:

const valid = [].every.call(
  document.querySelectorAll('[aria-roledescription]'),
  element => element.getAttribute('role')
);

expect(valid).toBe(true);

Or, to find out offenders:

const invalidElements = [].find.call(
  document.querySelectorAll('[aria-roledescription]'),
  element => !element.getAttribute('role')
);

invalidElements.length &&
  console.error('Elements with "aria-roledescription" attribute but not "role" attribute', { invalidElements });

expect(invalidElements).toHaveProperty('length', 0);

@compulim compulim merged commit 3e91c4c into microsoft:master Nov 4, 2020
@compulim compulim deleted the roledescFix branch November 4, 2020 08:47
@compulim compulim mentioned this pull request Nov 4, 2020
48 tasks
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.

Accessibility issue : Ensure aria-roledescription is only used on elements with an implicit or explicit role
2 participants