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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/css/hover-affects-child.html

Issue 1890743002: Reland of ix getComputedStyle positioned element values (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 4 years, 8 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
1 <html> 1 <html>
2 <head> 2 <head>
3 <style> 3 <style>
4 div { 4 div {
5 width: 200px; 5 width: 200px;
6 height: 200px; 6 height: 200px;
7 background-color: red; 7 background-color: red;
8 } 8 }
9 9
10 div div { 10 div div {
(...skipping 14 matching lines...) Expand all
25 console.appendChild(newNode); 25 console.appendChild(newNode);
26 } 26 }
27 var testedHoverState = false; 27 var testedHoverState = false;
28 function testHoverState() { 28 function testHoverState() {
29 if (testedHoverState) 29 if (testedHoverState)
30 return; 30 return;
31 testedHoverState = true; 31 testedHoverState = true;
32 var innerElem = document.getElementById('innerElem'); 32 var innerElem = document.getElementById('innerElem');
33 var calculatedStyle = window.getComputedStyle(innerElem); 33 var calculatedStyle = window.getComputedStyle(innerElem);
34 34
35 if (calculatedStyle.getPropertyValue('left') == "auto") 35 if (calculatedStyle.getPropertyValue('left') == "8px")
36 log("PASSED: Calculated style of inner element is correct"); 36 log("PASSED: Calculated style of inner element is correct");
37 else 37 else
38 log("FAILED: Calculated style of inner element is wrong, sho uld be 'left: auto'"); 38 log("FAILED: Calculated style of inner element is wrong, sho uld be 'left: 8px'");
39 } 39 }
40 40
41 function runTest() { 41 function runTest() {
42 if (!window.testRunner) 42 if (!window.testRunner)
43 return; 43 return;
44 testRunner.dumpAsText(); 44 testRunner.dumpAsText();
45 var targetElem = document.getElementById('targetElem'); 45 var targetElem = document.getElementById('targetElem');
46 eventSender.mouseMoveTo(targetElem.offsetLeft + targetElem.offse tWidth / 2, 46 eventSender.mouseMoveTo(targetElem.offsetLeft + targetElem.offse tWidth / 2,
47 targetElem.offsetTop + targetElem.offset Height / 2); 47 targetElem.offsetTop + targetElem.offset Height / 2);
48 } 48 }
49 </script> 49 </script>
50 </head> 50 </head>
51 <body onload="runTest()"> 51 <body onload="runTest()">
52 This tests that a style that affects child elements when hovering 52 This tests that a style that affects child elements when hovering
53 over a parent element correctly recalculates the child style. To 53 over a parent element correctly recalculates the child style. To
54 test manually move the mouse over the red square, it should become 54 test manually move the mouse over the red square, it should become
55 green. 55 green.
56 <div id="targetElem" onmousemove="testHoverState()"><div id="innerElem"> </div></div> 56 <div id="targetElem" onmousemove="testHoverState()"><div id="innerElem"> </div></div>
57 <ul id="console"></ul> 57 <ul id="console"></ul>
58 <body> 58 <body>
59 </html> 59 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698