Rubber-stamped by Brady Eidson.
[webbrowser.git] / LayoutTests / fast / css / pseudo-required-optional-003.html
bloba97b1a34d1174e0e5cbe685f0ab8445fe742c87b
1 <html>
2 <head>
3 <title>required/optional CSS pseudoclasses part 3</title>
4 <style>
5 input:required { background: lime; }
6 textarea:required { background: lime; }
7 input { background: red; }
8 textarea { background: red; }
9 </style>
10 <script language="JavaScript" type="text/javascript">
11 function log(message) {
12 document.getElementById("console").innerHTML += "<li>"+message+"</li>";
15 function test() {
16 if (window.layoutTestController)
17 layoutTestController.dumpAsText();
19 v = document.getElementsByName("victim");
21 for (i = 0; i < v.length; i++)
22 if (document.defaultView.getComputedStyle(v[i], null).getPropertyValue('background-color') == "rgb(0, 255, 0)")
23 log("SUCCESS");
24 else
25 log("FAILURE");
27 </script>
28 </head>
29 <body onload="test()">
30 <p>All controls should have a green background.</p>
31 <input name="victim" required />
32 <textarea name="victim" required disabled/></textarea>
33 <textarea name="victim" required readonly/></textarea>
34 <hr>
35 <ol id="console"></ol>
36 </body>
37 </html>