Changeset 215705 in webkit


Ignore:
Timestamp:
Apr 24, 2017 5:05:20 PM (7 years ago)
Author:
n_wang@apple.com
Message:

AX: Crash at WebCore::AXObjectCache::characterOffsetForIndex(int, WebCore::AccessibilityObject const*) + 703
https://bugs.webkit.org/show_bug.cgi?id=171247

Reviewed by Chris Fleizach.

Source/WebCore:

Crashed because we were passing a nil node into rootAXEditableElement(). Fixed it by
adding a null check.

Test: accessibility/mac/input-string-for-range-crash.html

  • accessibility/AXObjectCache.cpp:

(WebCore::AXObjectCache::characterOffsetForIndex):

LayoutTests:

  • accessibility/mac/input-string-for-range-crash-expected.txt: Added.
  • accessibility/mac/input-string-for-range-crash.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r215703 r215705  
     12017-04-24  Nan Wang  <n_wang@apple.com>
     2
     3        AX: Crash at WebCore::AXObjectCache::characterOffsetForIndex(int, WebCore::AccessibilityObject const*) + 703
     4        https://bugs.webkit.org/show_bug.cgi?id=171247
     5
     6        Reviewed by Chris Fleizach.
     7
     8        * accessibility/mac/input-string-for-range-crash-expected.txt: Added.
     9        * accessibility/mac/input-string-for-range-crash.html: Added.
     10
    1112017-04-24  Youenn Fablet  <youenn@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r215703 r215705  
     12017-04-24  Nan Wang  <n_wang@apple.com>
     2
     3        AX: Crash at WebCore::AXObjectCache::characterOffsetForIndex(int, WebCore::AccessibilityObject const*) + 703
     4        https://bugs.webkit.org/show_bug.cgi?id=171247
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Crashed because we were passing a nil node into rootAXEditableElement(). Fixed it by
     9        adding a null check.
     10
     11        Test: accessibility/mac/input-string-for-range-crash.html
     12
     13        * accessibility/AXObjectCache.cpp:
     14        (WebCore::AXObjectCache::characterOffsetForIndex):
     15
    1162017-04-24  Youenn Fablet  <youenn@apple.com>
    217
  • trunk/Source/WebCore/accessibility/AXObjectCache.cpp

    r215173 r215705  
    26382638            if ((validate.node->isTextNode() || characterOffsetNodeIsBR(validate))) {
    26392639                CharacterOffset next = nextCharacterOffset(validate, false);
    2640                 if (!next.offset && rootAXEditableElement(next.node) == rootAXEditableElement(validate.node))
     2640                if (!next.isNull() && !next.offset && rootAXEditableElement(next.node) == rootAXEditableElement(validate.node))
    26412641                    result = next;
    26422642            }
Note: See TracChangeset for help on using the changeset viewer.