| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| <html> |
| <head><meta charset="UTF-8"></head> |
| <script src="../../resources/js-test-pre.js"></script> |
| <body id="body" tabindex="0"> |
| <div tabindex="0" id="text" contenteditable=true> |
| Hi 😎 |
| </div> |
| |
| <p id="description"></p> |
| <div id="console"></div> |
| |
| <script> |
| |
| description("This tests that CharacterOffset and VisiblePosition convert correctly when there are composed characters."); |
| |
| var index = 0; |
| if (window.accessibilityController) { |
| accessibilityController.enableEnhancedAccessibility(true); |
| var webArea = accessibilityController.rootElement.childAtIndex(0); |
| webArea.setBoolAttributeValue("AXCaretBrowsingEnabled", true); |
| |
| document.getElementById("text").focus(); |
| var text = accessibilityController.accessibleElementById("text"); |
| |
| eventSender.keyDown("rightArrow"); |
| eventSender.keyDown("rightArrow"); |
| eventSender.keyDown("rightArrow"); |
| eventSender.keyDown("rightArrow"); |
| var textMarkerRange = text.selectedTextMarkerRange(); |
| var elementRange = text.textMarkerRangeForElement(text); |
| var startMarker = text.startTextMarkerForTextMarkerRange(elementRange); |
| var endMarker = text.endTextMarkerForTextMarkerRange(textMarkerRange); |
| debug(text.stringForTextMarkerRange(text.textMarkerRangeForMarkers(endMarker, startMarker))); |
| } |
| |
| </script> |
| |
| <script src="../../resources/js-test-post.js"></script> |
| |
| </body> |
| </html> |
| |