-
Notifications
You must be signed in to change notification settings - Fork 776
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: autocomplete-appropriate node type resolution (#1318)
`Firefox` returns `node.type` as `text` for certain scenarios like - `<input autocomplete="bday-month" type="month">`, hence using `getAttribute` to resolve the value of `type` solves for this edge case. Due to this, the number of violations returned across different browsers were different as described in the bug below. Closes issue: - https://dequesrc.atlassian.net/browse/WWD-1957 ## Reviewer checks **Required fields, to be filled out by PR reviewer(s)** - [x] Follows the commit message policy, appropriate for next version - [x] Has documentation updated, a DU ticket, or requires no documentation change - [x] Includes new tests, or was unnecessary - [x] Code is reviewed for security by: << Name here >>
- Loading branch information
1 parent
a28674e
commit 2fc3eeb
Showing
5 changed files
with
83 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* global axe */ | ||
|
||
/** | ||
* Returns array of valid input type values | ||
* @method validInputTypes | ||
* @memberof axe.commons.utils | ||
* @instance | ||
* @return {Array<Sting>} | ||
*/ | ||
axe.utils.validInputTypes = function validInputTypes() { | ||
'use strict'; | ||
|
||
// Reference - https://html.spec.whatwg.org/multipage/input.html#the-input-element | ||
return [ | ||
'hidden', | ||
'text', | ||
'search', | ||
'tel', | ||
'url', | ||
'email', | ||
'password', | ||
'date', | ||
'month', | ||
'week', | ||
'time', | ||
'datetime-local', | ||
'number', | ||
'range', | ||
'color', | ||
'checkbox', | ||
'radio', | ||
'file', | ||
'submit', | ||
'image', | ||
'reset', | ||
'button' | ||
]; | ||
}; |
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