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

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

Issue 14859016: Don't force layout for mouse event hit tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix review comment 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
47 eventSender.mouseMoveTo(10, 10); 50 eventSender.mouseMoveTo(10, 10);
48 // We are clicking in the same position on screen. As we scale or transform the page, 51 // We are clicking in the same position on screen. As we scale or transform the page,
49 // we expect the pageX and pageY event coordinates to change because differe nt 52 // we expect the pageX and pageY event coordinates to change because differe nt
50 // parts of the document are under the mouse. 53 // parts of the document are under the mouse.
51 testEvents(0, "Unscaled", "click(10, 10)"); 54 testEvents(0, "Unscaled", "click(10, 10)");
52 55
53 window.internals.setPageScaleFactor(0.5, 0, 0); 56 window.internals.setPageScaleFactor(0.5, 0, 0);
54 testEvents(0, "setPageScale(0.5)", "click(20, 20)"); 57 testEvents(0, "setPageScale(0.5)", "click(20, 20)");
55 } 58 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/events/script-tests/mouse-click-events.js ('k') | LayoutTests/fast/events/scrollbar-double-click.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698