-
Notifications
You must be signed in to change notification settings - Fork 791
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(main-is-top-level): Rename check to landmark-is-top-level for gre…
…ater reuse BREAKING CHANGE: The check main-is-top-level is no longer available
- Loading branch information
1 parent
7b66768
commit b405af1
Showing
20 changed files
with
110 additions
and
283 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
lib/checks/keyboard/main-is-top-level.js → lib/checks/keyboard/landmark-is-top-level.js
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,11 @@ | ||
{ | ||
"id": "landmark-is-top-level", | ||
"evaluate": "landmark-is-top-level.js", | ||
"metadata": { | ||
"impact": "moderate", | ||
"messages": { | ||
"pass": "The {{=it.data.role }} landmark is at the top level.", | ||
"fail": "The {{=it.data.role }} landmark is contained in another landmark." | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,16 +1,17 @@ | ||
{ | ||
"id": "landmark-banner-is-top-level", | ||
"selector": "[role=banner], header", | ||
"selector": "header:not([role]), [role=banner]", | ||
"matches": "landmark-has-body-context.js", | ||
"tags": [ | ||
"best-practice" | ||
], | ||
"metadata": { | ||
"description": "A banner landmark identifies site-oriented content at the beginning of each page within a website", | ||
"description": "The banner landmark should not be contained in another landmark", | ||
"help": "Banner landmark must be at top level" | ||
}, | ||
"all": [], | ||
"any": [ | ||
"banner-is-top-level" | ||
"landmark-is-top-level" | ||
], | ||
"none": [] | ||
} |
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 |
---|---|---|
@@ -1,16 +1,17 @@ | ||
{ | ||
"id": "landmark-contentinfo-is-top-level", | ||
"selector": "[role=contentinfo], footer", | ||
"selector": "footer:not([role]), [role=contentinfo]", | ||
"matches": "landmark-has-body-context.js", | ||
"tags": [ | ||
"best-practice" | ||
], | ||
"metadata": { | ||
"description": "A contentinfo landmark is a way to identify common information at the bottom of each page within a website", | ||
"description": "The contentinfo landmark should not be contained in another landmark", | ||
"help": "Contentinfo landmark must be at top level" | ||
}, | ||
"all": [], | ||
"any": [ | ||
"contentinfo-is-top-level" | ||
"landmark-is-top-level" | ||
], | ||
"none": [] | ||
} |
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,6 @@ | ||
const nativeScopeFilter = 'article, aside, main, nav, section'; | ||
|
||
// Filter elements that, within certain contexts, don't map their role. | ||
// e.g. a <footer> inside a <main> is not a banner, but in the <body> context it is | ||
return (node.hasAttribute('role') || | ||
!axe.commons.dom.findUpVirtual(virtualNode, nativeScopeFilter)); |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.