Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / selection / click-on-body-margin.html
blob3705d8cbe0b1b72ea6b751a61532980112e49476
1 <!DOCTYPE html>
2 <html>
3 <body style="white-space: nowrap; margin:100px; border: solid 1px black;" contenteditable>
4 <span id="firstLine">Click on the right of this line outside the black box.</span><br>
5 <span id="longLine">The caret should be placed on the right of the first line, NOT on the right of this line.
6 <span></span></span>
7 <pre><script>
9 var longLine = document.getElementById('longLine');
10 while (longLine.offsetWidth < document.body.offsetWidth + 200)
11 longLine.lastChild.textContent += ' some text';
13 if (window.testRunner) {
14 testRunner.dumpAsText();
16 var firstLine = document.getElementById('firstLine');
17 eventSender.mouseMoveTo(firstLine.offsetLeft + document.body.offsetWidth + 10,
18 firstLine.offsetTop + firstLine.offsetHeight / 2);
19 eventSender.mouseDown();
20 eventSender.mouseUp();
22 if (!getSelection().isCollapsed)
23 document.writeln('FAIL - selection was not collapsed');
24 else if (getSelection().baseNode != firstLine.firstChild)
25 document.writeln('FAIL - caret was not in the first line');
26 else if (getSelection().baseOffset != firstLine.textContent.length)
27 document.writeln('FAIL - caret was not on the right edge');
28 else
29 document.writeln('PASS');
31 longLine.lastChild.style.display = 'none';
34 </script></pre>
35 </body>
36 </html>