| <script src="../resources/js-test-pre.js"></script> |
| <div id="content" contenteditable tabindex="0">helloworld</div> |
| if (window.accessibilityController) { |
| window.jsTestIsAsync = true; |
| var content = document.getElementById("content"); |
| var text = accessibilityController.focusedElement; |
| text.setSelectedTextRange(5, 0); |
| shouldBecomeEqual("text.selectedTextRange", "'{5, 0}'", function() { |
| var t = text.stringForRange(0, 11); |
| t = t.replace(/(?:\r\n|\r|\n)/g, '[newline]'); |
| debug("There must be only one [newline] between hello and world: " + t); |
| shouldBecomeEqual("text.selectedTextRange", "'{6, 0}'", function() { |
| var t = text.stringForRange(6, 5); |
| t = t.replace(/(?:\r\n|\r|\n)/g, '[newline]'); |
| debug("The text after the newline should be world: " + t); |
| <script src="../resources/js-test-post.js"></script> |