Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / autofocus-input-css-style-change.html
blobc36848616e2c828bd8dcce54b9ad8429104668b9
1 <!DOCYTPE html>
2 <html>
3 <style>
4 input { background: red; }
5 input:focus { background: green; }
6 </style>
7 <body>
8 <p>The following text box should have focus and should be green.</p>
9 <input type="text" id="test" autofocus onfocus="setTimeout(test, 0)">
10 <div id="result">FAIL</div>
11 <script>
12 if (window.testRunner) {
13 testRunner.dumpAsText();
14 testRunner.waitUntilDone();
17 function test() {
18 var target = document.getElementById("test");
19 target.offsetTop;
20 if (document.defaultView.getComputedStyle(target, null).getPropertyValue('background-color') == "rgb(0, 128, 0)")
21 result.innerHTML = "PASS";
22 if (window.testRunner)
23 testRunner.notifyDone();
25 </script>
26 </body>
27 </html>