Skip to content

Conversation

@mgifford
Copy link
Contributor

The A11y community suggested a few other commonly used classes.

Just adding to the list of known classes.

The A11y community suggested a few other commonly used classes.
@github-actions
Copy link

https://almanac.httparchive.org/en/2022/

WPT result details

Changed custom metrics values:

{
  "_a11y": {
    "tables": {
      "total": 0,
      "total_with_caption": 0,
      "total_with_presentational": 0,
      "total_with_figcaption": 0
    },
    "file_extension_alts": {
      "total_elements_with_alt": 5,
      "total_elements_with_non_empty_alt": 0,
      "total_with_file_extension": 0,
      "file_extensions": {}
    },
    "title_and_alt": {
      "total_alt": 5,
      "total_title": 5,
      "total_both": 0,
      "total_alt_same_as_title": 0
    },
    "th_with_scope_attribute": {
      "total_th": 0,
      "total_with_scope": 0,
      "scopes": {}
    },
    "td_with_headers_attribute": {
      "total_tds": 0,
      "total_with_headers": 0
    },
    "total_anchors_with_role_button": 0,
    "total_role_tab_with_selected_and_controls": 0,
    "placeholder_but_no_label": {
      "total_placeholder": 4,
      "total_no_label": 0
    },
    "divs_or_spans_as_button_or_link": {
      "total_role_button": 0,
      "total_role_link": 0,
      "total_either": 0
    },
    "screen_reader_classes": false,
    "form_control_a11y_tree": {
      "__error": {
        "stack": "TypeError: Cannot read properties of undefined (reading 'value')\n    at addControlToStats (<anonymous>:202:28)\n    at <anonymous>:246:1\n    at captureAndLogError (<anonymous>:30:8)\n    at wptCustomMetric (<anonymous>:195:25)\n    at <anonymous>:318:7",
        "message": "Cannot read properties of undefined (reading 'value')"
      }
    },
    "fieldset_radio_checkbox": {
      "total_radio": 0,
      "total_checkbox": 0,
      "total_radio_in_fieldset": 0,
      "total_checkbox_in_fieldset": 0,
      "fieldsets": []
    },
    "required_form_controls": []
  }
}

}),
screen_reader_classes: captureAndLogError(() => {
return document.querySelectorAll('.sr-only', '.visually-hidden', '.screen-reader-text', '.element-invisible').length > 0;
return document.querySelectorAll('.sr-only', '.visually-hidden', '.screen-reader-text', '.element-invisible', '.sr', '.visuallyhidden', '.skip-link', '.scrn-rdr', '.usa-skipnav', '.usa-sr-only', '.a11y-hide').length > 0;
Copy link
Member

Choose a reason for hiding this comment

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

I'm a little worried about .sr being a little too generic and so resulting in false positive. The rest look fine.

Suggested change
return document.querySelectorAll('.sr-only', '.visually-hidden', '.screen-reader-text', '.element-invisible', '.sr', '.visuallyhidden', '.skip-link', '.scrn-rdr', '.usa-skipnav', '.usa-sr-only', '.a11y-hide').length > 0;
return document.querySelectorAll('.sr-only', '.visually-hidden', '.screen-reader-text', '.element-invisible', '.visuallyhidden', '.skip-link', '.scrn-rdr', '.usa-skipnav', '.usa-sr-only', '.a11y-hide').length > 0;

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.

2 participants