Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /html/rendering/widgets/input-checkbox-switch.tentative.window.html - WPT Dashboard Interop Dashboard
test(t => {
const input = document.body.appendChild(document.createElement("input"));
t.add_cleanup(() => input.remove());
input.type = "checkbox";
input.switch = true;
assert_equals(getComputedStyle(input).appearance, "auto");
}, "Default appearance value");
test(t => {
const input = document.body.appendChild(document.createElement("input"));
t.add_cleanup(() => input.remove());
input.type = "checkbox";
input.switch = true;
input.style.display = "none"
assert_equals(getComputedStyle(input).display, "none");
}, "Default appearance value: display:none");
test(t => {
const input = document.body.appendChild(document.createElement("input"));
t.add_cleanup(() => input.remove());
input.type = "checkbox";
input.switch = true;
input.style.appearance = "none";
assert_equals(getComputedStyle(input).appearance, "none");
}, "appearance:none should work");
test(t => {
const input = document.body.appendChild(document.createElement("input"));
t.add_cleanup(() => input.remove());
input.type = "checkbox";
input.switch = true;
input.style.appearance = "none";
assert_equals(getComputedStyle(input).display, "inline");
}, "appearance:none should work: display gets its initial value");