Changeset 241190 in webkit


Ignore:
Timestamp:
Feb 8, 2019 12:37:26 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Source/WebCore:
When performing AXPress, check to see if the menu list is disabled.
https://bugs.webkit.org/show_bug.cgi?id=193878

Patch by Eric Liang <ericliang@apple.com> on 2019-02-08
Reviewed by Chris Fleizach.

Test: accessibility/mac/press-not-work-for-disabled-menu-list.html

  • accessibility/AXObjectCache.h:
  • accessibility/AccessibilityMenuList.cpp:

(WebCore::AccessibilityMenuList::press):

  • accessibility/mac/AXObjectCacheMac.mm:

(WebCore::AXObjectCache::postPlatformNotification):

LayoutTests:
Check if receive AXPressDidFail notification when performing AXPress action on disabled MenuList.
https://bugs.webkit.org/show_bug.cgi?id=193878

Patch by Eric Liang <ericliang@apple.com> on 2019-02-08
Reviewed by Chris Fleizach.

  • accessibility/mac/press-not-work-for-disabled-menu-list.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r241189 r241190  
     12019-02-08  Eric Liang  <ericliang@apple.com>
     2
     3        Check if receive AXPressDidFail notification when performing AXPress action on disabled MenuList.
     4        https://bugs.webkit.org/show_bug.cgi?id=193878
     5
     6        Reviewed by Chris Fleizach.
     7
     8        * accessibility/mac/press-not-work-for-disabled-menu-list.html: Added.
     9
    1102019-02-07  Devin Rousso  <drousso@apple.com>
    211
  • trunk/Source/WebCore/ChangeLog

    r241189 r241190  
     12019-02-08  Eric Liang  <ericliang@apple.com>
     2
     3        When performing AXPress, check to see if the menu list is disabled.
     4        https://bugs.webkit.org/show_bug.cgi?id=193878
     5
     6        Reviewed by Chris Fleizach.
     7
     8        Test: accessibility/mac/press-not-work-for-disabled-menu-list.html
     9
     10        * accessibility/AXObjectCache.h:
     11        * accessibility/AccessibilityMenuList.cpp:
     12        (WebCore::AccessibilityMenuList::press):
     13        * accessibility/mac/AXObjectCacheMac.mm:
     14        (WebCore::AXObjectCache::postPlatformNotification):
     15
    1162019-02-07  Devin Rousso  <drousso@apple.com>
    217
  • trunk/Source/WebCore/accessibility/AXObjectCache.h

    r241183 r241190  
    292292        AXExpandedChanged,
    293293        AXInvalidStatusChanged,
     294        AXPressDidSucceed,
     295        AXPressDidFail,
    294296        AXPressedStateChanged,
    295297        AXReadOnlyStatusChanged,
  • trunk/Source/WebCore/accessibility/AccessibilityMenuList.cpp

    r237266 r241190  
    4646{
    4747#if !PLATFORM(IOS_FAMILY)
    48     RenderMenuList* menuList = static_cast<RenderMenuList*>(renderer());
    49     if (menuList->popupIsVisible())
    50         menuList->hidePopup();
    51     else
    52         menuList->showPopup();
     48    auto element = this->element();
     49    AXObjectCache::AXNotification notification = AXObjectCache::AXPressDidFail;
     50    if (element && !element->isDisabledFormControl() && is<RenderMenuList>(renderer())) {
     51        RenderMenuList* menuList = downcast<RenderMenuList>(renderer());
     52        if (menuList->popupIsVisible())
     53            menuList->hidePopup();
     54        else
     55            menuList->showPopup();
     56        notification = AXObjectCache::AXPressDidSucceed;
     57    }
     58    if (auto cache = axObjectCache())
     59        cache->postNotification(element, notification);
    5360    return true;
    54 #else
     61#endif
    5562    return false;
    56 #endif
    5763}
    5864
  • trunk/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm

    r240773 r241190  
    347347            macNotification = (id)kAXMenuItemSelectedNotification;
    348348            break;
     349        case AXPressDidSucceed:
     350            macNotification = @"AXPressDidSucceed";
     351            break;
     352        case AXPressDidFail:
     353            macNotification = @"AXPressDidFail";
     354            break;
    349355        case AXMenuOpened:
    350356            macNotification = (id)kAXMenuOpenedNotification;
Note: See TracChangeset for help on using the changeset viewer.