-
Notifications
You must be signed in to change notification settings - Fork 779
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: deprecate aria-form-field-name-matches for no-name-method-matches (
- Loading branch information
1 parent
46f6628
commit 8be89e3
Showing
11 changed files
with
94 additions
and
83 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 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { getExplicitRole } from '../commons/aria'; | ||
import { querySelectorAll } from '../core/utils'; | ||
import getElementSpec from '../commons/standards/get-element-spec'; | ||
|
||
/** | ||
* Filter out elements that have a naming method (i.e. img[alt], table > caption, etc.) | ||
*/ | ||
function noNamingMethodMatches(node, virtualNode) { | ||
const { namingMethods } = getElementSpec(virtualNode); | ||
if (namingMethods && namingMethods.length !== 0) { | ||
return false; | ||
} | ||
|
||
// Additionally, ignore combobox that get their name from a descendant input: | ||
if ( | ||
getExplicitRole(virtualNode) === 'combobox' && | ||
querySelectorAll(virtualNode, 'input:not([type="hidden"])').length | ||
) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
export default noNamingMethodMatches; |
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