| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| <html> |
| <head> |
| <script src="../../resources/js-test-pre.js"></script> |
| <script> |
| if (window.testRunner) |
| testRunner.dumpAsText(); |
| </script> |
| </head> |
| <body> |
| |
| <div contenteditable=true id="content" role="textbox"> |
| |
| word mispelled word |
| |
| </div> |
| |
| |
| <p id="description"></p> |
| <div id="console"></div> |
| |
| <script> |
| |
| description("This tests that if the cursor is on a misspelled word, the misspelled marker will still be returned for that range. The test places selection in the middle of 'mispelled' and then queries for the attributed string."); |
| |
| if (window.accessibilityController) { |
| var content = document.getElementById("content"); |
| content.focus(); |
| |
| var s = window.getSelection(); |
| s.setPosition(content, 0); |
| for (var k = 0; k < 10; k++) { |
| s.modify("move", "forward", "character"); |
| } |
| |
| var text = accessibilityController.focusedElement; |
| var attrString = text.attributedStringForRange(0, document.getElementById("content").innerText.length); |
| |
| shouldBeTrue("attrString.indexOf('AXMisspelled = 1') != -1"); |
| } |
| |
| </script> |
| |
| <script src="../../resources/js-test-post.js"></script> |
| |
| </body> |
| </html> |
| |