4 <style type=
"text/css">
7 margin: 0px 24px 0px 0px;
8 padding: 23px 0px 0px 175px;
15 border: 1px solid black
;
22 <h1 id=
"title">Word selection on right click test
</h1>
23 This tests to make sure that right clicking non-editable content only creates a word selection for clicks over text.
<span id=
"word">To
</span> run manually, right click on text, and a word should be selected. Right click on the empty space outside and to the right of the black border, the selection should be removed.
27 if (window
.testRunner
) {
28 // Make sure that right click is not a no-op (selects a word).
29 word
= document
.getElementById("word");
30 x
= word
.offsetParent
.offsetLeft
+ word
.offsetLeft
+ word
.offsetWidth
/ 2;
31 y
= word
.offsetParent
.offsetTop
+ word
.offsetTop
+ word
.offsetHeight
/ 2;
32 eventSender
.mouseMoveTo(x
, y
);
33 eventSender
.contextClick();
37 x
= body
.offsetLeft
+ body
.offsetWidth
+ 10;
38 y
= body
.offsetTop
+ body
.offsetHeight
- 10;
39 eventSender
.mouseMoveTo(x
, y
);
40 eventSender
.contextClick();