Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / pseudo-required-optional-001.html
blob1e090001ff7a07d3a0e200a5f76c07830413a224
1 <html>
2 <head>
3 <title>required/optional CSS pseudoclasses</title>
4 <style>
5 input:required { background: lime; }
6 textarea:required { background: lime; }
7 input { background: red; }
8 textarea { background: red; }
9 input:optional { background: red; }
10 textarea:optional { background: red; }
11 </style>
12 <script language="JavaScript" type="text/javascript">
13 function log(message) {
14 document.getElementById("console").innerHTML += "<li>"+message+"</li>";
17 function test() {
18 if (window.testRunner)
19 testRunner.dumpAsText();
21 v = document.getElementsByName("victim");
23 for (i = 0; i < v.length; i++)
24 if (document.defaultView.getComputedStyle(v[i], null).getPropertyValue('background-color') == "rgb(0, 255, 0)")
25 log("SUCCESS");
26 else
27 log("FAILURE");
29 </script>
30 </head>
31 <body onload="test()">
32 <p>All controls should have a green background.</p>
33 <input name="victim" required />
34 <textarea name="victim" required /></textarea>
35 <hr>
36 <ol id="console"></ol>
37 </body>
38 </html>