Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / pseudo-required-optional-002.html
blobe6a4a05b10de0edae6dabb6112d7eed7cd0c8b2f
1 <html>
2 <head>
3 <title>required/optional CSS pseudoclasses part 2</title>
4 <style>
5 input:optional { background: lime; }
6 textarea:optional { 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.testRunner)
17 testRunner.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"/>
32 <textarea name="victim" /></textarea>
33 <hr>
34 <ol id="console"></ol>
35 </body>
36 </html>