Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dynamic / hover-before-position-after-style-change.html
blobe822d4e20df569675fa62da596cda06e3197df2d
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <style>
5 div { width:100px; height:100px;}
6 div#outsideDiv:before { content:"> "; }
7 div#outsideDiv:hover:before { content:"< "; }
8 </style>
9 <p>
10 Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=56401">https://bugs.webkit.org/show_bug.cgi?id=56401</a>
11 Hover the mouse over the "Inline" text. The test passes if "Inline" is not placed on a new line.
12 </p>
13 </head>
14 <body>
15 <div id="console"></div>
16 <div id="outsideDiv" onmouseover="checkTestResult()">
17 <span>Inline</span>
18 <div id="insideDiv">Block</p>
19 </div>
20 <script>
21 function getElementTop(elementId)
23 var elem = document.getElementById(elementId);
24 return elem.getBoundingClientRect().top;
27 function simulateMouseMove()
29 var outsideDivTop = getElementTop("outsideDiv");
30 if (window.eventSender)
31 eventSender.mouseMoveTo(50, outsideDivTop);
34 function checkTestResult()
36 var outsideDivTop = getElementTop("outsideDiv");
37 var insideDivTop = getElementTop("insideDiv");
38 document.getElementById("console").innerText = (insideDivOriginalTop != insideDivTop) ? "FAIL" : "PASS";
39 if (window.testRunner)
40 document.getElementById("outsideDiv").style.visibility = 'hidden';
43 if (window.testRunner)
44 testRunner.dumpAsText();
46 document.body.offsetTop;
47 // Capture the initial values for inside div top
48 var insideDivOriginalTop = getElementTop("insideDiv");
50 if (window.testRunner) {
51 simulateMouseMove();
52 checkTestResult();
54 </script>
55 </body>
56 </html>