7 if (!window
.testRunner
)
10 testRunner
.dumpAsText();
12 var target
= document
.getElementById("test");
14 x
= target
.offsetLeft
+ target
.offsetWidth
- 10;
15 y
= target
.offsetTop
+ target
.offsetHeight
- 10;
17 eventSender
.mouseMoveTo(x
, y
);
18 eventSender
.mouseDown();
19 eventSender
.mouseUp();
22 function setTestResultMessage()
24 var line2Text
= document
.getElementById("line2").firstChild
;
26 var result
= "FAILED";
27 if (getSelection().rangeCount
!== 1)
28 result
= "FAILED: Selection had range count of " + getSelection().rangeCount
;
29 else if (getSelection().getRangeAt(0).startContainer
!== line2Text
)
30 result
= "FAILED: Selection was not within second line of text.";
31 else if (getSelection().getRangeAt(0).endContainer
!== line2Text
)
32 result
= "FAILED: Selection end was not within second line of text.";
33 else if (getSelection().getRangeAt(0).startOffset
!== getSelection().getRangeAt(0).endOffset
)
34 result
= "FAILED: Selection was not a caret.";
35 else if (getSelection().getRangeAt(0).startOffset
!== 6)
36 result
= "FAILED: Selection was not at the end of the line.";
40 document
.getElementById("message").firstChild
.data
= result
;
45 <body onload=
"runTest()" onclick=
"setTestResultMessage()">
47 This is a test for a bug where clicking below a block didn't work right if
48 the block was nested inside an inline.
51 To test interactively, click below and to the right of the
2 in line
2.
52 The caret should appear after the
2.
54 <p id=
"message">TEST HAS NOT RUN YET
</p>
56 <div contenteditable
id=
"test" style=
"font-size: 48px; width: 250px; height: 250px"><div>line
1</div><div><span><div id=
"line2">line
2</div></span></div></div>