a1392d75d1eaa6998299485db3e7c7a778c61ca8
[WebKit.git] / LayoutTests / fast / css / pseudo-valid-001.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <link rel="stylesheet" href="../js/resources/js-test-style.css">
5 <script src="../js/resources/js-test-pre.js"></script>
6 <style>
7  :valid { background: lime; }
8  :invalid { background: red; }
9  input { background: red; }
10 </style>
11 </head>
12 <body>
13 <p id="description"></p>
14 <form method="get">
15 <input name="victim" type="text" value="Lorem ipsum"/>
16 <input name="victim" type="text" value="Lorem ipsum" required/>
17 <input name="victim" type="text" value="Lorem ipsum" pattern="Lorem ipsum"/>
18 </form>
19 <div id="console"></div>
20 <script>
21 description("This test performs a check for the :valid CSS selector on various input elements.");
22
23 v = document.getElementsByName("victim");
24 for (i = 0; i < v.length; i++)
25     shouldBe("document.defaultView.getComputedStyle(v[i], null).getPropertyValue('background-color')", "'rgb(0, 255, 0)'");
26
27 var successfullyParsed = true;
28 </script>
29 <script src="../js/resources/js-test-post.js"></script>
30 </body>
31 </html>