-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
466 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* @license Copyright 2023 The Lighthouse Authors. 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. | ||
*/ | ||
|
||
/** | ||
* @fileoverview Ensures that headings are not empty. | ||
* See base class in axe-audit.js for audit() implementation. | ||
*/ | ||
|
||
import AxeAudit from './axe-audit.js'; | ||
import * as i18n from '../../lib/i18n/i18n.js'; | ||
|
||
const UIStrings = { | ||
/** Title of an accesibility audit that checks if all heading elements have content. This title is descriptive of the successful state and is shown to users when no user action is required. */ | ||
title: 'All heading elements contain content.', | ||
/** Title of an accesibility audit that checks if all heading elements have content. This title is descriptive of the failing state and is shown to users when there is a failure that needs to be addressed. */ | ||
failureTitle: 'Heading elements do not contain content.', | ||
/** 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. */ | ||
description: 'A heading with no content or inaccessible text prevent screen reader users from ' + | ||
'accessing information on the page\'s structure. ' + | ||
'[Learn more about headings](https://dequeuniversity.com/rules/axe/4.7/empty-heading).', | ||
}; | ||
|
||
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings); | ||
|
||
class EmptyHeading extends AxeAudit { | ||
/** | ||
* @return {LH.Audit.Meta} | ||
*/ | ||
static get meta() { | ||
return { | ||
id: 'empty-heading', | ||
title: str_(UIStrings.title), | ||
failureTitle: str_(UIStrings.failureTitle), | ||
description: str_(UIStrings.description), | ||
scoreDisplayMode: AxeAudit.SCORING_MODES.INFORMATIVE, | ||
requiredArtifacts: ['Accessibility'], | ||
}; | ||
} | ||
} | ||
|
||
export default EmptyHeading; | ||
export {UIStrings}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* @license Copyright 2023 The Lighthouse Authors. 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. | ||
*/ | ||
|
||
/** | ||
* @fileoverview Ensures that identical links have the same purpose. | ||
* See base class in axe-audit.js for audit() implementation. | ||
*/ | ||
|
||
import AxeAudit from './axe-audit.js'; | ||
import * as i18n from '../../lib/i18n/i18n.js'; | ||
|
||
const UIStrings = { | ||
/** Title of an accesibility audit that checks if identical links have the same purpose. This title is descriptive of the successful state and is shown to users when no user action is required. */ | ||
title: 'Identical links have the same purpose.', | ||
/** Title of an accesibility audit that checks if identical links have the same purpose. This title is descriptive of the failing state and is shown to users when there is a failure that needs to be addressed. */ | ||
failureTitle: 'Identical links do not have the same purpose.', | ||
/** 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. */ | ||
description: 'Links with the same destination should have the same description, to help users ' + | ||
'understand the link\'s purpose and decide whether to follow it. ' + | ||
'[Learn more about identical links](https://dequeuniversity.com/rules/axe/4.7/identical-links-same-purpose).', | ||
}; | ||
|
||
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings); | ||
|
||
class IdenticalLinksSamePurpose extends AxeAudit { | ||
/** | ||
* @return {LH.Audit.Meta} | ||
*/ | ||
static get meta() { | ||
return { | ||
id: 'identical-links-same-purpose', | ||
title: str_(UIStrings.title), | ||
failureTitle: str_(UIStrings.failureTitle), | ||
description: str_(UIStrings.description), | ||
scoreDisplayMode: AxeAudit.SCORING_MODES.INFORMATIVE, | ||
requiredArtifacts: ['Accessibility'], | ||
}; | ||
} | ||
} | ||
|
||
export default IdenticalLinksSamePurpose; | ||
export {UIStrings}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** | ||
* @license Copyright 2023 The Lighthouse Authors. 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. | ||
*/ | ||
|
||
/** | ||
* @fileoverview Ensures that the document has a main landmark. | ||
* See base class in axe-audit.js for audit() implementation. | ||
*/ | ||
|
||
import AxeAudit from './axe-audit.js'; | ||
import * as i18n from '../../lib/i18n/i18n.js'; | ||
|
||
const UIStrings = { | ||
/** Title of an accesibility audit that checks if the document has a main landmark. This title is descriptive of the successful state and is shown to users when no user action is required. */ | ||
title: 'Document has a main landmark.', | ||
/** Title of an accesibility audit that checks if the document has a main landmark. This title is descriptive of the failing state and is shown to users when there is a failure that needs to be addressed. */ | ||
failureTitle: 'Document does not have a main landmark.', | ||
/** 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. */ | ||
description: 'One main landmark helps screen reader users navigate a web page. ' + | ||
'[Learn more about landmarks](https://dequeuniversity.com/rules/axe/4.7/landmark-one-main).', | ||
}; | ||
|
||
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings); | ||
|
||
class LandmarkOneMain extends AxeAudit { | ||
/** | ||
* @return {LH.Audit.Meta} | ||
*/ | ||
static get meta() { | ||
return { | ||
id: 'landmark-one-main', | ||
title: str_(UIStrings.title), | ||
failureTitle: str_(UIStrings.failureTitle), | ||
description: str_(UIStrings.description), | ||
scoreDisplayMode: AxeAudit.SCORING_MODES.INFORMATIVE, | ||
requiredArtifacts: ['Accessibility'], | ||
}; | ||
} | ||
} | ||
|
||
export default LandmarkOneMain; | ||
export {UIStrings}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* @license Copyright 2023 The Lighthouse Authors. 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. | ||
*/ | ||
|
||
/** | ||
* @fileoverview Ensures that touch targets have sufficient size and spacing. | ||
* See base class in axe-audit.js for audit() implementation. | ||
*/ | ||
|
||
import AxeAudit from './axe-audit.js'; | ||
import * as i18n from '../../lib/i18n/i18n.js'; | ||
|
||
const UIStrings = { | ||
/** Title of an accesibility audit that checks if all touch targets have sufficient size and spacing. This title is descriptive of the successful state and is shown to users when no user action is required. */ | ||
title: 'Touch targets have sufficient size and spacing.', | ||
/** Title of an accesibility audit that checks if all touch targets have sufficient size and spacing. This title is descriptive of the failing state and is shown to users when there is a failure that needs to be addressed. */ | ||
failureTitle: 'Touch targets do not have sufficient size or spacing.', | ||
/** 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. */ | ||
description: 'Touch targets with sufficient size and spacing help users who may have ' + | ||
'difficulty targeting small controls activate the targets. ' + | ||
'[Learn more about touch targets](https://dequeuniversity.com/rules/axe/4.7/target-size).', | ||
}; | ||
|
||
const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings); | ||
|
||
class TargetSize extends AxeAudit { | ||
/** | ||
* @return {LH.Audit.Meta} | ||
*/ | ||
static get meta() { | ||
return { | ||
id: 'target-size', | ||
title: str_(UIStrings.title), | ||
failureTitle: str_(UIStrings.failureTitle), | ||
description: str_(UIStrings.description), | ||
scoreDisplayMode: AxeAudit.SCORING_MODES.INFORMATIVE, | ||
requiredArtifacts: ['Accessibility'], | ||
}; | ||
} | ||
} | ||
|
||
export default TargetSize; | ||
export {UIStrings}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.