885f25d9bc2d2cf3d80e337739511d4ddec3df39
[WebKit-https.git] / LayoutTests / accessibility / editable-webarea-context-menu-point.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../fast/js/resources/js-test-pre.js"></script>
5 </head>
6 <body id="body" contenteditable>
7 This tests that the click point, used for opening context menus, changes based on the current selection in an editable web area.
8 This tests that the click point, used for opening context menus, changes based on the current selection in an editable web area.
9
10
11 <p id="description"></p>
12 <div id="console"></div>
13
14 <script>
15
16     description("This tests that the click point, used for opening context menus, changes based on the current selection in an editable web area (by setting the selection twice and comparing the click point locations)");
17
18     if (window.accessibilityController) {
19
20           var body = document.getElementById("body");
21           body.focus();
22
23           x = body.offsetLeft + 10;
24           y = body.offsetTop + 10;
25
26           eventSender.mouseMoveTo(x, y);
27           eventSender.mouseDown();
28           eventSender.mouseUp();
29           eventSender.mouseDown();
30           eventSender.mouseUp();
31
32           var clickPointX1 = accessibilityController.focusedElement.clickPointX;
33
34           x = body.offsetLeft + 100 + 10;
35           y = body.offsetTop + 10;
36
37           eventSender.mouseMoveTo(x, y);
38           eventSender.mouseDown();
39           eventSender.mouseUp();
40           eventSender.mouseDown();
41           eventSender.mouseUp();
42
43           var clickPointX2 = accessibilityController.focusedElement.clickPointX;
44           var succeeded = clickPointX2 != clickPointX1;
45           shouldBe("succeeded", "true");
46
47     }
48
49 </script>
50
51 <script src="../fast/js/resources/js-test-post.js"></script>
52 </body>
53 </html>