AX: WebKit hanging when VoiceOver attempts to focus in on page
authorn_wang@apple.com <n_wang@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Feb 2016 08:53:51 +0000 (08:53 +0000)
committern_wang@apple.com <n_wang@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Feb 2016 08:53:51 +0000 (08:53 +0000)
commit825ad2e447276f1d3784c447152460fc76dda7a4
tree990a02f4cfeaeb985def025331d85fbb8b014e29
parent735922599278934e1b8bc0c32714b5dad61141a2
AX: WebKit hanging when VoiceOver attempts to focus in on page
https://bugs.webkit.org/show_bug.cgi?id=153899
<rdar://problem/24506603>

Reviewed by Chris Fleizach.

Source/WebCore:

The VisiblePosition to CharacterOffset conversion will lead to an infinite loop if the
nextVisiblePostion call is returning the original VisiblePosition. Fixed it by breaking out
of the loop early in that situation.

Test: accessibility/text-marker/character-offset-visible-position-conversion-hang.html

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::characterOffsetFromVisiblePosition):

LayoutTests:

* accessibility/text-marker/character-offset-visible-position-conversion-hang-expected.txt: Added.
* accessibility/text-marker/character-offset-visible-position-conversion-hang.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@196167 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/accessibility/text-marker/character-offset-visible-position-conversion-hang-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/text-marker/character-offset-visible-position-conversion-hang.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AXObjectCache.cpp