| Index: LayoutTests/editing/selection/click-first-letter.html
|
| diff --git a/LayoutTests/editing/selection/click-first-letter.html b/LayoutTests/editing/selection/click-first-letter.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..d2c08507fb664063f7d59c52eab413f67baf0216
|
| --- /dev/null
|
| +++ b/LayoutTests/editing/selection/click-first-letter.html
|
| @@ -0,0 +1,60 @@
|
| +<!DOCTYPE html>
|
| +<html>
|
| +<head>
|
| +<style>
|
| +.test {
|
| + font-family: monospace;
|
| +}
|
| +.test:first-letter {
|
| + color: red;
|
| +}
|
| +</style>
|
| +</head>
|
| +<body>
|
| +<div id="container">
|
| +<p id="description"></p>
|
| +<ol>
|
| +<li>Click at "a" to see caret is before "a".</li>
|
| +<li>Click between "d" and "e" to see caret is between "d" and "e"</li>
|
| +<li>Hit enter to see next line is "efgh".
|
| +</ol>
|
| +<div id="sample" contenteditable="true">
|
| +<p class="test"><span id="test">abcdefgh</span></p>
|
| +</div>
|
| +</div>
|
| +<div id="console"></div>
|
| +<script src="../../fast/js/resources/js-test-pre.js"></script>
|
| +<script>
|
| +description('Check click to set caret position with first-letter style. http://crbug.com/266334');
|
| +function $(id) { return document.getElementById(id); }
|
| +
|
| +var selection = window.getSelection();
|
| +
|
| +if (window.eventSender) {
|
| + var test = $('test');
|
| +
|
| + debug('Click at first letter');
|
| + eventSender.mouseMoveTo(test.offsetLeft + 1, test.offsetTop);
|
| + eventSender.mouseDown();
|
| + eventSender.mouseUp();
|
| +
|
| + shouldBeEqualToString('selection.type', 'Caret');
|
| + shouldBe('selection.anchorNode', 'test.firstChild');
|
| + shouldBe('selection.anchorOffset', '0');
|
| +
|
| + debug('Click at middle');
|
| + eventSender.mouseMoveTo(test.offsetLeft + test.offsetWidth / 2, test.offsetTop);
|
| + eventSender.mouseDown();
|
| + eventSender.mouseUp();
|
| +
|
| + shouldBeEqualToString('selection.type', 'Caret');
|
| + shouldBe('selection.anchorNode', 'test.firstChild');
|
| + shouldBe('selection.anchorOffset', '4');
|
| +}
|
| +
|
| +if (window.testRunner)
|
| + $('container').outerHTML = '';
|
| +</script>
|
| +<script src="../../fast/js/resources/js-test-post.js"></script>
|
| +</body>
|
| +</html>
|
|
|