-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LibWeb: Set dirty checkedness flag when setting
checked
IDL attribute
This matches the behavior of other browsers, which always set the dirty checkedness flag when setting checkedness, except when setting the `checked` content attribute.
- Loading branch information
1 parent
c87bc78
commit 5b6f2bb
Showing
5 changed files
with
180 additions
and
28 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
73 changes: 73 additions & 0 deletions
73
.../LibWeb/Text/expected/wpt-import/html/semantics/forms/the-input-element/cloning-steps.txt
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,73 @@ | ||
Harness status: OK | ||
|
||
Found 68 tests | ||
|
||
68 Pass | ||
Pass input element's value should be cloned | ||
Pass input element's dirty value flag should be cloned, so setAttribute doesn't affect the cloned input's value | ||
Pass input[type=button] element's indeterminateness should be cloned | ||
Pass input[type=button] element's checkedness should be cloned | ||
Pass input[type=button] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness | ||
Pass input[type=checkbox] element's indeterminateness should be cloned | ||
Pass input[type=checkbox] element's checkedness should be cloned | ||
Pass input[type=checkbox] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness | ||
Pass input[type=color] element's indeterminateness should be cloned | ||
Pass input[type=color] element's checkedness should be cloned | ||
Pass input[type=color] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness | ||
Pass input[type=date] element's indeterminateness should be cloned | ||
Pass input[type=date] element's checkedness should be cloned | ||
Pass input[type=date] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness | ||
Pass input[type=datetime-local] element's indeterminateness should be cloned | ||
Pass input[type=datetime-local] element's checkedness should be cloned | ||
Pass input[type=datetime-local] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness | ||
Pass input[type=email] element's indeterminateness should be cloned | ||
Pass input[type=email] element's checkedness should be cloned | ||
Pass input[type=email] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness | ||
Pass input[type=file] element's indeterminateness should be cloned | ||
Pass input[type=file] element's checkedness should be cloned | ||
Pass input[type=file] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness | ||
Pass input[type=hidden] element's indeterminateness should be cloned | ||
Pass input[type=hidden] element's checkedness should be cloned | ||
Pass input[type=hidden] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness | ||
Pass input[type=image] element's indeterminateness should be cloned | ||
Pass input[type=image] element's checkedness should be cloned | ||
Pass input[type=image] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness | ||
Pass input[type=month] element's indeterminateness should be cloned | ||
Pass input[type=month] element's checkedness should be cloned | ||
Pass input[type=month] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness | ||
Pass input[type=number] element's indeterminateness should be cloned | ||
Pass input[type=number] element's checkedness should be cloned | ||
Pass input[type=number] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness | ||
Pass input[type=password] element's indeterminateness should be cloned | ||
Pass input[type=password] element's checkedness should be cloned | ||
Pass input[type=password] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness | ||
Pass input[type=radio] element's indeterminateness should be cloned | ||
Pass input[type=radio] element's checkedness should be cloned | ||
Pass input[type=radio] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness | ||
Pass input[type=range] element's indeterminateness should be cloned | ||
Pass input[type=range] element's checkedness should be cloned | ||
Pass input[type=range] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness | ||
Pass input[type=reset] element's indeterminateness should be cloned | ||
Pass input[type=reset] element's checkedness should be cloned | ||
Pass input[type=reset] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness | ||
Pass input[type=search] element's indeterminateness should be cloned | ||
Pass input[type=search] element's checkedness should be cloned | ||
Pass input[type=search] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness | ||
Pass input[type=submit] element's indeterminateness should be cloned | ||
Pass input[type=submit] element's checkedness should be cloned | ||
Pass input[type=submit] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness | ||
Pass input[type=tel] element's indeterminateness should be cloned | ||
Pass input[type=tel] element's checkedness should be cloned | ||
Pass input[type=tel] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness | ||
Pass input[type=text] element's indeterminateness should be cloned | ||
Pass input[type=text] element's checkedness should be cloned | ||
Pass input[type=text] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness | ||
Pass input[type=time] element's indeterminateness should be cloned | ||
Pass input[type=time] element's checkedness should be cloned | ||
Pass input[type=time] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness | ||
Pass input[type=url] element's indeterminateness should be cloned | ||
Pass input[type=url] element's checkedness should be cloned | ||
Pass input[type=url] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness | ||
Pass input[type=week] element's indeterminateness should be cloned | ||
Pass input[type=week] element's checkedness should be cloned | ||
Pass input[type=week] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness |
64 changes: 64 additions & 0 deletions
64
Tests/LibWeb/Text/input/wpt-import/html/semantics/forms/the-input-element/cloning-steps.html
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,64 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>Cloning of input elements</title> | ||
<link rel="help" href="https://dom.spec.whatwg.org/#dom-node-clonenode"> | ||
<link rel="help" href="https://dom.spec.whatwg.org/#concept-node-clone"> | ||
<link rel="help" href="https://dom.spec.whatwg.org/#concept-node-clone-ext"> | ||
<link rel="help" href="https://html.spec.whatwg.org/multipage/forms.html#the-input-element:concept-node-clone-ext"> | ||
<link rel="author" title="Matthew Phillips" href="mailto:matthew@matthewphillips.info"> | ||
|
||
<script src="../../../../resources/testharness.js"></script> | ||
<script src="../../../../resources/testharnessreport.js"></script> | ||
|
||
<script type=module> | ||
import inputTypes from "./input-types.js"; | ||
|
||
test(function() { | ||
var input = document.createElement("input"); | ||
input.value = "foo bar"; | ||
|
||
var copy = input.cloneNode(); | ||
assert_equals(copy.value, "foo bar"); | ||
}, "input element's value should be cloned"); | ||
|
||
test(function() { | ||
var input = document.createElement("input"); | ||
input.value = "foo bar"; | ||
|
||
var copy = input.cloneNode(); | ||
copy.setAttribute("value", "something else"); | ||
|
||
assert_equals(copy.value, "foo bar"); | ||
}, "input element's dirty value flag should be cloned, so setAttribute doesn't affect the cloned input's value"); | ||
|
||
for (const inputType of inputTypes) { | ||
test(function() { | ||
var input = document.createElement("input"); | ||
input.setAttribute("type", inputType); | ||
input.indeterminate = true; | ||
|
||
var copy = input.cloneNode(); | ||
assert_equals(copy.indeterminate, true); | ||
}, `input[type=${inputType}] element's indeterminateness should be cloned`); | ||
|
||
test(function() { | ||
var input = document.createElement("input"); | ||
input.setAttribute("type", inputType); | ||
input.checked = true; | ||
|
||
var copy = input.cloneNode(); | ||
assert_equals(copy.checked, true); | ||
}, `input[type=${inputType}] element's checkedness should be cloned`); | ||
|
||
test(function() { | ||
var input = document.createElement("input"); | ||
input.setAttribute("type", inputType); | ||
input.checked = false; | ||
|
||
var copy = input.cloneNode(); | ||
copy.setAttribute("checked", "checked"); | ||
|
||
assert_equals(copy.checked, false); | ||
}, `input[type=${inputType}] element's dirty checkedness should be cloned, so setAttribute doesn't affect the cloned input's checkedness`); | ||
} | ||
</script> |
24 changes: 24 additions & 0 deletions
24
Tests/LibWeb/Text/input/wpt-import/html/semantics/forms/the-input-element/input-types.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,24 @@ | ||
export default [ | ||
"button", | ||
"checkbox", | ||
"color", | ||
"date", | ||
"datetime-local", | ||
"email", | ||
"file", | ||
"hidden", | ||
"image", | ||
"month", | ||
"number", | ||
"password", | ||
"radio", | ||
"range", | ||
"reset", | ||
"search", | ||
"submit", | ||
"tel", | ||
"text", | ||
"time", | ||
"url", | ||
"week", | ||
]; |