| <!DOCTYPE html> |
| <html> |
| <body> |
| <p>This test checks moving to the previous word boundary across multiple text nodes.<br> |
| For example, when "I" and "'ll" are put in a separate text node, we should not erroneously report the previous word boundary to be between "'" and "ll".</p> |
| <div id="tests" style="font-size: 20px;" > |
| <div contenteditable><span>I</span>'ll</div> |
| <div contenteditable><span>I'</span>ll</div> |
| <div contenteditable><span>I'l</span>l</div> |
| <div contenteditable>I'<span>ll</span></div> |
| <div contenteditable>I<span>'l</span>l</div> |
| <div contenteditable><span>e</span>́'ll</div> |
| <div contenteditable><span>é</span>'ll</div> |
| <div contenteditable><span>é'</span>ll</div> |
| <div contenteditable><span>é'l</span>l</div> |
| <div contenteditable>e<span>́</span>'ll</div> |
| <div contenteditable>e<span>́'</span>ll</div> |
| <div contenteditable>e<span>́'l</span>l</div> |
| <div contenteditable>e<span>́'ll</span></div> |
| <div contenteditable>é<span>'</span>ll</div> |
| <div contenteditable>é<span>'l</span>l</div> |
| <div contenteditable>é<span>'ll</span></div> |
| <div contenteditable>é<span>'</span>ll</div> |
| <div contenteditable>é<span>'l</span>l</div> |
| <div contenteditable>é<span>'ll</span></div> |
| <div contenteditable>é'<span>l</span>l</div> |
| </div> |
| <script src="../../resources/js-test-pre.js"></script> |
| <script> |
| |
| function selectWordBackward(container) { |
| getSelection().collapse(container, container.childNodes.length); |
| getSelection().modify('extend', 'backward', 'word'); |
| } |
| |
| var tests = document.getElementById('tests').children; |
| for (var i = 0; i < tests.length; i++) { |
| var container = tests[i]; |
| shouldBeEqualToString("selectWordBackward(container); /* " + container.innerHTML + " */ getSelection().toString();", container.textContent); |
| } |
| document.getElementById('tests').style.display = 'none'; |
| |
| </script> |
| </body> |
| </html> |