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

core(a11y): update scoring weights based on severity #8823

Merged
merged 8 commits into from
May 3, 2019
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 32 additions & 32 deletions lighthouse-cli/test/cli/__snapshots__/index-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -387,42 +387,42 @@ Object {
Object {
"group": "a11y-aria",
"id": "aria-allowed-attr",
"weight": 3,
"weight": 10,
},
Object {
"group": "a11y-aria",
"id": "aria-required-attr",
"weight": 2,
"weight": 10,
},
Object {
"group": "a11y-aria",
"id": "aria-required-children",
"weight": 5,
"weight": 10,
},
Object {
"group": "a11y-aria",
"id": "aria-required-parent",
"weight": 2,
"weight": 10,
},
Object {
"group": "a11y-aria",
"id": "aria-roles",
"weight": 3,
"weight": 10,
},
Object {
"group": "a11y-aria",
"id": "aria-valid-attr-value",
"weight": 2,
"weight": 10,
},
Object {
"group": "a11y-aria",
"id": "aria-valid-attr",
"weight": 5,
"weight": 10,
},
Object {
"group": "a11y-audio-video",
"id": "audio-caption",
"weight": 4,
"weight": 10,
},
Object {
"group": "a11y-names-labels",
Expand All @@ -432,57 +432,57 @@ Object {
Object {
"group": "a11y-navigation",
"id": "bypass",
"weight": 10,
"weight": 3,
},
Object {
"group": "a11y-color-contrast",
"id": "color-contrast",
"weight": 6,
"weight": 3,
},
Object {
"group": "a11y-tables-lists",
"id": "definition-list",
"weight": 1,
"weight": 3,
},
Object {
"group": "a11y-tables-lists",
"id": "dlitem",
"weight": 1,
"weight": 3,
},
Object {
"group": "a11y-names-labels",
"id": "document-title",
"weight": 2,
"weight": 3,
},
Object {
"group": "a11y-best-practices",
"id": "duplicate-id",
"weight": 5,
"weight": 1,
},
Object {
"group": "a11y-names-labels",
"id": "frame-title",
"weight": 5,
"weight": 3,
},
Object {
"group": "a11y-language",
"id": "html-has-lang",
"weight": 4,
"weight": 3,
},
Object {
"group": "a11y-language",
"id": "html-lang-valid",
"weight": 1,
"weight": 3,
},
Object {
"group": "a11y-names-labels",
"id": "image-alt",
"weight": 8,
"weight": 10,
},
Object {
"group": "a11y-names-labels",
"id": "input-image-alt",
"weight": 1,
"weight": 10,
},
Object {
"group": "a11y-names-labels",
Expand All @@ -492,67 +492,67 @@ Object {
Object {
"group": "a11y-tables-lists",
"id": "layout-table",
"weight": 1,
"weight": 3,
},
Object {
"group": "a11y-names-labels",
"id": "link-name",
"weight": 9,
"weight": 3,
},
Object {
"group": "a11y-tables-lists",
"id": "list",
"weight": 5,
"weight": 3,
},
Object {
"group": "a11y-tables-lists",
"id": "listitem",
"weight": 4,
"weight": 3,
},
Object {
"group": "a11y-best-practices",
"id": "meta-refresh",
"weight": 1,
"weight": 10,
},
Object {
"group": "a11y-best-practices",
"id": "meta-viewport",
"weight": 3,
"weight": 10,
},
Object {
"group": "a11y-names-labels",
"id": "object-alt",
"weight": 4,
"weight": 3,
},
Object {
"group": "a11y-navigation",
"id": "tabindex",
"weight": 4,
"weight": 3,
},
Object {
"group": "a11y-tables-lists",
"id": "td-headers-attr",
"weight": 1,
"weight": 3,
},
Object {
"group": "a11y-tables-lists",
"id": "th-has-data-cells",
"weight": 1,
"weight": 3,
},
Object {
"group": "a11y-language",
"id": "valid-lang",
"weight": 1,
"weight": 3,
},
Object {
"group": "a11y-audio-video",
"id": "video-caption",
"weight": 4,
"weight": 10,
},
Object {
"group": "a11y-audio-video",
"id": "video-description",
"weight": 3,
"weight": 10,
},
Object {
"id": "logical-tab-order",
Expand Down
71 changes: 38 additions & 33 deletions lighthouse-core/config/default-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ const UIStrings = {
seoCategoryManualDescription: 'Run these additional validators on your site to check additional SEO best practices.',
/* Title of the navigation section within the Search Engine Optimization (SEO) category. Within this section are audits with descriptive titles that highlight opportunities to make a page more usable on mobile devices. */
seoMobileGroupTitle: 'Mobile Friendly',
/* Description of the navigation section within the Search Engine Optimization (SEO) category. Within this section are audits with descriptive titles that highlight opportunities to make a page more usable on mobile devices. */
/* Description of the navigation section within the Search Engine Optimization (SEO) category. Within this section are
Copy link
Member

Choose a reason for hiding this comment

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

errant hit of the return key? :) this is breaking the strings test (I think maybe we aren't set up to extract multi-line comments into message descriptions) and linting (no trailing spaces)

with descriptive titles that highlight opportunities to make a page more usable on mobile devices. */
seoMobileGroupDescription: 'Make sure your pages are mobile friendly so users don’t have to pinch or zoom ' +
'in order to read the content pages. [Learn more](https://developers.google.com/search/mobile-sites/).',
/* Title of the navigation section within the Search Engine Optimization (SEO) category. Within this section are audits with descriptive titles that highlight ways to make a website content more easily understood by search engine crawler bots. */
Expand Down Expand Up @@ -395,42 +396,46 @@ const defaultConfig = {
title: str_(UIStrings.a11yCategoryTitle),
description: str_(UIStrings.a11yCategoryDescription),
manualDescription: str_(UIStrings.a11yCategoryManualDescription),
// Audit weights are meant to match the aXe scoring system of
// minor, serious, and critical.
// See the audits listed at dequeuniversity.com/rules/axe/3.2.
// Click on an audit and check the right hand column to see its severity.
auditRefs: [
{id: 'accesskeys', weight: 3, group: 'a11y-navigation'},
{id: 'aria-allowed-attr', weight: 3, group: 'a11y-aria'},
{id: 'aria-required-attr', weight: 2, group: 'a11y-aria'},
{id: 'aria-required-children', weight: 5, group: 'a11y-aria'},
{id: 'aria-required-parent', weight: 2, group: 'a11y-aria'},
{id: 'aria-roles', weight: 3, group: 'a11y-aria'},
{id: 'aria-valid-attr-value', weight: 2, group: 'a11y-aria'},
{id: 'aria-valid-attr', weight: 5, group: 'a11y-aria'},
{id: 'audio-caption', weight: 4, group: 'a11y-audio-video'},
{id: 'aria-allowed-attr', weight: 10, group: 'a11y-aria'},
{id: 'aria-required-attr', weight: 10, group: 'a11y-aria'},
{id: 'aria-required-children', weight: 10, group: 'a11y-aria'},
{id: 'aria-required-parent', weight: 10, group: 'a11y-aria'},
{id: 'aria-roles', weight: 10, group: 'a11y-aria'},
{id: 'aria-valid-attr-value', weight: 10, group: 'a11y-aria'},
{id: 'aria-valid-attr', weight: 10, group: 'a11y-aria'},
{id: 'audio-caption', weight: 10, group: 'a11y-audio-video'},
{id: 'button-name', weight: 10, group: 'a11y-names-labels'},
{id: 'bypass', weight: 10, group: 'a11y-navigation'},
{id: 'color-contrast', weight: 6, group: 'a11y-color-contrast'},
{id: 'definition-list', weight: 1, group: 'a11y-tables-lists'},
{id: 'dlitem', weight: 1, group: 'a11y-tables-lists'},
{id: 'document-title', weight: 2, group: 'a11y-names-labels'},
{id: 'duplicate-id', weight: 5, group: 'a11y-best-practices'},
{id: 'frame-title', weight: 5, group: 'a11y-names-labels'},
{id: 'html-has-lang', weight: 4, group: 'a11y-language'},
{id: 'html-lang-valid', weight: 1, group: 'a11y-language'},
{id: 'image-alt', weight: 8, group: 'a11y-names-labels'},
{id: 'input-image-alt', weight: 1, group: 'a11y-names-labels'},
{id: 'bypass', weight: 3, group: 'a11y-navigation'},
{id: 'color-contrast', weight: 3, group: 'a11y-color-contrast'},
{id: 'definition-list', weight: 3, group: 'a11y-tables-lists'},
{id: 'dlitem', weight: 3, group: 'a11y-tables-lists'},
{id: 'document-title', weight: 3, group: 'a11y-names-labels'},
{id: 'duplicate-id', weight: 1, group: 'a11y-best-practices'},
{id: 'frame-title', weight: 3, group: 'a11y-names-labels'},
{id: 'html-has-lang', weight: 3, group: 'a11y-language'},
{id: 'html-lang-valid', weight: 3, group: 'a11y-language'},
{id: 'image-alt', weight: 10, group: 'a11y-names-labels'},
{id: 'input-image-alt', weight: 10, group: 'a11y-names-labels'},
{id: 'label', weight: 10, group: 'a11y-names-labels'},
{id: 'layout-table', weight: 1, group: 'a11y-tables-lists'},
{id: 'link-name', weight: 9, group: 'a11y-names-labels'},
{id: 'list', weight: 5, group: 'a11y-tables-lists'},
{id: 'listitem', weight: 4, group: 'a11y-tables-lists'},
{id: 'meta-refresh', weight: 1, group: 'a11y-best-practices'},
{id: 'meta-viewport', weight: 3, group: 'a11y-best-practices'},
{id: 'object-alt', weight: 4, group: 'a11y-names-labels'},
{id: 'tabindex', weight: 4, group: 'a11y-navigation'},
{id: 'td-headers-attr', weight: 1, group: 'a11y-tables-lists'},
{id: 'th-has-data-cells', weight: 1, group: 'a11y-tables-lists'},
{id: 'valid-lang', weight: 1, group: 'a11y-language'},
{id: 'video-caption', weight: 4, group: 'a11y-audio-video'},
{id: 'video-description', weight: 3, group: 'a11y-audio-video'},
{id: 'layout-table', weight: 3, group: 'a11y-tables-lists'},
{id: 'link-name', weight: 3, group: 'a11y-names-labels'},
{id: 'list', weight: 3, group: 'a11y-tables-lists'},
{id: 'listitem', weight: 3, group: 'a11y-tables-lists'},
{id: 'meta-refresh', weight: 10, group: 'a11y-best-practices'},
{id: 'meta-viewport', weight: 10, group: 'a11y-best-practices'},
{id: 'object-alt', weight: 3, group: 'a11y-names-labels'},
{id: 'tabindex', weight: 3, group: 'a11y-navigation'},
{id: 'td-headers-attr', weight: 3, group: 'a11y-tables-lists'},
{id: 'th-has-data-cells', weight: 3, group: 'a11y-tables-lists'},
{id: 'valid-lang', weight: 3, group: 'a11y-language'},
{id: 'video-caption', weight: 10, group: 'a11y-audio-video'},
{id: 'video-description', weight: 10, group: 'a11y-audio-video'},
// Manual audits
{id: 'logical-tab-order', weight: 0},
{id: 'focusable-controls', weight: 0},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ describe('CategoryRenderer', () => {
const categoryDOM = renderer.render(category, sampleResults.categoryGroups);

const gauge = categoryDOM.querySelector('.lh-gauge__percentage');
assert.equal(gauge.textContent.trim(), '36', 'score is 0-100');
assert.equal(gauge.textContent.trim(), '38', 'score is 0-100');

const score = categoryDOM.querySelector('.lh-category-header');
const value = categoryDOM.querySelector('.lh-gauge__percentage');
Expand Down
20 changes: 10 additions & 10 deletions lighthouse-core/test/results/sample_v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -3298,12 +3298,12 @@
},
{
"id": "bypass",
"weight": 10,
"weight": 3,
"group": "a11y-navigation"
},
{
"id": "color-contrast",
"weight": 6,
"weight": 3,
"group": "a11y-color-contrast"
},
{
Expand All @@ -3318,12 +3318,12 @@
},
{
"id": "document-title",
"weight": 2,
"weight": 3,
"group": "a11y-names-labels"
},
{
"id": "duplicate-id",
"weight": 5,
"weight": 1,
"group": "a11y-best-practices"
},
{
Expand All @@ -3333,7 +3333,7 @@
},
{
"id": "html-has-lang",
"weight": 4,
"weight": 3,
"group": "a11y-language"
},
{
Expand All @@ -3343,7 +3343,7 @@
},
{
"id": "image-alt",
"weight": 8,
"weight": 10,
"group": "a11y-names-labels"
},
{
Expand All @@ -3363,7 +3363,7 @@
},
{
"id": "link-name",
"weight": 9,
"weight": 3,
"group": "a11y-names-labels"
},
{
Expand All @@ -3383,12 +3383,12 @@
},
{
"id": "meta-viewport",
"weight": 3,
"weight": 10,
"group": "a11y-best-practices"
},
{
"id": "object-alt",
"weight": 4,
"weight": 3,
"group": "a11y-names-labels"
},
{
Expand Down Expand Up @@ -3467,7 +3467,7 @@
}
],
"id": "accessibility",
"score": 0.36
"score": 0.38
},
"best-practices": {
"title": "Best Practices",
Expand Down
Loading