-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1857951 [wpt PR 42427] - HTML: make dir=auto and dirname apply to…
… more form controls, a=testonly Automatic update from web-platform-tests HTML: make dir=auto and dirname apply to more form controls For whatwg/html#9689. Helps with web-platform-tests/wpt#25569 as this area was barely tested. (Also correct some typos while here.) -- wpt-commits: 364c325f6589ec43c8e0abd85dc3220c6592721d wpt-pr: 42427
- Loading branch information
1 parent
bddf8a3
commit 02e8ed9
Showing
6 changed files
with
79 additions
and
13 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
61 changes: 61 additions & 0 deletions
61
...web-platform/tests/html/dom/elements/global-attributes/dir-auto-form-associated.window.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Keep this mostly synchronized with | ||
// html/semantics/forms/attributes-common-to-form-controls/dirname-only-if-applies.html | ||
// except that won't have "reset" and "button" as those don't submit their value | ||
[ | ||
"hidden", | ||
"text", | ||
"search", | ||
"tel", | ||
"url", | ||
"email", | ||
"password", | ||
"submit", | ||
"reset", | ||
"button" | ||
].forEach(type => { | ||
test(t => { | ||
const input = document.createElement("input"); | ||
t.add_cleanup(() => input.remove()); | ||
input.type = type; | ||
assert_equals(input.type, type); | ||
input.dir = "auto"; | ||
input.value = "\u05D0"; // The Hebrew letter Alef (strongly RTL) | ||
document.body.append(input); | ||
assert_true(input.matches(":dir(rtl)")); | ||
}, `<input dir=auto type=${type}> directionality`); | ||
}); | ||
|
||
[ | ||
"date", | ||
"month", | ||
"week", | ||
"time", | ||
"datetime-local", | ||
"number", | ||
"range", | ||
"color", | ||
"checkbox", | ||
"radio", | ||
// "file" // value setter throws | ||
"image" | ||
].forEach(type => { | ||
test(t => { | ||
const input = document.createElement("input"); | ||
t.add_cleanup(() => input.remove()); | ||
input.type = type; | ||
assert_equals(input.type, type); | ||
input.dir = "auto"; | ||
input.value = "\u05D0"; // The Hebrew letter Alef (strongly RTL) | ||
document.body.append(input); | ||
assert_true(input.matches(":dir(ltr)")); | ||
}, `<input dir=auto type=${type}> directionality`); | ||
}); | ||
|
||
test(t => { | ||
const input = document.createElement("textarea"); | ||
t.add_cleanup(() => input.remove()); | ||
input.dir = "auto"; | ||
input.value = "\u05D0"; // The Hebrew letter Alef (strongly RTL) | ||
document.body.append(input); | ||
assert_true(input.matches(":dir(rtl)")); | ||
}, `<textarea dir=auto> directionality`); |
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