Changeset 196167 in webkit


Ignore:
Timestamp:
Feb 5, 2016 12:53:51 AM (8 years ago)
Author:
n_wang@apple.com
Message:

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.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r196165 r196167  
     12016-02-05  Nan Wang  <n_wang@apple.com>
     2
     3        AX: WebKit hanging when VoiceOver attempts to focus in on page
     4        https://bugs.webkit.org/show_bug.cgi?id=153899
     5        <rdar://problem/24506603>
     6
     7        Reviewed by Chris Fleizach.
     8
     9        * accessibility/text-marker/character-offset-visible-position-conversion-hang-expected.txt: Added.
     10        * accessibility/text-marker/character-offset-visible-position-conversion-hang.html: Added.
     11
    1122016-02-04  Joseph Pecoraro  <pecoraro@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r196165 r196167  
     12016-02-05  Nan Wang  <n_wang@apple.com>
     2
     3        AX: WebKit hanging when VoiceOver attempts to focus in on page
     4        https://bugs.webkit.org/show_bug.cgi?id=153899
     5        <rdar://problem/24506603>
     6
     7        Reviewed by Chris Fleizach.
     8
     9        The VisiblePosition to CharacterOffset conversion will lead to an infinite loop if the
     10        nextVisiblePostion call is returning the original VisiblePosition. Fixed it by breaking out
     11        of the loop early in that situation.
     12
     13        Test: accessibility/text-marker/character-offset-visible-position-conversion-hang.html
     14
     15        * accessibility/AXObjectCache.cpp:
     16        (WebCore::AXObjectCache::characterOffsetFromVisiblePosition):
     17
    1182016-02-04  Joseph Pecoraro  <pecoraro@apple.com>
    219
  • trunk/Source/WebCore/accessibility/AXObjectCache.cpp

    r195949 r196167  
    17541754    Position vpDeepPos = vp.deepEquivalent();
    17551755   
     1756    VisiblePosition previousVisiblePos;
    17561757    while (!vpDeepPos.isNull() && !deepPos.equals(vpDeepPos)) {
     1758        previousVisiblePos = vp;
    17571759        vp = obj->nextVisiblePosition(vp);
    17581760        vpDeepPos = vp.deepEquivalent();
     1761        // Sometimes nextVisiblePosition will give the same VisiblePostion,
     1762        // we break here to avoid infinite loop.
     1763        if (vpDeepPos.equals(previousVisiblePos.deepEquivalent()))
     1764            break;
    17591765        characterOffset++;
    17601766    }
Note: See TracChangeset for help on using the changeset viewer.