| <!DOCTYPE html> |
| <html> |
| <head> |
| <meta charset="utf-8"> |
| <style type="text/css"> /* pertinent to test cases */ |
| .quote:before { content: "\""; } |
| .quote:after { content: "\""; } |
| |
| .bidi:before { content: "aפb"; } |
| .bidi:after { content: "aפb"; } |
| </style> |
| <script src="../../resources/js-test-pre.js"></script> |
| <title></title> |
| </head> |
| <body> |
| <p>To manually test select text below by mouse and use right arrow key to navigate across the quotes. The caret should move to the right of quote.</p> |
| |
| <div contenteditable="true" id="ltr"> |
| preceding text |
| <span class="quote">content</span> |
| following text |
| </div> |
| |
| <div contenteditable="true" id="rtl"> |
| اردو وڑ |
| <span class="quote">پروسیسرس پر</span> |
| تبصر |
| </div> |
| |
| <div contenteditable="true" id="ltr-bidi"> |
| preceding text |
| <span class="bidi">content</span> |
| following text |
| </div> |
| |
| <div contenteditable="true" id="rtl-bidi"> |
| اردو وڑ |
| <span class="bidi">پروسیسرس پر</span> |
| تبصر |
| </div> |
| <div id="console"></div> |
| <script> |
| |
| var edit = document.getElementById('ltr'); |
| edit.focus(); |
| window.getSelection().setPosition(edit, 1); |
| window.getSelection().modify('move', 'right', 'character'); |
| shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 1); |
| window.getSelection().modify('move', 'left', 'character'); |
| shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 16); |
| |
| window.getSelection().setPosition(edit, 2); |
| window.getSelection().modify('move', 'right', 'character'); |
| shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 1); |
| window.getSelection().modify('move', 'left', 'character'); |
| shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 7); |
| |
| var edit = document.getElementById('rtl'); |
| edit.focus(); |
| window.getSelection().setPosition(edit, 1); |
| window.getSelection().modify('move', 'left', 'character'); |
| shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 1); |
| window.getSelection().modify('move', 'right', 'character'); |
| shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 9); |
| window.getSelection().modify('move', 'right', 'character'); |
| shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 8); |
| window.getSelection().modify('move', 'left', 'character'); |
| shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 9); |
| |
| window.getSelection().setPosition(edit, 2); |
| window.getSelection().modify('move', 'left', 'character'); |
| shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 1); |
| window.getSelection().modify('move', 'right', 'character'); |
| shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 11); |
| window.getSelection().modify('move', 'right', 'character'); |
| shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 10); |
| window.getSelection().modify('move', 'left', 'character'); |
| shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 11); |
| |
| var edit = document.getElementById('ltr-bidi'); |
| edit.focus(); |
| window.getSelection().setPosition(edit, 1); |
| window.getSelection().modify('move', 'right', 'character'); |
| shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 1); |
| window.getSelection().modify('move', 'left', 'character'); |
| shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 16); |
| |
| window.getSelection().setPosition(edit, 2); |
| window.getSelection().modify('move', 'right', 'character'); |
| shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 1); |
| window.getSelection().modify('move', 'left', 'character'); |
| shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 7); |
| |
| var edit = document.getElementById('rtl-bidi'); |
| edit.focus(); |
| window.getSelection().setPosition(edit, 1); |
| window.getSelection().modify('move', 'right', 'character'); |
| shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 10); |
| window.getSelection().modify('move', 'left', 'character'); |
| shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 9); |
| window.getSelection().modify('move', 'left', 'character'); |
| shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 8); |
| window.getSelection().modify('move', 'right', 'character'); |
| shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 9); |
| |
| window.getSelection().setPosition(edit, 2); |
| window.getSelection().modify('move', 'right', 'character'); |
| shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 1); |
| window.getSelection().modify('move', 'left', 'character'); |
| shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 11); |
| window.getSelection().modify('move', 'left', 'character'); |
| shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 1); |
| window.getSelection().modify('move', 'right', 'character'); |
| shouldEvaluateTo(window.getSelection().anchorOffset.toString(), 11); |
| |
| |
| </script> |
| <script src="../../resources/js-test-post.js"></script> |
| </body> |
| </html> |