Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(307)

Side by Side Diff: LayoutTests/fast/css/hover-display-block-inline.html

Issue 16599003: :hover style not applied on hover if its display property is different from original style's (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch (fixed test that was expected to fail and is now passing) Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!doctype html>
2 <html lang="en">
3 <head>
4 <title>Switch between display block and inline on :hover</title>
5 <style>
6 .box {
7 width: 100px;
8 height: 100px;
9 }
10 #dummy {
11 background-color: black;
12 }
13 #hoverTest {
14 border: 5px solid green;
15 border-left: 100px solid green;
16 color: black;
17 display: block;
18 }
19 #hoverTest:hover {
20 border-color: darkred;
21 display: inline;
22 }
23 #after_hoverTest {
24 background-color: blue;
25 color: white;
26 padding: 10px;
27 }
28 </style>
29
30 <script src="../js/resources/js-test-pre.js"></script>
31 </head>
32
33 <body>
34 <div id="dummy" class="box"></div>
35 <div id="hoverTest" class="box">When hovered, this box's display will sw itch from <b>block</b> to <b>inline</b></div>
36 <div id="after_hoverTest" class="box">This is here to show the layout be ing recomputed</div>
37
38 <script type="text/javascript">
39 if (window.testRunner)
40 testRunner.waitUntilDone();
41
42 function beginTest() {
43 if (window.eventSender) {
44 var hoverTest = document.getElementById("hoverT est");
45
46 // move mouse on the hover test object
47 eventSender.mouseMoveTo(hoverTest.offsetLeft + 5 0, hoverTest.offsetTop + 10);
48 eventSender.mouseDown(0);
49
50 release();
51 }
52 }
53
54 function release() {
55 if (window.eventSender) {
56 var hoverTest = document.getElementById("hoverT est");
57 var displayMode = window.getComputedStyle(hoverT est).getPropertyValue("display");
58
59 if (displayMode == "inline")
60 testPassed("Setting display to inline on hover processed OK.");
61 else
62 testFailed("Setting display to inline on hover FAILED." + " (expected 'inline', got '" + displayMode + "')");
63
64 var elementsToHide = document.getElementsByClass Name('box');
65 for (var element, i = 0; element = elementsToHid e[i]; i++)
66 element.style.visibility = "hidden";
67
68 eventSender.mouseUp(0);
69
70 if (window.testRunner)
71 testRunner.notifyDone();
72 }
73 }
74
75 beginTest();
76 </script>
77 </body>
78 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698