Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / focus-display-block-inline.html
blob627eb4d9b52986647d46b835b59558950afae412
1 <!doctype html>
2 <html lang="en">
3 <head>
4 <title>Switch between display block and none on :focus</title>
5 <style>
6 .box {
7 width: 100px;
8 height: 100px;
9 background-color: blue;
10 color: white;
11 padding: 10px;
13 #button {
14 display: block;
15 width: 200px;
16 height: 50px;
18 #button:focus {
19 display: none;
21 </style>
23 <script src="../../resources/js-test.js"></script>
24 </head>
26 <script type="text/javascript">
27 if (window.testRunner)
28 testRunner.waitUntilDone();
30 function beginTest() {
31 if (window.eventSender) {
32 var button = document.getElementById("button");
33 button.focus();
35 release();
39 function release() {
40 if (window.eventSender) {
41 var button = document.getElementById("button");
42 var displayMode = window.getComputedStyle(button).getPropertyValue("display");
44 if (displayMode == "none")
45 testPassed("Setting display to none on focus processed OK.");
46 else
47 testFailed("Setting display to none on focus FAILED." + " (expected 'none', got '" + displayMode + "')");
49 var elementsToHide = document.getElementsByClassName('box');
50 for (var element, i = 0; element = elementsToHide[i]; i++)
51 element.style.visibility = "hidden";
53 if (window.testRunner)
54 testRunner.notifyDone();
58 </script>
60 <body onload="beginTest()">
61 <button type="button" id="button">When you hit TAB, this button should disappear.</button>
62 <div class="box">This is here to show the layout being recomputed</div>
63 </body>
64 </html>