3 <title>required/optional CSS pseudoclasses part
5</title>
4 <script src=
"../../resources/js-test.js"></script>
6 input:optional { background: lime; }
7 input { background: red; }
8 input:required { background: red; }
12 <input id=
"range" type=
"range" required
/>
13 <input id=
"submit" type=
"submit" required
/>
14 <input id=
"image" type=
"image" required
/>
15 <input id=
"reset" type=
"reset" required
/>
16 <input id=
"button" type=
"button" required
/>
17 <script language=
"JavaScript" type=
"text/javascript">
18 function isOptional(id
) {
19 return document
.defaultView
.getComputedStyle(document
.getElementById(id
), null).getPropertyValue('background-color') == "rgb(0, 255, 0)"
21 description('This test checks the CSS pseudoclasses for input types.');
22 shouldBeTrue('isOptional("range")');
23 shouldBeTrue('isOptional("submit")');
24 shouldBeTrue('isOptional("image")');
25 shouldBeTrue('isOptional("reset")');
26 shouldBeTrue('isOptional("button")');