-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
new_audit: add new accessibility audits #9798
Conversation
oh, and I used the axe doc links for now, but happy to switch before landing to new docs or land and then switch the docs later. |
I'm writing the docs as we speak, so I think we'll be able to switch the links before landing. If you don't mind granting me access, I can do that directly and fix some typos I found.😄 |
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.
sweet! I think the current smoketest tradeoffs all make sense to me 👍
'aria-hidden-body': { | ||
score: 1, | ||
details: { | ||
'type': 'table', |
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.
the lint in this file is going to be fun :)
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.
whaaaaa... how is this allowed!?
'type'
'headings'
madness!
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.
whaaaaa... how is this allowed!?
ohhh, I see what your comment means now. I'm not sure how it's allowed, but it's how all of them are written...
@@ -259,6 +394,10 @@ const expectations = [ | |||
], | |||
}, | |||
}, | |||
'html-xml-lang-mismatch': { | |||
score: null, | |||
scoreDisplayMode: 'notApplicable', |
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.
do we specifically assert notApplicable
of other a11y audits in here?
I'm just wondering aloud if this is really worth having in here.
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.
do we specifically assert
notApplicable
of other a11y audits in here?I'm just wondering aloud if this is really worth having in here.
I I think so. It is asserting that they're specifically notApplicable
, which is different than pass (obvs) and fail, which is unfortunately indistinguishable from not having run that test at all. So it is at least testing that the check is running and passing down results.
It also plainly lists the audits that don't have their failure path exercised, and someone making a future second accessibility smoke test can start with those.
All that and more for four extra lines in the expectations file :)
/** Title of an accesibility audit that checks if the html <body> element does not have an aria-hidden attribute set on it. This title is descriptive of the failing state and is shown to users when there is a failure that needs to be addressed. */ | ||
failureTitle: '`[aria-hidden="true"]` is present on the document `<body>`', | ||
/** Description of a Lighthouse audit that tells the user *why* they should try to pass. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ | ||
description: 'Assistive technologies, like screen readers, work inconsistently when `aria-hidden="true"` is set on the document `<body>`. [Learn more](https://dequeuniversity.com/rules/axe/3.3/aria-hidden-body).', |
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.
seems odd that it would even be allowed since aria is all about assistive technology hints haha
lighthouse-core/audits/accessibility/form-field-multiple-labels.js
Outdated
Show resolved
Hide resolved
suggestions have all be really good, thanks! |
Hey, @brendankenny, I noticed an audit name discrepancy: axe has |
yes, sorry, should have flagged this. I'm not sure what the deal is...in their code the axe audit is definitely named |
ah, looks like it was dequelabs/axe-core#1656 that renamed to
checked box was incorrect :) |
Cool, |
Sorry, another question. Here's my understanding of the duplicate ID audits:
If that's right, it strikes me as pretty complex. I'm inferring that axe separated these out because they deemed What would you think about rolling these three axe audits into a single LH audit? I think that'd make it easier to understand and fix errors, FWIW. And I kinda want to make the same argument about |
after various conversations with @mfriesenhahn and @robdodson, this is the plan we've landed on. Let me know if I've missed anything:
|
@@ -1,38 +1,36 @@ | |||
/** | |||
* @license Copyright 2017 Google Inc. All Rights Reserved. | |||
* @license Copyright 2019 Google Inc. All Rights Reserved. |
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.
after deleting duplicate-id.js
git now thinks this was a move + slight change for this file, which is distracting for review but w/e
I think that sounds ok |
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.
LGTM % title prefix business
'aria-hidden-body': { | ||
score: 1, | ||
details: { | ||
'type': 'table', |
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.
whaaaaa... how is this allowed!?
'type'
'headings'
madness!
/** Title of an accesibility audit that checks that all ARIA input fields have an accessible name. This title is descriptive of the successful state and is shown to users when no user action is required. */ | ||
title: 'All ARIA input fields have accessible names', | ||
/** Title of an accesibility audit that checks that all ARIA input fields have an accessible name. This title is descriptive of the failing state and is shown to users when there is a failure that needs to be addressed. */ | ||
failureTitle: 'Not all ARIA input fields have accessible names', |
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.
failureTitle: 'Not all ARIA input fields have accessible names', | |
failureTitle: 'ARIA input fields do not have accessible names', |
|
||
const UIStrings = { | ||
/** Title of an accesibility audit that checks that all ARIA input fields have an accessible name. This title is descriptive of the successful state and is shown to users when no user action is required. */ | ||
title: 'All ARIA input fields have accessible names', |
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.
the All
prefixes feel out of place compared to most of our audit titles, we only do it twice out of ~100+ audits and those two were external contribs we should probably fix. it's implied in our results that we looked at everything :)
title: 'All ARIA input fields have accessible names', | |
title: 'ARIA input fields have accessible names', |
|
||
const UIStrings = { | ||
/** Title of an accesibility audit that checks that all ARIA toggle fields have an accessible name. This title is descriptive of the successful state and is shown to users when no user action is required. */ | ||
title: 'All ARIA toggle fields have accessible names', |
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.
title: 'All ARIA toggle fields have accessible names', | |
title: 'ARIA toggle fields have accessible names', |
/** Title of an accesibility audit that checks that all ARIA toggle fields have an accessible name. This title is descriptive of the successful state and is shown to users when no user action is required. */ | ||
title: 'All ARIA toggle fields have accessible names', | ||
/** Title of an accesibility audit that checks that all ARIA toggle fields have an accessible name. This title is descriptive of the failing state and is shown to users when there is a failure that needs to be addressed. */ | ||
failureTitle: 'Not all ARIA toggle fields have accessible names', |
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.
failureTitle: 'Not all ARIA toggle fields have accessible names', | |
failureTitle: 'ARIA toggle fields do not have accessible names', |
/** Title of an accesibility audit that evaluates if there are any duplicate id HTML attributes on the page. This title is descriptive of the failing state and is shown to users when there is a failure that needs to be addressed. */ | ||
failureTitle: '`[id]` attributes on the page are not unique', | ||
/** Title of an accesibility audit that checks if there are any duplicate ARIA IDs on the page. This title is descriptive of the successful state and is shown to users when no user action is required. */ | ||
title: 'All ARIA IDs are unique', |
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.
title: 'All ARIA IDs are unique', | |
title: 'ARIA IDs are unique', |
/** Title of an accesibility audit that checks if there are any duplicate ARIA IDs on the page. This title is descriptive of the successful state and is shown to users when no user action is required. */ | ||
title: 'All ARIA IDs are unique', | ||
/** Title of an accesibility audit that checks if there are any duplicate ARIA IDs on the page. This title is descriptive of the failing state and is shown to users when there is a failure that needs to be addressed. */ | ||
failureTitle: 'ARIA IDs are not all unique', |
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.
failureTitle: 'ARIA IDs are not all unique', | |
failureTitle: 'ARIA IDs are not unique', |
|
||
const UIStrings = { | ||
/** Title of an accesibility audit that checks if any form fields have multiple label elements. This title is descriptive of the successful state and is shown to users when no user action is required. */ | ||
title: 'No Form fields have multiple labels', |
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.
title: 'No Form fields have multiple labels', | |
title: 'No form fields have multiple labels', |
fixes #7127
fixes #9794 (?)
part of #9774
These are mostly part of the
wcag2a
/wcag2aa
tags, we just had them turned off before since we didn't have any audits that used the results.This is part of the 6.0 push, so can't land until we're ready to make that break, but we've needed lots of time in the past to go over phrasing, associated docs, etc.
One issue is not all these things can be tested together in the smoke tests. Specifically
aria-hidden
to the<body
to fail thearia-hidden-body
breaks most other audit failures as hidden stuff usually isn't consideredxml:lang
to failhtml-xml-lang-mismatch
breaks the otherlang
audit failuresI've left those as
notApplicable
rather than break other stuff and these are (probably?) relatively rare things.In addition, messing with
<h1>
, etc to failheading-order
makes it sobypass
doesn't fail.heading-order
is looking to be pretty important (see #9794), sobypass
now passes.Originally I made a second a11y_tester to test these things, but
<body aria-hidden="true">
alone makes most other tests notApplicable, so it didn't seem worth the large increase in smoke test execution time. Happy to look at other tradeoffs, though.