WebKit Bugzilla
Attachment 361070 Details for
Bug 193878
: AX: VoiceOver allows to interact with a disabled <select> element
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193878-20190204101549.patch (text/plain), 7.86 KB, created by
Eric Liang
on 2019-02-04 10:15:50 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Eric Liang
Created:
2019-02-04 10:15:50 PST
Size:
7.86 KB
patch
obsolete
>Subversion Revision: 240928 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index cfb0ee9443fc4f0c2569637ec0ca8a029dcf3321..9f75b9ed1b8619d19842c0673ed8a9661080ebc5 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,18 @@ >+2019-02-04 Eric Liang <ericliang@apple.com> >+ >+ When performing AXPress, check to see if the menu list is disabled. >+ https://bugs.webkit.org/show_bug.cgi?id=193878 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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): >+ > 2019-02-04 Antoine Quint <graouts@apple.com> > > Use a dedicated type instead of int32_t for pointer identifiers >diff --git a/Source/WebCore/accessibility/AXObjectCache.h b/Source/WebCore/accessibility/AXObjectCache.h >index cf0a1836f8748965f6eb71f2b840b7a2124e2527..d4ba324b477b0a362825f2c39e02e049c64c84a1 100644 >--- a/Source/WebCore/accessibility/AXObjectCache.h >+++ b/Source/WebCore/accessibility/AXObjectCache.h >@@ -290,6 +290,8 @@ public: > AXRowExpanded, > AXExpandedChanged, > AXInvalidStatusChanged, >+ AXPressDidSucceed, >+ AXPressDidFail, > AXPressedStateChanged, > AXReadOnlyStatusChanged, > AXRequiredStatusChanged, >diff --git a/Source/WebCore/accessibility/AccessibilityMenuList.cpp b/Source/WebCore/accessibility/AccessibilityMenuList.cpp >index 6de86730e6a3e5ce0fb50f0ec1f6a0fbbb52ba9f..ef1377bf46c3b2250d3cf6e6e9d363b2e62bb91f 100644 >--- a/Source/WebCore/accessibility/AccessibilityMenuList.cpp >+++ b/Source/WebCore/accessibility/AccessibilityMenuList.cpp >@@ -45,15 +45,21 @@ Ref<AccessibilityMenuList> AccessibilityMenuList::create(RenderMenuList* rendere > bool AccessibilityMenuList::press() > { > #if !PLATFORM(IOS_FAMILY) >- RenderMenuList* menuList = static_cast<RenderMenuList*>(renderer()); >- if (menuList->popupIsVisible()) >- menuList->hidePopup(); >- else >- menuList->showPopup(); >+ auto element = this->element(); >+ AXObjectCache::AXNotification notification = AXObjectCache::AXPressDidFail; >+ if (element && !element->isDisabledFormControl() && is<RenderMenuList>(renderer())) { >+ RenderMenuList* menuList = downcast<RenderMenuList>(renderer()); >+ if (menuList->popupIsVisible()) >+ menuList->hidePopup(); >+ else >+ menuList->showPopup(); >+ notification = AXObjectCache::AXPressDidSucceed; >+ } >+ if (auto cache = axObjectCache()) >+ cache->postNotification(element, notification); > return true; >-#else >- return false; > #endif >+ return false; > } > > void AccessibilityMenuList::addChildren() >diff --git a/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm b/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm >index d075550ab9393803eeb0234895d6a8c6c19fb568..f652db36e6ea679d55b47134398cbc4921471d23 100644 >--- a/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm >+++ b/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm >@@ -346,6 +346,12 @@ void AXObjectCache::postPlatformNotification(AccessibilityObject* obj, AXNotific > case AXMenuListItemSelected: > macNotification = (id)kAXMenuItemSelectedNotification; > break; >+ case AXPressDidSucceed: >+ macNotification = @"AXPressDidSucceed"; >+ break; >+ case AXPressDidFail: >+ macNotification = @"AXPressDidFail"; >+ break; > case AXMenuOpened: > macNotification = (id)kAXMenuOpenedNotification; > break; >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index c48cbd51a1ff7868fc8500a2ae1438369be2cff5..9ff60a3871d3b8c55110cdecf9c90df9bd25805d 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,12 @@ >+2019-02-04 Eric Liang <ericliang@apple.com> >+ >+ Check if receive AXPressDidFail notification when performing AXPress action on disabled MenuList. >+ https://bugs.webkit.org/show_bug.cgi?id=193878 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * accessibility/mac/press-not-work-for-disabled-menu-list.html: Added. >+ > 2019-02-04 Frederic Wang <fwang@igalia.com> > > [css-scroll-snap] scroll-snap-align not honored on child with non-visible overflow >diff --git a/LayoutTests/accessibility/mac/press-not-work-for-disabled-menu-list-expected.txt b/LayoutTests/accessibility/mac/press-not-work-for-disabled-menu-list-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..c273ff4871331fa6ebd563eb45e1bbcf5aedfdb5 >--- /dev/null >+++ b/LayoutTests/accessibility/mac/press-not-work-for-disabled-menu-list-expected.txt >@@ -0,0 +1,13 @@ >+ >+This tests that menu lists that are disabled will not be triggered by AXPress actions. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+Got notification: AXPressDidFail >+Got notification: AXPressDidFail >+Got notification: AXPressDidFail >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/accessibility/mac/press-not-work-for-disabled-menu-list.html b/LayoutTests/accessibility/mac/press-not-work-for-disabled-menu-list.html >new file mode 100644 >index 0000000000000000000000000000000000000000..db44d395bdad8ece570b168f02ada1c31129bf82 >--- /dev/null >+++ b/LayoutTests/accessibility/mac/press-not-work-for-disabled-menu-list.html >@@ -0,0 +1,78 @@ >+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> >+<html> >+<head> >+<script src="../../resources/js-test-pre.js"></script> >+</head> >+<body id="body"> >+<div id="content"> >+ >+<select id="test0" disabled> >+ <option value="1">Cork</option> >+ <option value="2">Cupertino</option> >+ <option value="3">London</option> >+ <option value="4">New York</option> >+ <option value="5">Singapore</option> >+ <option value="6">Tokyo</option> >+</select> >+ >+<select id="test1" disabled aria-disabled="false"> >+ <option value="1">Cork</option> >+ <option value="2">Cupertino</option> >+ <option value="3">London</option> >+ <option value="4">New York</option> >+ <option value="5">Singapore</option> >+ <option value="6">Tokyo</option> >+</select> >+ >+<select id="test2" disabled aria-disabled="true"> >+ <option value="1">Cork</option> >+ <option value="2">Cupertino</option> >+ <option value="3">London</option> >+ <option value="4">New York</option> >+ <option value="5">Singapore</option> >+ <option value="6">Tokyo</option> >+</select> >+ >+<p id="description"></p> >+<div id="console"></div> >+ >+</div> >+ >+<script> >+ description("This tests that menu lists that are disabled will not be triggered by AXPress actions."); >+ >+ // We don't test for enabled controls because opening menu lists waits on the UI process to display the menu. >+ var numOfTests = 3, notificationCount = 0; >+ var lists = [null, null, null]; >+ if (window.accessibilityController) { >+ jsTestIsAsync = true; >+ pressNext(0); >+ } >+ >+ function pressNext(testId) { >+ if (testId > numOfTests) >+ return; >+ var menulist = accessibilityController.accessibleElementById("test" + testId); >+ menulist.addNotificationListener(pressListener); >+ menulist.press(); >+ lists[testId] = menulist; >+ window.setTimeout(function() { >+ pressNext(testId + 1); >+ }, 0); >+ } >+ >+ function pressListener(notification) { >+ if (notification == "AXPressDidFail" || notification == "AXPressDidSucceed") >+ notificationCount++; >+ >+ debug("Got notification: " + notification); >+ lists[notificationCount-1].removeNotificationListener(pressListener); >+ if (notificationCount == numOfTests) { >+ finishJSTest(); >+ } >+ } >+</script> >+ >+<script src="../../resources/js-test-post.js"></script> >+</body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193878
:
360261
|
360266
|
360277
|
360278
|
360279
|
360284
|
360285
|
360286
|
360439
|
360886
|
360903
|
360930
|
360936
|
360939
|
360942
|
361067
| 361070