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

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

Issue 13871003: Fixing getComputedStyle to return pixel values for left / right / top / bottom (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixing a const issue. Created 7 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 13 matching lines...) Expand all
24 newNode.innerText = msg; 24 newNode.innerText = msg;
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 var propertyValue = calculatedStyle.getPropertyValue('left');
36 if (propertyValue == "8px")
36 log("PASSED: Calculated style of inner element is correct"); 37 log("PASSED: Calculated style of inner element is correct");
37 else 38 else
38 log("FAILED: Calculated style of inner element is wrong, sho uld be 'left: auto'"); 39 log("FAILED: Calculated style of inner element is wrong, sho uld be '800px' was '" + propertyValue + "'");
39 } 40 }
40 41
41 function runTest() { 42 function runTest() {
42 if (!window.testRunner) 43 if (!window.testRunner)
43 return; 44 return;
44 testRunner.dumpAsText(); 45 testRunner.dumpAsText();
45 var targetElem = document.getElementById('targetElem'); 46 var targetElem = document.getElementById('targetElem');
46 eventSender.mouseMoveTo(targetElem.offsetLeft + targetElem.offse tWidth / 2, 47 eventSender.mouseMoveTo(targetElem.offsetLeft + targetElem.offse tWidth / 2,
47 targetElem.offsetTop + targetElem.offset Height / 2); 48 targetElem.offsetTop + targetElem.offset Height / 2);
48 } 49 }
49 </script> 50 </script>
50 </head> 51 </head>
51 <body onload="runTest()"> 52 <body onload="runTest()">
52 This tests that a style that affects child elements when hovering 53 This tests that a style that affects child elements when hovering
53 over a parent element correctly recalculates the child style. To 54 over a parent element correctly recalculates the child style. To
54 test manually move the mouse over the red square, it should become 55 test manually move the mouse over the red square, it should become
55 green. 56 green.
56 <div id="targetElem" onmousemove="testHoverState()"><div id="innerElem"> </div></div> 57 <div id="targetElem" onmousemove="testHoverState()"><div id="innerElem"> </div></div>
57 <ul id="console"></ul> 58 <ul id="console"></ul>
58 <body> 59 <body>
59 </html> 60 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698