Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/selectors/pseudo-classes/indeterminate-type-change.html - WPT Dashboard Interop Dashboard
<!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">
<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>