WebKit Bugzilla
Attachment 360439 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-20190128214621.patch (text/plain), 7.87 KB, created by
Eric Liang
on 2019-01-28 21:46:22 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Eric Liang
Created:
2019-01-28 21:46:22 PST
Size:
7.87 KB
patch
obsolete
>Subversion Revision: 240600 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index dad7450a94448006eb972a12262a27fec00c400f..42cf9d890c4bb70718ac50a7ec1777d4c1bad305 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,18 @@ >+2019-01-28 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/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..63411816c5bdddbd3ed860a62698de5822a06615 100644 >--- a/Source/WebCore/accessibility/AccessibilityMenuList.cpp >+++ b/Source/WebCore/accessibility/AccessibilityMenuList.cpp >@@ -44,16 +44,23 @@ Ref<AccessibilityMenuList> AccessibilityMenuList::create(RenderMenuList* rendere > > bool AccessibilityMenuList::press() > { >+ bool result = false; > #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()) { >+ RenderMenuList* menuList = static_cast<RenderMenuList*>(renderer()); >+ if (menuList->popupIsVisible()) >+ menuList->hidePopup(); >+ else >+ menuList->showPopup(); >+ result = true; >+ } >+ AXObjectCache* cache = axObjectCache(); >+ Ref<Document> document(m_renderer->document()); >+ if (cache) >+ cache->postNotification(this, document.ptr(), result ? AXObjectCache::AXPressDidSucceed : AXObjectCache::AXPressDidFail); > #endif >+ return result; > } > > 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..47179b9aad14a2409428b29b760cd1c5c052476d 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,13 @@ >+2019-01-28 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/press-not-work-for-disabled-menu-list.html: Added. >+ * platform/win/TestExpectations: >+ > 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/press-not-work-for-disabled-menu-list.html b/LayoutTests/accessibility/press-not-work-for-disabled-menu-list.html >new file mode 100644 >index 0000000000000000000000000000000000000000..dd44aa9bc21f1037499e295635899298554b5894 >--- /dev/null >+++ b/LayoutTests/accessibility/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> >diff --git a/LayoutTests/platform/win/TestExpectations b/LayoutTests/platform/win/TestExpectations >index 3230bf0469a649e9fad7767ce2b6152db4f528ee..b15825cfb74d48ef1b36384b2cb6c01c1f5eb6ae 100644 >--- a/LayoutTests/platform/win/TestExpectations >+++ b/LayoutTests/platform/win/TestExpectations >@@ -3163,6 +3163,7 @@ accessibility/w3c-svg-description-calculation.html [ Failure ] > accessibility/w3c-svg-name-calculation.html [ Failure ] > accessibility/w3c-svg-roles.html [ Failure ] > accessibility/svg-element-with-aria-role.html [ Failure ] >+accessibility/press-not-work-for-disabled-menu-list.html [ Skip ] > accessibility/win/select-element-valuechange-event.html [ Failure ] > css1/box_properties/float_on_text_elements.html [ Failure ] > css1/units/length_units.html [ Failure ]
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