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

Side by Side Diff: LayoutTests/fast/dom/Window/window-xy-properties.html

Issue 15508003: Revert "Don't force layout for mouse event hit tests" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
OLDNEW
1 <head> 1 <head>
2 <script src="../../js/resources/js-test-pre.js"></script> 2 <script src="../../js/resources/js-test-pre.js"></script>
3 <script> 3 <script>
4 var nrmouseclicks = 0; // small hack to distinguish between clicks 4 var nrmouseclicks = 0; // small hack to distinguish between clicks
5 var ev; 5 var ev;
6 function mouseev(event) { 6 function mouseev(event) {
7 if (nrmouseclicks == 0) { 7 if (nrmouseclicks == 0) {
8 shouldBe("event.clientX", "50"); 8 shouldBe("event.clientX", "50");
9 shouldBe("event.clientY", "50"); 9 shouldBe("event.clientY", "50");
10 shouldBe("event.pageX", "50"); 10 shouldBe("event.pageX", "50");
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 shouldBe("ev.pageY", "550"); 48 shouldBe("ev.pageY", "550");
49 shouldBe("ev.layerX", "550"); 49 shouldBe("ev.layerX", "550");
50 shouldBe("ev.layerY", "550"); 50 shouldBe("ev.layerY", "550");
51 shouldBe("ev.offsetX", "542"); 51 shouldBe("ev.offsetX", "542");
52 shouldBe("ev.offsetY", "542"); 52 shouldBe("ev.offsetY", "542");
53 } 53 }
54 } 54 }
55 function test() { 55 function test() {
56 if (window.testRunner) { 56 if (window.testRunner) {
57 testRunner.dumpAsText(); 57 testRunner.dumpAsText();
58 // Mouse events only work after an initial layout
59 document.body.offsetLeft;
60 // test a normal mouse to 58 // test a normal mouse to
61 eventSender.mouseMoveTo(50, 50); 59 eventSender.mouseMoveTo(50, 50);
62 eventSender.mouseDown(); 60 eventSender.mouseDown();
63 eventSender.mouseUp(); 61 eventSender.mouseUp();
64 62
65 // now scroll a bit down and verify that clientY does not change 63 // now scroll a bit down and verify that clientY does not change
66 window.scrollTo(0, 500); 64 window.scrollTo(0, 500);
67 eventSender.mouseDown(); 65 eventSender.mouseDown();
68 eventSender.mouseUp(); 66 eventSender.mouseUp();
69 67
70 // now scroll a bit to the right and verify that clientX does not change 68 // now scroll a bit to the right and verify that clientX does not change
71 window.scrollTo(500, 0); 69 window.scrollTo(500, 0);
72 eventSender.mouseDown(); 70 eventSender.mouseDown();
73 eventSender.mouseUp(); 71 eventSender.mouseUp();
74 } 72 }
75 } 73 }
76 </script> 74 </script>
77 </head> 75 </head>
78 <body onload="test()"> 76 <body onload="test()">
79 <div id="target" style="background: red; width:2000px; height: 2000px" onmousedo wn="mouseev(event)"> 77 <div id="target" style="background: red; width:2000px; height: 2000px" onmousedo wn="mouseev(event)">
80 </div> 78 </div>
81 <div id="console"></div> 79 <div id="console"></div>
82 </body> 80 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698