WebKit Bugzilla
Attachment 360936 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-20190201195231.patch (text/plain), 7.01 KB, created by
Eric Liang
on 2019-02-01 17:52:32 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Eric Liang
Created:
2019-02-01 17:52:32 PST
Size:
7.01 KB
patch
obsolete
>Subversion Revision: 240875 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 5723d7dd2be570f5eefcbfe31c3733600de74546..4d234dfd206311a03cb78a42a339167561106e5d 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,18 @@ >+2019-02-01 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-01 Antoine Quint <graouts@apple.com> > > Dispatch pointercancel events when content is panned or zoomed on iOS >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..0a514d12fe6cc3ae83d38f497aa59b00cb8034ab 100644 >--- a/Source/WebCore/accessibility/AccessibilityMenuList.cpp >+++ b/Source/WebCore/accessibility/AccessibilityMenuList.cpp >@@ -45,15 +45,19 @@ 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(); >- return true; >-#else >- return false; >+ auto element = this->element(); >+ if (element && !element->isDisabledFormControl() && is<RenderMenuList>(renderer())) { >+ RenderMenuList* menuList = downcast<RenderMenuList>(renderer()); >+ if (menuList->popupIsVisible()) >+ menuList->hidePopup(); >+ else >+ menuList->showPopup(); >+ if (auto cache = axObjectCache()) >+ cache->postNotification(element, result ? AXObjectCache::AXPressDidSucceed : AXObjectCache::AXPressDidFail); >+ return true; >+ } > #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 395610b7ad685471edb317b14b82467a1fea5b41..f28145a760aeb73e68270759717ef65e597bd03c 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,12 @@ >+2019-02-01 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-01 Antoine Quint <graouts@apple.com> > > Dispatch pointercancel events when content is panned or zoomed on iOS >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..579433e680d9960755459f152d47baf30cb470ef >--- /dev/null >+++ b/LayoutTests/accessibility/mac/press-not-work-for-disabled-menu-list.html >@@ -0,0 +1,79 @@ >+<!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 = [0, 0, 0]; >+ if (window.accessibilityController) { >+ jsTestIsAsync = true; >+ pressNext(0); >+ } >+ >+ function pressNext(testId) { >+ if (testId > numOfTests) >+ return; >+ var menulist= accessibilityController.accessibleElementById("test" + testId); >+ menulist.addNotificationListener(listener); >+ menulist.press(); >+ lists[testId] = menulist; >+ setTimeout(function() { >+ pressNext(testId + 1); >+ }, 0); >+ } >+ >+ function listener(notification, userInfo) { >+ if (notification == "AXPressDidFail") >+ notificationCount++; >+ >+ lists[notificationCount-1].removeNotificationListener(listener); >+ debug("Got notification: " + notification); >+ >+ 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