haikuwebkit/LayoutTests/accessibility/text-marker
Nan Wang 8c5d1c59e6 AX: CharacterOffset not working correctly with composed characters and collapsed white spaces
https://bugs.webkit.org/show_bug.cgi?id=157190

Reviewed by Chris Fleizach.

Source/WebCore:

When navigating emoji, next/previous text marker call is only moving by one character. Fixed it by
using the helper function in Position to get the real character count for the composed character sequence.
Also there's another issue with collapsed white spaces, TextIterator emits only one space. So we have to
use the actual space length to create the CharacterOffset in order to generate valid Range object from it.

New test cases in accessibility/text-marker/text-marker-previous-next.html.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::traverseToOffsetInRange):
(WebCore::AXObjectCache::textMarkerDataForNextCharacterOffset):
(WebCore::AXObjectCache::textMarkerDataForPreviousCharacterOffset):
(WebCore::AXObjectCache::nextNode):
(WebCore::AXObjectCache::characterOffsetFromVisiblePosition):
(WebCore::AXObjectCache::nextCharacterOffset):
(WebCore::AXObjectCache::previousCharacterOffset):
(WebCore::AXObjectCache::startCharacterOffsetOfWord):

LayoutTests:

* accessibility/mac/text-marker-word-nav.html:
* accessibility/text-marker/text-marker-previous-next-expected.txt:
* accessibility/text-marker/text-marker-previous-next.html:


Canonical link: https://commits.webkit.org/175298@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200258 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-29 20:05:07 +00:00
..
character-offset-visible-position-conversion-hang-expected.txt AX: WebKit hanging when VoiceOver attempts to focus in on page 2016-02-05 08:53:51 +00:00
character-offset-visible-position-conversion-hang.html AX: WebKit hanging when VoiceOver attempts to focus in on page 2016-02-05 08:53:51 +00:00
text-marker-previous-next-expected.txt AX: CharacterOffset not working correctly with composed characters and collapsed white spaces 2016-04-29 20:05:07 +00:00
text-marker-previous-next.html AX: CharacterOffset not working correctly with composed characters and collapsed white spaces 2016-04-29 20:05:07 +00:00
text-marker-range-stale-node-crash-expected.txt AX: crash at WebCore::Range::selectNodeContents(WebCore::Node*, int&) 2016-02-09 03:04:20 +00:00
text-marker-range-stale-node-crash.html AX: crash at WebCore::Range::selectNodeContents(WebCore::Node*, int&) 2016-02-09 03:04:20 +00:00
text-marker-range-with-removed-node-crash-expected.txt
text-marker-range-with-removed-node-crash.html
text-marker-with-user-select-none-expected.txt
text-marker-with-user-select-none.html