1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <script src=
"../../resources/js-test.js"></script>
6 :valid { background: lime; }
7 :invalid { background: red; }
8 input { background: red; }
12 <p id=
"description"></p>
14 <input name=
"victim" type=
"text" value=
"Lorem ipsum"/>
15 <input name=
"victim" type=
"text" value=
"Lorem ipsum" required
/>
16 <input name=
"victim" type=
"text" value=
"Lorem ipsum" pattern=
"Lorem ipsum"/>
17 <input name=
"victim" type=
"submit">
18 <button name=
"victim"></button>
20 <div id=
"console"></div>
22 description("This test performs a check for the :valid CSS selector on various input and button elements.");
24 v
= document
.getElementsByName("victim");
25 for (i
= 0; i
< v
.length
; i
++)
26 shouldBe("document.defaultView.getComputedStyle(v[i], null).getPropertyValue('background-color')", "'rgb(0, 255, 0)'");