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

Side by Side Diff: LayoutTests/fast/events/relative-offset-of-simulated-click.html

Issue 316733004: MouseEvent.offsetX/Y should just return 0,0 for simulated clicks. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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
« no previous file with comments | « no previous file | LayoutTests/fast/events/relative-offset-of-simulated-click-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <script src="../../resources/js-test.js"></script>
6 </head>
7 <body>
8 <script>
9 description("This test documents the behavior of MouseEvent.offsetX/Y in respons e to HTMLElement.click().");
10
11 var testDiv = document.createElement("div");
12 testDiv.setAttribute("style", "background: green; width: 100px; height: 100px; p osition: absolute; top: 100px; left: 100px;");
13 document.body.appendChild(testDiv);
14
15 testDiv.addEventListener("click", function(e) {
16 event = e;
17 shouldBe("event.offsetX", expectedX);
18 shouldBe("event.offsetY", expectedY);
19 });
20
21 debug("Simulated click with .click():");
22 expectedX = "0";
23 expectedY = "0";
24 testDiv.click();
25
26 if (!window.eventSender)
27 debug("This part of the test requires eventSender!");
28 else {
29 debug("Click with mouse at 0,0:");
30 expectedX = "0";
31 expectedY = "0";
32 eventSender.mouseMoveTo(100, 100);
33 eventSender.mouseDown();
34 eventSender.mouseUp();
35
36 debug("Click with mouse at 40,50:");
37 expectedX = "40";
38 expectedY = "50";
39 eventSender.mouseMoveTo(140, 150);
40 eventSender.mouseDown();
41 eventSender.mouseUp();
42 }
43
44 testDiv.remove();
45
46 </script>
47 </body>
48 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/events/relative-offset-of-simulated-click-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698