lighthouse 10.2.0-dev.20230511 → 10.2.0-dev.20230512

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 TDHasHeader;
2
+ declare class TDHasHeader 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=td-has-header.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 Ensure that large tables have `[header]` attributes.
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 large table elements use the headers HTML attribute. This title is descriptive of the successful state and is shown to users when no user action is required. */
17
+ title: '`<td>` elements in a large `<table>` have one or more table headers.',
18
+ /** Title of an accesibility audit that evaluates if all large table elements use the headers HTML attribute. 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: '`<td>` elements in a large `<table>` do not have table headers.',
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: 'Screen readers have features to make navigating tables easier. Ensuring ' +
22
+ 'that `<td>` elements in a large table (3 or more cells in width and height) have an ' +
23
+ 'associated table header may improve the experience for screen reader users. ' +
24
+ '[Learn more about table headers](https://dequeuniversity.com/rules/axe/4.7/td-has-header).',
25
+ };
26
+
27
+ const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
28
+
29
+ class TDHasHeader extends AxeAudit {
30
+ /**
31
+ * @return {LH.Audit.Meta}
32
+ */
33
+ static get meta() {
34
+ return {
35
+ id: 'td-has-header',
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 TDHasHeader;
45
+ export {UIStrings};
@@ -273,6 +273,7 @@ const defaultConfig = {
273
273
  'accessibility/meta-viewport',
274
274
  'accessibility/object-alt',
275
275
  'accessibility/tabindex',
276
+ 'accessibility/td-has-header',
276
277
  'accessibility/td-headers-attr',
277
278
  'accessibility/th-has-data-cells',
278
279
  'accessibility/valid-lang',
@@ -537,6 +538,7 @@ const defaultConfig = {
537
538
  {id: 'meta-viewport', weight: 10, group: 'a11y-best-practices'},
538
539
  {id: 'object-alt', weight: 3, group: 'a11y-names-labels'},
539
540
  {id: 'tabindex', weight: 3, group: 'a11y-navigation'},
541
+ {id: 'td-has-header', weight: 10, group: 'a11y-tables-lists'},
540
542
  {id: 'td-headers-attr', weight: 3, group: 'a11y-tables-lists'},
541
543
  {id: 'th-has-data-cells', weight: 3, group: 'a11y-tables-lists'},
542
544
  {id: 'valid-lang', weight: 3, group: 'a11y-language'},
@@ -45,7 +45,7 @@ async function runA11yChecks() {
45
45
  'meta-viewport': {enabled: true},
46
46
  'duplicate-id': {enabled: false},
47
47
  'table-fake-caption': {enabled: false},
48
- 'td-has-header': {enabled: false},
48
+ 'td-has-header': {enabled: true},
49
49
  'marquee': {enabled: false},
50
50
  'area-alt': {enabled: false},
51
51
  'html-xml-lang-mismatch': {enabled: false},
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lighthouse",
3
3
  "type": "module",
4
- "version": "10.2.0-dev.20230511",
4
+ "version": "10.2.0-dev.20230512",
5
5
  "description": "Automated auditing, performance metrics, and best practices for the web.",
6
6
  "main": "./core/index.js",
7
7
  "bin": {
@@ -362,6 +362,15 @@
362
362
  "core/audits/accessibility/tabindex.js | title": {
363
363
  "message": "No element has a `[tabindex]` value greater than 0"
364
364
  },
365
+ "core/audits/accessibility/td-has-header.js | description": {
366
+ "message": "Screen readers have features to make navigating tables easier. Ensuring that `<td>` elements in a large table (3 or more cells in width and height) have an associated table header may improve the experience for screen reader users. [Learn more about table headers](https://dequeuniversity.com/rules/axe/4.7/td-has-header)."
367
+ },
368
+ "core/audits/accessibility/td-has-header.js | failureTitle": {
369
+ "message": "`<td>` elements in a large `<table>` do not have table headers."
370
+ },
371
+ "core/audits/accessibility/td-has-header.js | title": {
372
+ "message": "`<td>` elements in a large `<table>` have one or more table headers."
373
+ },
365
374
  "core/audits/accessibility/td-headers-attr.js | description": {
366
375
  "message": "Screen readers have features to make navigating tables easier. Ensuring `<td>` cells using the `[headers]` attribute only refer to other cells in the same table may improve the experience for screen reader users. [Learn more about the `headers` attribute](https://dequeuniversity.com/rules/axe/4.7/td-headers-attr)."
367
376
  },
@@ -362,6 +362,15 @@
362
362
  "core/audits/accessibility/tabindex.js | title": {
363
363
  "message": "N̂ó êĺêḿêńt̂ h́âś â `[tabindex]` v́âĺûé ĝŕêát̂ér̂ t́ĥán̂ 0"
364
364
  },
365
+ "core/audits/accessibility/td-has-header.js | description": {
366
+ "message": "Ŝćr̂éêń r̂éâd́êŕŝ h́âv́ê f́êát̂úr̂éŝ t́ô ḿâḱê ńâv́îǵât́îńĝ t́âb́l̂éŝ éâśîér̂. Én̂śûŕîńĝ t́ĥát̂ `<td>` él̂ém̂én̂t́ŝ ín̂ á l̂ár̂ǵê t́âb́l̂é (3 ôŕ m̂ór̂é ĉél̂ĺŝ ín̂ ẃîd́t̂h́ âńd̂ h́êíĝh́t̂) h́âv́ê án̂ áŝśôćîát̂éd̂ t́âb́l̂é ĥéâd́êŕ m̂áŷ ím̂ṕr̂óv̂é t̂h́ê éx̂ṕêŕîén̂ćê f́ôŕ ŝćr̂éêń r̂éâd́êŕ ûśêŕŝ. [Ĺêár̂ń m̂ór̂é âb́ôút̂ t́âb́l̂é ĥéâd́êŕŝ](https://dequeuniversity.com/rules/axe/4.7/td-has-header)."
367
+ },
368
+ "core/audits/accessibility/td-has-header.js | failureTitle": {
369
+ "message": "`<td>` êĺêḿêńt̂ś îń â ĺâŕĝé `<table>` d̂ó n̂ót̂ h́âv́ê t́âb́l̂é ĥéâd́êŕŝ."
370
+ },
371
+ "core/audits/accessibility/td-has-header.js | title": {
372
+ "message": "`<td>` êĺêḿêńt̂ś îń â ĺâŕĝé `<table>` ĥáv̂é ôńê ór̂ ḿôŕê t́âb́l̂é ĥéâd́êŕŝ."
373
+ },
365
374
  "core/audits/accessibility/td-headers-attr.js | description": {
366
375
  "message": "Ŝćr̂éêń r̂éâd́êŕŝ h́âv́ê f́êát̂úr̂éŝ t́ô ḿâḱê ńâv́îǵât́îńĝ t́âb́l̂éŝ éâśîér̂. Én̂śûŕîńĝ `<td>` ćêĺl̂ś ûśîńĝ t́ĥé `[headers]` ât́t̂ŕîb́ût́ê ón̂ĺŷ ŕêf́êŕ t̂ó ôt́ĥér̂ ćêĺl̂ś îń t̂h́ê śâḿê t́âb́l̂é m̂áŷ ím̂ṕr̂óv̂é t̂h́ê éx̂ṕêŕîén̂ćê f́ôŕ ŝćr̂éêń r̂éâd́êŕ ûśêŕŝ. [Ĺêár̂ń m̂ór̂é âb́ôút̂ t́ĥé `headers` ât́t̂ŕîb́ût́ê](https://dequeuniversity.com/rules/axe/4.7/td-headers-attr)."
367
376
  },