Skip to content

Commit

Permalink
new_audit: add a11y manual audit for interactive element affordance (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
joelhsmith authored and paulirish committed Aug 2, 2018
1 parent 731a51a commit 7fa8ada
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

/**
* @license Copyright 2018 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/
'use strict';

const ManualAudit = require('../../manual/manual-audit');

/**
* @fileoverview Manual A11y audit for interactive element affordance.
*/

class InteractiveElementAffordance extends ManualAudit {
/**
* @return {LH.Audit.Meta}
*/
static get meta() {
return Object.assign({
id: 'interactive-element-affordance',
description: 'Interactive elements, such as links and buttons, should indicate their state and be distinguishable from non-interactive elements. [Learn more](https://developers.google.com/web/fundamentals/accessibility/how-to-review#interactive_elements_like_links_and_buttons_should_indicate_their_purpose_and_state).',
title: 'Interactive elements indicate their purpose and state',
}, super.partialMeta);
}
}

module.exports = InteractiveElementAffordance;
2 changes: 2 additions & 0 deletions lighthouse-core/config/default-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ module.exports = {
'accessibility/manual/focus-traps',
'accessibility/manual/focusable-controls',
'accessibility/manual/heading-levels',
'accessibility/manual/interactive-element-affordance',
'accessibility/manual/logical-tab-order',
'accessibility/manual/managed-focus',
'accessibility/manual/offscreen-content-hidden',
Expand Down Expand Up @@ -382,6 +383,7 @@ module.exports = {
// Manual audits
{id: 'logical-tab-order', weight: 0},
{id: 'focusable-controls', weight: 0},
{id: 'interactive-element-affordance', weight: 0},
{id: 'managed-focus', weight: 0},
{id: 'focus-traps', weight: 0},
{id: 'custom-controls-labels', weight: 0},
Expand Down
12 changes: 12 additions & 0 deletions lighthouse-core/test/results/sample_v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -1624,6 +1624,14 @@
"scoreDisplayMode": "manual",
"rawValue": false
},
"interactive-element-affordance": {
"id": "interactive-element-affordance",
"title": "Interactive elements indicate their purpose and state",
"description": "Interactive elements, such as links and buttons, should indicate their state and be distinguishable from non-interactive elements. [Learn more](https://developers.google.com/web/fundamentals/accessibility/how-to-review#interactive_elements_like_links_and_buttons_should_indicate_their_purpose_and_state).",
"score": null,
"scoreDisplayMode": "manual",
"rawValue": false
},
"logical-tab-order": {
"id": "logical-tab-order",
"title": "The page has a logical tab order",
Expand Down Expand Up @@ -3157,6 +3165,10 @@
"id": "focusable-controls",
"weight": 0
},
{
"id": "interactive-element-affordance",
"weight": 0
},
{
"id": "managed-focus",
"weight": 0
Expand Down

0 comments on commit 7fa8ada

Please sign in to comment.