-
Notifications
You must be signed in to change notification settings - Fork 784
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add shadow DOM support to list checks (#439)
* feat: add check testUtils * fix: getComposedParent should not return slot nodes * feat: Add shadow DOM support to list checks * test: Add shadow DOM list check fails
- Loading branch information
1 parent
b7008e1
commit d92c1a1
Showing
14 changed files
with
258 additions
and
233 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
return node.parentNode.tagName === 'DL'; | ||
|
||
var parent = axe.commons.dom.getComposedParent(node); | ||
return parent.nodeName.toUpperCase() === 'DL'; |
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,9 +1,2 @@ | ||
var children = node.children; | ||
if (children.length === 0) { return true; } | ||
|
||
for (var i = 0; i < children.length; i++) { | ||
if (children[i].nodeName.toUpperCase() === 'LI') { return false; } | ||
} | ||
|
||
return true; | ||
|
||
return virtualNode.children.every(({ actualNode }) => | ||
actualNode.nodeName.toUpperCase() !== 'LI'); |
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,6 +1,4 @@ | ||
|
||
if (['UL', 'OL'].indexOf(node.parentNode.nodeName.toUpperCase()) !== -1) { | ||
return true; | ||
} | ||
|
||
return node.parentNode.getAttribute('role') === 'list'; | ||
var parent = axe.commons.dom.getComposedParent(node); | ||
return (['UL', 'OL'].includes(parent.nodeName.toUpperCase()) || | ||
(parent.getAttribute('role') || '').toLowerCase() === 'list'); | ||
|
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
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
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.