Update web-platform-tests to revision 8a2ceb5f18911302b7a5c1cd2791f4ab50ad4326

This commit is contained in:
Josh Matthews 2017-10-12 09:25:50 -04:00
parent 462c272380
commit 1f531f66ea
5377 changed files with 174916 additions and 84369 deletions

View file

@ -0,0 +1,24 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Selector: pseudo-class :checked input type change</title>
<link rel="author" title="Rune Lillesveen" href="mailto:rune@opera.com">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#pseudo-classes">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
span { color: red }
:checked + span { color: green }
</style>
<input id="checked" type="text" checked>
<span id="sibling">This text should be green.</span>
<script>
test(() => {
assert_equals(getComputedStyle(sibling).color, "rgb(255, 0, 0)",
"Not matching :checked for type=text");
checked.type = "radio";
assert_equals(getComputedStyle(sibling).color, "rgb(0, 128, 0)",
"Matching :checked for type=radio");
}, "Evaluation of :checked changes on input type change.");
</script>

View file

@ -0,0 +1,24 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Selector: pseudo-class :indeterminate input type change</title>
<link rel="author" title="Rune Lillesveen" href="mailto:rune@opera.com">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#pseudo-classes">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
span { color: red }
:indeterminate + span { color: green }
</style>
<input id="indeterminate" type="text">
<span id="sibling">This text should be green.</span>
<script>
test(() => {
assert_equals(getComputedStyle(sibling).color, "rgb(255, 0, 0)",
"Not matching :indeterminate for type=text");
indeterminate.type = "radio";
assert_equals(getComputedStyle(sibling).color, "rgb(0, 128, 0)",
"Matching :indeterminate for type=radio");
}, "Evaluation of :indeterminate changes on input type change.");
</script>

View file

@ -0,0 +1,43 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Selector: pseudo-classes (:in-range, :out-of-range) input type change</title>
<link rel="author" title="Rune Lillesveen" href="mailto:rune@opera.com">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#pseudo-classes">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
span {
color: red;
}
#t1:in-range + span {
color: green;
}
#t2:out-of-range + span {
color: green;
}
</style>
<input id="t1" type="text" min="0" max="10" value="5">
<span id="sibling1">This text should be green.</span>
<input id="t2" type="text" min="0" max="10" value="50">
<span id="sibling2">This text should be green.</span>
<script>
test(() => {
assert_equals(getComputedStyle(sibling1).color, "rgb(255, 0, 0)",
"Not matching :in-range for type=text");
t1.type = "number";
assert_equals(getComputedStyle(sibling1).color, "rgb(0, 128, 0)",
"Matching :in-range for type=number");
}, "Evaluation of :in-range changes for input type change.");
test(() => {
assert_equals(getComputedStyle(sibling2).color, "rgb(255, 0, 0)",
"Not matching :out-of-range for type=text");
t2.type = "number";
assert_equals(getComputedStyle(sibling2).color, "rgb(0, 128, 0)",
"Matching :in-range for type=number");
}, "Evaluation of :out-of-range changes for input type change.");
</script>

View file

@ -0,0 +1,27 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Selector: pseudo-class :placeholder-shown input type change</title>
<link rel="author" title="Rune Lillesveen" href="mailto:rune@opera.com">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#pseudo-classes">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
span {
color: red;
}
:placeholder-shown + span {
color: green;
}
</style>
<input id="input" type="submit" placeholder="placeholder"></input>
<span id="sibling">This text should be green.</span>
<script>
test(() => {
assert_equals(getComputedStyle(sibling).color, "rgb(255, 0, 0)",
"Not matching :placeholder-shown for type=submit");
input.type = "text";
assert_equals(getComputedStyle(sibling).color, "rgb(0, 128, 0)",
"Matching :placeholder-shown for type=text");
}, "Evaluation of :placeholder-shown changes for input type change.");
</script>

View file

@ -0,0 +1,36 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Selector: pseudo-classes (:read-write, :read-only) input type change</title>
<link rel="author" title="Rune Lillesveen" href="mailto:rune@opera.com">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#pseudo-classes">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
span {
color: red;
background-color: pink;
}
:required + span {
color: green;
}
:not(:optional) + span {
background-color: lime;
}
</style>
<input id="hiddenInput" type="hidden" required>
<span id="sibling">This text should be green on lime background.</span>
<script>
test(() => {
assert_equals(getComputedStyle(sibling).color, "rgb(255, 0, 0)",
"Not matching :required for type=hidden");
assert_equals(getComputedStyle(sibling).backgroundColor, "rgb(255, 192, 203)",
"Matching :optional for type=hidden");
hiddenInput.type = "text";
assert_equals(getComputedStyle(sibling).color, "rgb(0, 128, 0)",
"Matching :required for type=text");
assert_equals(getComputedStyle(sibling).backgroundColor, "rgb(0, 255, 0)",
"Matching :not(:optional) for type=text");
}, "Evaluation of :required and :optional changes for input type change.");
</script>

View file

@ -0,0 +1,36 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>Selector: pseudo-classes (:required, :optional) for hidden input</title>
<link rel="author" title="Rune Lillesveen" href="mailto:rune@opera.com">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#pseudo-classes">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
span {
color: red;
background-color: pink;
}
:required + span {
color: green;
}
:not(:optional) + span {
background-color: lime;
}
</style>
<input id="hiddenInput" type="hidden" required>
<span id="sibling">This text should be green on lime background.</span>
<script>
test(() => {
assert_equals(getComputedStyle(sibling).color, "rgb(255, 0, 0)",
"Not matching :required for type=hidden");
assert_equals(getComputedStyle(sibling).backgroundColor, "rgb(255, 192, 203)",
"Matching :optional for type=hidden");
hiddenInput.type = "text";
assert_equals(getComputedStyle(sibling).color, "rgb(0, 128, 0)",
"Matching :required for type=text");
assert_equals(getComputedStyle(sibling).backgroundColor, "rgb(0, 255, 0)",
"Matching :not(:optional) for type=text");
}, "Evaluation of :required and :optional changes for input type change.");
</script>