WebKit Bugzilla
Attachment 361067 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-20190204100204.patch (text/plain), 7.13 KB, created by
Eric Liang
on 2019-02-04 10:02:04 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Eric Liang
Created:
2019-02-04 10:02:04 PST
Size:
7.13 KB
patch
obsolete
>Subversion Revision: 240600 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index dad7450a94448006eb972a12262a27fec00c400f..33d2104fc03abae06691c3b77844ed5f0f56b983 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-01-28 Antoine Quint <graouts@apple.com> > > Limit user-agent interactions based on the touch-action property 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..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 2fd9d9a65a665cbdc9b26b16f104b427cbcddbdb..0d9cb4b66a75cc5cb0873ccbd074b2344de193bc 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 4dc94e86f7a6b197487fef703807dfcee2eac20d..99a4ff840f565e2481dc0e28f407ab6052641a04 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-01-28 Antoine Quint <graouts@apple.com> > > Limit user-agent interactions based on the touch-action property 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..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