4 <textarea id="editor" cols="50" rows="5">
6 <script src="../../fast/js/resources/js-test-pre.js"></script>
9 if (window.testRunner) {
10 testRunner.dumpAsText();
11 internals.setAutomaticLinkDetectionEnabled(true);
12 internals.setAutomaticQuoteSubstitutionEnabled(true);
15 description('Test inserting a character inside a URL with both smart quote and smart link doesn\'t move the caret to the end of text\n'
16 + 'To manually run this test, enable "Check Spelling While Typing", "Smart Link", and "Smart Quotes", and insert a character inside the URL');
18 var editor = document.getElementById('editor');
20 document.execCommand('InsertText', false, 'Why don\u2019t you take a look at https:/webkit.org/');
21 for (var i = 0; i < 'webkit.org/'.length; i++)
22 getSelection().modify('move', 'backward', 'character');
23 shouldBe('caretOffset = editor.selectionStart; caretOffset', 'editor.selectionEnd');
25 document.execCommand('InsertText', false, '/');
27 shouldBe('editor.selectionStart', 'caretOffset + 1');
28 shouldBe('editor.selectionEnd', 'caretOffset + 1');
30 editor.style.display = 'none';