Changeset 229452 in webkit


Ignore:
Timestamp:
Mar 8, 2018 11:35:52 PM (6 years ago)
Author:
n_wang@apple.com
Message:

AX: AOM: More accessibility events support
https://bugs.webkit.org/show_bug.cgi?id=183023
<rdar://problem/37764380>

Reviewed by Chris Fleizach.

Source/WebCore:

Fixed the crash that we shouldn't dispatch the accessibility events if the
event path is empty.

Also added a check to not dispatch events if the runtime flag is not enabled.

Test: accessibility/mac/AOM-events-webarea-crash.html

  • accessibility/AccessibilityObject.cpp:

(WebCore::AccessibilityObject::shouldDispatchAccessibilityEvent const):
(WebCore::AccessibilityObject::dispatchAccessibilityEvent const):

  • accessibility/AccessibilityObject.h:

LayoutTests:

  • accessibility/mac/AOM-events-webarea-crash-expected.txt: Added.
  • accessibility/mac/AOM-events-webarea-crash.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r229451 r229452  
     12018-03-08  Nan Wang  <n_wang@apple.com>
     2
     3        AX: AOM: More accessibility events support
     4        https://bugs.webkit.org/show_bug.cgi?id=183023
     5        <rdar://problem/37764380>
     6
     7        Reviewed by Chris Fleizach.
     8
     9        * accessibility/mac/AOM-events-webarea-crash-expected.txt: Added.
     10        * accessibility/mac/AOM-events-webarea-crash.html: Added.
     11
    1122018-03-08  Chris Dumez  <cdumez@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r229448 r229452  
     12018-03-08  Nan Wang  <n_wang@apple.com>
     2
     3        AX: AOM: More accessibility events support
     4        https://bugs.webkit.org/show_bug.cgi?id=183023
     5        <rdar://problem/37764380>
     6
     7        Reviewed by Chris Fleizach.
     8
     9        Fixed the crash that we shouldn't dispatch the accessibility events if the
     10        event path is empty.
     11
     12        Also added a check to not dispatch events if the runtime flag is not enabled.
     13
     14        Test: accessibility/mac/AOM-events-webarea-crash.html
     15
     16        * accessibility/AccessibilityObject.cpp:
     17        (WebCore::AccessibilityObject::shouldDispatchAccessibilityEvent const):
     18        (WebCore::AccessibilityObject::dispatchAccessibilityEvent const):
     19        * accessibility/AccessibilityObject.h:
     20
    1212018-03-08  Megan Gardner  <megan_gardner@apple.com>
    222
  • trunk/Source/WebCore/accessibility/AccessibilityObject.cpp

    r229310 r229452  
    7171#include "RenderWidget.h"
    7272#include "RenderedPosition.h"
     73#include "RuntimeEnabledFeatures.h"
    7374#include "Settings.h"
    7475#include "TextCheckerClient.h"
     
    21532154}
    21542155
     2156bool AccessibilityObject::shouldDispatchAccessibilityEvent() const
     2157{
     2158    return RuntimeEnabledFeatures::sharedFeatures().accessibilityObjectModelEnabled();
     2159}
     2160
    21552161bool AccessibilityObject::dispatchAccessibilityEvent(Event& event) const
    21562162{
     2163    if (!shouldDispatchAccessibilityEvent())
     2164        return false;
     2165   
    21572166    Vector<Element*> eventPath;
    21582167    for (auto* parentObject = this; parentObject; parentObject = parentObject->parentObject()) {
     
    21622171            eventPath.append(parentElement);
    21632172    }
     2173   
     2174    if (!eventPath.size())
     2175        return false;
    21642176   
    21652177    EventDispatcher::dispatchEvent(eventPath, event);
  • trunk/Source/WebCore/accessibility/AccessibilityObject.h

    r229310 r229452  
    907907    bool hasTagName(const QualifiedName&) const;
    908908   
     909    bool shouldDispatchAccessibilityEvent() const;
    909910    bool dispatchAccessibilityEvent(Event&) const;
    910911    bool dispatchAccessibilityEventWithType(AccessibilityEventType) const;
Note: See TracChangeset for help on using the changeset viewer.