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

Side by Side Diff: LayoutTests/fast/css/hover-display-block-none.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 none 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 width: 230px;
19 }
20 #hoverTest:hover {
21 border-color: darkred;
22 display: none;
23 }
24 #after_hoverTest {
25 background-color: blue;
26 color: white;
27 padding: 10px;
28 }
29 </style>
30
31 <script src="../js/resources/js-test-pre.js"></script>
32 </head>
33
34 <body>
35 <div id="dummy" class="box"></div>
36 <div id="hoverTest" class="box">When hovered, this box's display will sw itch from <b>block</b> to <b>none</b> (click on it and keep the mouse button pus hed to avoid flicker and get a more clear view)</div>
37 <div id="after_hoverTest" class="box">This is here to show the layout be ing recomputed</div>
38
39 <script type="text/javascript">
40 if (window.testRunner)
41 testRunner.waitUntilDone();
42
43 function beginTest() {
44 if (window.eventSender) {
45 var hoverTest = document.getElementById("hoverT est");
46
47 // move mouse on the hover test object
48 eventSender.mouseMoveTo(hoverTest.offsetLeft + 5 0, hoverTest.offsetTop + 10);
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 == "none")
60 testPassed("Setting display to none on h over processed OK.");
61 else
62 testFailed("Setting display to none on h over FAILED." + " (expected 'none', 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 if (window.testRunner)
69 testRunner.notifyDone();
70 }
71 }
72
73 beginTest();
74 </script>
75 </body>
76 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698