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

Side by Side Diff: LayoutTests/fast/events/script-tests/page-scaled-mouse-click.js

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 description("This tests that page scaling does not affect mouse event pageX and pageY coordinates."); 1 description("This tests that page scaling does not affect mouse event pageX and pageY coordinates.");
2 2
3 var html = document.documentElement; 3 var html = document.documentElement;
4 4
5 var div = document.createElement("div"); 5 var div = document.createElement("div");
6 div.style.width = "100px"; 6 div.style.width = "100px";
7 div.style.height = "100px"; 7 div.style.height = "100px";
8 div.style.backgroundColor = "blue"; 8 div.style.backgroundColor = "blue";
9 9
10 var eventLog = ""; 10 var eventLog = "";
(...skipping 26 matching lines...) Expand all
37 37
38 function testEvents(button, description, expectedString) { 38 function testEvents(button, description, expectedString) {
39 sendEvents(button); 39 sendEvents(button);
40 debug(description); 40 debug(description);
41 shouldBeEqualToString("eventLog", expectedString); 41 shouldBeEqualToString("eventLog", expectedString);
42 debug(""); 42 debug("");
43 clearEventLog(); 43 clearEventLog();
44 } 44 }
45 45
46 if (window.eventSender && window.internals) { 46 if (window.eventSender && window.internals) {
47 // Mouse events only work after an initial layout
48 document.body.offsetLeft;
49
50 eventSender.mouseMoveTo(10, 10); 47 eventSender.mouseMoveTo(10, 10);
51 // We are clicking in the same position on screen. As we scale or transform the page, 48 // We are clicking in the same position on screen. As we scale or transform the page,
52 // we expect the pageX and pageY event coordinates to change because differe nt 49 // we expect the pageX and pageY event coordinates to change because differe nt
53 // parts of the document are under the mouse. 50 // parts of the document are under the mouse.
54 testEvents(0, "Unscaled", "click(10, 10)"); 51 testEvents(0, "Unscaled", "click(10, 10)");
55 52
56 window.internals.setPageScaleFactor(0.5, 0, 0); 53 window.internals.setPageScaleFactor(0.5, 0, 0);
57 testEvents(0, "setPageScale(0.5)", "click(20, 20)"); 54 testEvents(0, "setPageScale(0.5)", "click(20, 20)");
58 } 55 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698