Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

New A11Y metrics #216

Merged
merged 7 commits into from
Jun 30, 2021
Merged

New A11Y metrics #216

merged 7 commits into from
Jun 30, 2021

Conversation

foxdavidj
Copy link
Contributor

@foxdavidj foxdavidj commented Jun 27, 2021

Progress on HTTPArchive/almanac.httparchive.org#2147

This PR adds five new metrics:

  1. form_control_a11y_tree: A slimmed down version of the browser accessibility tree for form controls (select, input, textarea, buttons)
  2. fieldset_radio_checkbox: Documents how many radios and checkboxes there are. Then checks how many of those inputs are correctly placed in a fieldset with a legend
  3. required_form_controls: Scans for all the required form controls on the page. Looks for required, aria-required, or an asterisk at the start or end of the visible label
  4. Track <audio> elements and their <track>s
  5. Addition of a total_with_track metric to the videos section in almanac.js

This code has been tested on custom built pages (example) and amazon.com (stress test for large amounts of elements) and passed the tests.

Amazon.com test

Custom page test

];

const stats_of_controls = [];
for (const node of $WPT_ACCESSIBILITY_TREE) {
Copy link
Member

Choose a reason for hiding this comment

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

I'd suggest declaring a const at the top of the file that aliases $WPT_ACCESSIBILITY_TREE, so that there's only one version of it that needs to be expanded in case anyone wants to add a new custom metric that depends on it.

Copy link
Contributor Author

@foxdavidj foxdavidj Jun 30, 2021

Choose a reason for hiding this comment

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

Change made in latest commit. This what you were envisioning?

@rviscomi rviscomi merged commit 23f3b43 into HTTPArchive:master Jun 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants