Skip to content

Commit

Permalink
readonly attribute should still affect constraint validation on 'unsu…
Browse files Browse the repository at this point in the history
…pported' types (#35389)

See whatwg/html#8133 and whatwg/html#8089
  • Loading branch information
nt1m authored Aug 9, 2022
1 parent 70ce2ea commit b7eb292
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@
},
//If an element is disabled, it is barred from constraint validation.
//The willValidate attribute must be true if an element is mutable
//If the readonly attribute is specified on an INPUT element, the element is barred from constraint validation
//(with the assumption that the readonly attribute applies).
//If the readonly attribute is specified on an INPUT element, the element is barred from constraint validation.
{
tag: "input",
types: ["text", "search", "tel", "url", "email", "password", "datetime-local", "date", "month", "week", "time"],
Expand All @@ -53,14 +52,14 @@
{conditions: {disabled: false, readOnly: false}, expected: false, name: "[target] The willValidate attribute must be false if it has a datalist ancestor", ancestor: "datalist"},
]
},
//In the following cases, the readonly attribute does not apply.
//In the following cases, the readonly attribute does not apply, however we should still bar the element from constraint validation.
{
tag: "input",
types: ["color", "file", "submit"],
testData: [
{conditions: {disabled: true}, expected: false, name: "[target] Must be barred from the constraint validation if it is disabled"},
{conditions: {disabled: false, readOnly: false}, expected: true, name: "[target] The willValidate attribute must be true if an element is mutable"},
{conditions: {readOnly: true}, expected: true, name: "[target] Must be not barred from the constraint validation even if it is readonly"},
{conditions: {readOnly: true}, expected: false, name: "[target] Must be barred from the constraint validation if it is readonly"},
{conditions: {disabled: false, readOnly: false}, expected: false, name: "[target] The willValidate attribute must be false if it has a datalist ancestor", ancestor: "datalist"},
]
},
Expand Down

0 comments on commit b7eb292

Please sign in to comment.