lighthouse 10.3.0-dev.20230619 → 10.3.0-dev.20230621

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,10 @@
1
+ export default AriaDialogName;
2
+ declare class AriaDialogName extends AxeAudit {
3
+ }
4
+ export namespace UIStrings {
5
+ const title: string;
6
+ const failureTitle: string;
7
+ const description: string;
8
+ }
9
+ import AxeAudit from './axe-audit.js';
10
+ //# sourceMappingURL=aria-dialog-name.d.ts.map
@@ -0,0 +1,45 @@
1
+ /**
2
+ * @license Copyright 2023 The Lighthouse Authors. All Rights Reserved.
3
+ * 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
4
+ * 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.
5
+ */
6
+
7
+ /**
8
+ * @fileoverview Ensures every ARIA dialog element has a discernable, accessible name.
9
+ * See base class in axe-audit.js for audit() implementation.
10
+ */
11
+
12
+ import AxeAudit from './axe-audit.js';
13
+ import * as i18n from '../../lib/i18n/i18n.js';
14
+
15
+ const UIStrings = {
16
+ /** Title of an accessibility audit that evaluates if ARIA dialog elements have an accessible name. This title is descriptive of the successful state and is shown to users when no user action is required. */
17
+ title: 'Elements with `role="dialog"` or `role="alertdialog"` have accessible names.',
18
+ /** Title of an accessibility audit that evaluates if ARIA dialog elements do not have accessible names. This title is descriptive of the failing state and is shown to users when there is a failure that needs to be addressed. */
19
+ failureTitle: 'Elements with `role="dialog"` or `role="alertdialog"` do not have accessible ' +
20
+ 'names.',
21
+ /** Description of a Lighthouse audit that tells the user *why* they should have accessible names for ARIA dialog elements. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
22
+ description: 'ARIA dialog elements without accessible names may prevent screen readers users ' +
23
+ 'from discerning the purpose of these elements. ' +
24
+ '[Learn how to make ARIA dialog elements more accessible](https://dequeuniversity.com/rules/axe/4.7/aria-dialog-name).',
25
+ };
26
+
27
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
28
+
29
+ class AriaDialogName extends AxeAudit {
30
+ /**
31
+ * @return {LH.Audit.Meta}
32
+ */
33
+ static get meta() {
34
+ return {
35
+ id: 'aria-dialog-name',
36
+ title: str_(UIStrings.title),
37
+ failureTitle: str_(UIStrings.failureTitle),
38
+ description: str_(UIStrings.description),
39
+ requiredArtifacts: ['Accessibility'],
40
+ };
41
+ }
42
+ }
43
+
44
+ export default AriaDialogName;
45
+ export {UIStrings};
@@ -0,0 +1,10 @@
1
+ export default AriaText;
2
+ declare class AriaText extends AxeAudit {
3
+ }
4
+ export namespace UIStrings {
5
+ const title: string;
6
+ const failureTitle: string;
7
+ const description: string;
8
+ }
9
+ import AxeAudit from './axe-audit.js';
10
+ //# sourceMappingURL=aria-text.d.ts.map
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @license Copyright 2023 The Lighthouse Authors. All Rights Reserved.
3
+ * 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
4
+ * 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.
5
+ */
6
+
7
+ /**
8
+ * @fileoverview Ensures all elements with `role=text` have no focusable descendents.
9
+ * See base class in axe-audit.js for audit() implementation.
10
+ */
11
+
12
+ import AxeAudit from './axe-audit.js';
13
+ import * as i18n from '../../lib/i18n/i18n.js';
14
+
15
+ const UIStrings = {
16
+ /** Title of an accesibility audit that evaluates if elements with `role=text` have no focusable descendents. This title is descriptive of the successful state and is shown to users when no user action is required. */
17
+ title: 'Elements with the `role=text` attribute do not have focusable descendents.',
18
+ /** Title of an accesibility audit that evaluates if elements with `role=text` have focusable descendents. This title is descriptive of the successful state and is shown to users when no user action is required. */
19
+ failureTitle: 'Elements with the `role=text` attribute do have focusable descendents.',
20
+ /** 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. The last sentence starting with 'Learn' becomes link text to additional documentation. */
21
+ description: 'Adding `role=text` around a text node split by markup enables VoiceOver to treat ' +
22
+ 'it as one phrase, but the element\'s focusable descendents will not be announced. ' +
23
+ '[Learn more about the `role=text` attribute](https://dequeuniversity.com/rules/axe/4.7/aria-text).',
24
+ };
25
+
26
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
27
+
28
+ class AriaText extends AxeAudit {
29
+ /**
30
+ * @return {LH.Audit.Meta}
31
+ */
32
+ static get meta() {
33
+ return {
34
+ id: 'aria-text',
35
+ title: str_(UIStrings.title),
36
+ failureTitle: str_(UIStrings.failureTitle),
37
+ description: str_(UIStrings.description),
38
+ requiredArtifacts: ['Accessibility'],
39
+ };
40
+ }
41
+ }
42
+
43
+ export default AriaText;
44
+ export {UIStrings};
@@ -0,0 +1,10 @@
1
+ export default LinkInTextBlock;
2
+ declare class LinkInTextBlock extends AxeAudit {
3
+ }
4
+ export namespace UIStrings {
5
+ const title: string;
6
+ const failureTitle: string;
7
+ const description: string;
8
+ }
9
+ import AxeAudit from './axe-audit.js';
10
+ //# sourceMappingURL=link-in-text-block.d.ts.map
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @license Copyright 2023 The Lighthouse Authors. All Rights Reserved.
3
+ * 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
4
+ * 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.
5
+ */
6
+
7
+ /**
8
+ * @fileoverview Ensures that links can be distinguished without relying on color.
9
+ * See base class in axe-audit.js for audit() implementation.
10
+ */
11
+
12
+ import AxeAudit from './axe-audit.js';
13
+ import * as i18n from '../../lib/i18n/i18n.js';
14
+
15
+ const UIStrings = {
16
+ /** Title of an accesibility audit that evaluates if all link elements can be distinguished without relying on color. This title is descriptive of the successful state and is shown to users when no user action is required. */
17
+ title: 'Links are distinguishable without relying on color.',
18
+ /** Title of an accesibility audit that evaluates if all link elements can be distinguished without relying on color. This title is descriptive of the failing state and is shown to users when there is a failure that needs to be addressed. */
19
+ failureTitle: 'Links rely on color to be distinguishable.',
20
+ /** 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. The last sentence starting with 'Learn' becomes link text to additional documentation. */
21
+ description: 'Low-contrast text is difficult or impossible for many users to read. Link text ' +
22
+ 'that is discernible improves the experience for users with low vision. ' +
23
+ '[Learn how to make links distinguishable](https://dequeuniversity.com/rules/axe/4.7/link-in-text-block).',
24
+ };
25
+
26
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
27
+
28
+ class LinkInTextBlock extends AxeAudit {
29
+ /**
30
+ * @return {LH.Audit.Meta}
31
+ */
32
+ static get meta() {
33
+ return {
34
+ id: 'link-in-text-block',
35
+ title: str_(UIStrings.title),
36
+ failureTitle: str_(UIStrings.failureTitle),
37
+ description: str_(UIStrings.description),
38
+ requiredArtifacts: ['Accessibility'],
39
+ };
40
+ }
41
+ }
42
+
43
+ export default LinkInTextBlock;
44
+ export {UIStrings};
@@ -0,0 +1,10 @@
1
+ export default SelectName;
2
+ declare class SelectName extends AxeAudit {
3
+ }
4
+ export namespace UIStrings {
5
+ const title: string;
6
+ const failureTitle: string;
7
+ const description: string;
8
+ }
9
+ import AxeAudit from './axe-audit.js';
10
+ //# sourceMappingURL=select-name.d.ts.map
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @license Copyright 2023 The Lighthouse Authors. All Rights Reserved.
3
+ * 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
4
+ * 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.
5
+ */
6
+
7
+ /**
8
+ * @fileoverview Ensures select elements have programmatically associated label elements.
9
+ * See base class in axe-audit.js for audit() implementation.
10
+ */
11
+
12
+ import AxeAudit from './axe-audit.js';
13
+ import * as i18n from '../../lib/i18n/i18n.js';
14
+
15
+ const UIStrings = {
16
+ /** Title of an accesibility audit that evaluates if all select elements have programmatically associated label elements. This title is descriptive of the successful state and is shown to users when no user action is required. */
17
+ title: 'Select elements have associated label elements.',
18
+ /** Title of an accesibility audit that evaluates if all select elements have programmatically associated label elements. This title is descriptive of the failing state and is shown to users when there is a failure that needs to be addressed. */
19
+ failureTitle: 'Select elements do not have associated label elements.',
20
+ /** 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. The last sentence starting with 'Learn' becomes link text to additional documentation. */
21
+ description: 'Form elements without effective labels can create frustrating experiences ' +
22
+ 'for screen reader users. ' +
23
+ '[Learn more about the `select` element](https://dequeuniversity.com/rules/axe/4.7/select-name).',
24
+ };
25
+
26
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
27
+
28
+ class SelectName extends AxeAudit {
29
+ /**
30
+ * @return {LH.Audit.Meta}
31
+ */
32
+ static get meta() {
33
+ return {
34
+ id: 'select-name',
35
+ title: str_(UIStrings.title),
36
+ failureTitle: str_(UIStrings.failureTitle),
37
+ description: str_(UIStrings.description),
38
+ requiredArtifacts: ['Accessibility'],
39
+ };
40
+ }
41
+ }
42
+
43
+ export default SelectName;
44
+ export {UIStrings};
@@ -236,6 +236,7 @@ const defaultConfig = {
236
236
  'accessibility/accesskeys',
237
237
  'accessibility/aria-allowed-attr',
238
238
  'accessibility/aria-command-name',
239
+ 'accessibility/aria-dialog-name',
239
240
  'accessibility/aria-hidden-body',
240
241
  'accessibility/aria-hidden-focus',
241
242
  'accessibility/aria-input-field-name',
@@ -245,6 +246,7 @@ const defaultConfig = {
245
246
  'accessibility/aria-required-children',
246
247
  'accessibility/aria-required-parent',
247
248
  'accessibility/aria-roles',
249
+ 'accessibility/aria-text',
248
250
  'accessibility/aria-toggle-field-name',
249
251
  'accessibility/aria-tooltip-name',
250
252
  'accessibility/aria-treeitem-name',
@@ -269,11 +271,13 @@ const defaultConfig = {
269
271
  'accessibility/input-image-alt',
270
272
  'accessibility/label',
271
273
  'accessibility/link-name',
274
+ 'accessibility/link-in-text-block',
272
275
  'accessibility/list',
273
276
  'accessibility/listitem',
274
277
  'accessibility/meta-refresh',
275
278
  'accessibility/meta-viewport',
276
279
  'accessibility/object-alt',
280
+ 'accessibility/select-name',
277
281
  'accessibility/tabindex',
278
282
  'accessibility/table-fake-caption',
279
283
  'accessibility/td-has-header',
@@ -504,6 +508,7 @@ const defaultConfig = {
504
508
  {id: 'accesskeys', weight: 3, group: 'a11y-navigation'},
505
509
  {id: 'aria-allowed-attr', weight: 10, group: 'a11y-aria'},
506
510
  {id: 'aria-command-name', weight: 3, group: 'a11y-aria'},
511
+ {id: 'aria-dialog-name', weight: 3, group: 'a11y-aria'},
507
512
  {id: 'aria-hidden-body', weight: 10, group: 'a11y-aria'},
508
513
  {id: 'aria-hidden-focus', weight: 3, group: 'a11y-aria'},
509
514
  {id: 'aria-input-field-name', weight: 3, group: 'a11y-aria'},
@@ -513,6 +518,7 @@ const defaultConfig = {
513
518
  {id: 'aria-required-children', weight: 10, group: 'a11y-aria'},
514
519
  {id: 'aria-required-parent', weight: 10, group: 'a11y-aria'},
515
520
  {id: 'aria-roles', weight: 10, group: 'a11y-aria'},
521
+ {id: 'aria-text', weight: 3, group: 'a11y-aria'},
516
522
  {id: 'aria-toggle-field-name', weight: 3, group: 'a11y-aria'},
517
523
  {id: 'aria-tooltip-name', weight: 3, group: 'a11y-aria'},
518
524
  {id: 'aria-treeitem-name', weight: 3, group: 'a11y-aria'},
@@ -536,12 +542,14 @@ const defaultConfig = {
536
542
  {id: 'input-button-name', weight: 10, group: 'a11y-names-labels'},
537
543
  {id: 'input-image-alt', weight: 10, group: 'a11y-names-labels'},
538
544
  {id: 'label', weight: 10, group: 'a11y-names-labels'},
545
+ {id: 'link-in-text-block', weight: 3, group: 'a11y-color-contrast'},
539
546
  {id: 'link-name', weight: 3, group: 'a11y-names-labels'},
540
547
  {id: 'list', weight: 3, group: 'a11y-tables-lists'},
541
548
  {id: 'listitem', weight: 3, group: 'a11y-tables-lists'},
542
549
  {id: 'meta-refresh', weight: 10, group: 'a11y-best-practices'},
543
550
  {id: 'meta-viewport', weight: 10, group: 'a11y-best-practices'},
544
551
  {id: 'object-alt', weight: 3, group: 'a11y-names-labels'},
552
+ {id: 'select-name', weight: 3, group: 'a11y-names-labels'},
545
553
  {id: 'tabindex', weight: 3, group: 'a11y-navigation'},
546
554
  {id: 'table-fake-caption', weight: 3, group: 'a11y-tables-lists'},
547
555
  {id: 'td-has-header', weight: 10, group: 'a11y-tables-lists'},
@@ -41,8 +41,10 @@ async function runA11yChecks() {
41
41
  // Consider http://go/prcpg for expert review of the aXe rules.
42
42
  'accesskeys': {enabled: true},
43
43
  'area-alt': {enabled: false},
44
+ 'aria-dialog-name': {enabled: true},
44
45
  'aria-roledescription': {enabled: false},
45
46
  'aria-treeitem-name': {enabled: true},
47
+ 'aria-text': {enabled: true},
46
48
  'audio-caption': {enabled: false},
47
49
  'blink': {enabled: false},
48
50
  'duplicate-id': {enabled: false},
@@ -52,7 +54,7 @@ async function runA11yChecks() {
52
54
  'html-xml-lang-mismatch': {enabled: true},
53
55
  'identical-links-same-purpose': {enabled: false},
54
56
  'input-button-name': {enabled: true},
55
- 'link-in-text-block': {enabled: false},
57
+ 'link-in-text-block': {enabled: true},
56
58
  'marquee': {enabled: false},
57
59
  'meta-viewport': {enabled: true},
58
60
  // https://github.com/dequelabs/axe-core/issues/2958
@@ -60,7 +62,7 @@ async function runA11yChecks() {
60
62
  'no-autoplay-audio': {enabled: false},
61
63
  'role-img-alt': {enabled: false},
62
64
  'scrollable-region-focusable': {enabled: false},
63
- 'select-name': {enabled: false},
65
+ 'select-name': {enabled: true},
64
66
  'server-side-image-map': {enabled: false},
65
67
  'svg-img-alt': {enabled: false},
66
68
  'tabindex': {enabled: true},