Issue metadata
Sign in to add a comment
|
IAccessible::accDoDefaultAction reports success when there's no default action |
||||||||||||||||||||||
Issue description
Version: 51.0.2679.0 canary (64-bit)
OS: Windows 10 64 bit
STR:
1. Start NVDA.
2. In Chrome, put the following URL in the address bar and press enter:
data:text/html,<div onClick="alert('Test');">Go</div>
Note: The document should be focused and the NVDA browse mode cursor should now be on "Go".
3. Press enter to "activate" the element under the cursr.
Expected: The "Test" alert dialog should be displayed.
Actual: Nothing.
While clickable text with no semantics is usually undesirable, it's rampant on the web. In order to support this, NVDA falls back to simulating a mouse click if performing the default action fails. Unfortunately, this doesn't work in Chrome because the default action always reports as succeeding (IAccessible::accDoDefaultAction returns S_OK) even when there's no default action. It should instead return an error code; e.g. DISP_E_MEMBERNOTFOUND or E_INVALIDARG.concurs
I could fix this in NVDA by checking IAccessible::accDefaultAction first. However, this seems somewhat redundant and MSDN does seem to agree that this should return an error. Also, we don't need to do it in Firefox.
Originally reported in this nvda-devel thread: http://nabble.nvda-project.org/NVDA-in-Chrome-Pressing-Enter-to-quot-Click-quot-a-Div-td39910.html
,
Mar 16 2016
Thanks! Fix out for review: https://codereview.chromium.org/1809573003/ The only thing I did differently is that I think Chrome should actually report an action and handle accDoDefaultAction when an element has a click listener. I think it's more robust for us to simulate the click internally where we know we can. It was a bug that we weren't handling div with an onclick attribute. In the case of calling accDoDefaultAction on an element without a click listener I agree completely and I made it return DISP_E_MEMBERNOTFOUND.
,
Mar 18 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/30fc95f3dd93562d7be852205c49bd49e793d84c commit 30fc95f3dd93562d7be852205c49bd49e793d84c Author: dmazzoni <dmazzoni@chromium.org> Date: Fri Mar 18 08:28:41 2016 Fix support for accessible action verbs and performing the default action. Accessible objects support a "default action" if something happens when you click on them. On some platforms we return a localized string like "press" or "uncheck" indicating what action will occur. This change fixes a few cases that weren't correct: 1. A few objects had actions but no verb - fix this by adding a verb for pop-up buttons ("open") and a default verb when nothing else applies ("click"). 2. Ensure we always return an action verb when an object has a default action, and never otherwise. 3. Fix detection of click event listeners - we were using an API that only returned some; use the right API to get all click-and-mouse-related event listeners, but exclude the HTML BODY element because lots of pages have click listeners there and they're rarely what we want. 4. The Windows API accDoDefaultAction should return an error if called on an object with no default action. BUG= 595222 Review URL: https://codereview.chromium.org/1809573003 Cr-Commit-Position: refs/heads/master@{#381911} [modify] https://crrev.com/30fc95f3dd93562d7be852205c49bd49e793d84c/content/app/strings/content_strings.grd [modify] https://crrev.com/30fc95f3dd93562d7be852205c49bd49e793d84c/content/browser/accessibility/browser_accessibility_win.cc [modify] https://crrev.com/30fc95f3dd93562d7be852205c49bd49e793d84c/content/browser/accessibility/dump_accessibility_tree_browsertest.cc [modify] https://crrev.com/30fc95f3dd93562d7be852205c49bd49e793d84c/content/child/blink_platform_impl.cc [add] https://crrev.com/30fc95f3dd93562d7be852205c49bd49e793d84c/content/test/data/accessibility/html/action-verbs-expected-blink.txt [add] https://crrev.com/30fc95f3dd93562d7be852205c49bd49e793d84c/content/test/data/accessibility/html/action-verbs.html [modify] https://crrev.com/30fc95f3dd93562d7be852205c49bd49e793d84c/third_party/WebKit/LayoutTests/accessibility/press-works-on-control-types-expected.txt [modify] https://crrev.com/30fc95f3dd93562d7be852205c49bd49e793d84c/third_party/WebKit/LayoutTests/accessibility/press-works-on-control-types.html [modify] https://crrev.com/30fc95f3dd93562d7be852205c49bd49e793d84c/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp [modify] https://crrev.com/30fc95f3dd93562d7be852205c49bd49e793d84c/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.h [modify] https://crrev.com/30fc95f3dd93562d7be852205c49bd49e793d84c/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp [modify] https://crrev.com/30fc95f3dd93562d7be852205c49bd49e793d84c/third_party/WebKit/Source/modules/accessibility/AXObject.cpp [modify] https://crrev.com/30fc95f3dd93562d7be852205c49bd49e793d84c/third_party/WebKit/Source/modules/accessibility/AXObject.h [modify] https://crrev.com/30fc95f3dd93562d7be852205c49bd49e793d84c/third_party/WebKit/public/platform/WebLocalizedString.h
,
Apr 8 2016
,
Nov 3 2016
"3. Fix detection of click event listeners - we were using an API that only returned some; use the right API to get all click-and-mouse-related event listeners, but exclude the HTML BODY element because lots of pages have click listeners there and they're rarely what we want." Chrome's accessibility tree indicates that all hypertext elements that are contained w/in a parent element w/ at least one "click-and-mouse-related" event listener now have the "click" default action. THIS causes some accessibility related assertive technologies (JAWS, NVDA, ...) to misinterpret all hypertext as "clickable". This change in behavior goes against how some JavaScript libraries's (jQuery) event delegation works when capturing (at a higher level in the DOM) events that occur on any element w/in the document (Not ONLY the HTML BODY). This assumes one can only: 1. bind event handlers directly to the objects where the event happens 2. bind all delegated event handlers to the document object This is not true especially when the objects you are capturing events on are dynamically created/removed and you still want to capture events on them without having to explicitly rebind event handlers every time you create a new one.
,
Nov 4 2016
@rlamtabbet thanks for the report, and the issue 662254 . Probably it's better to continue discussion there? (I'm just adding the reference to it so people can follow)
,
Nov 4 2016
I wouldn't mind changing what Chrome exposes but we need to figure out a way to tell users whether something is clickable. The assistive software you mention announces "clickable" for a good reason. Many web apps have widgets that don't use the correct ARIA or HTML attributes to indicate their role. So, a blind user has no way of knowing what they can activate or not. Many times the context, i.e. what the page says, is not enough. You need to know exactly where and what to click. Excluding click handlers on the body element was just a heuristic. |
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by nek...@chromium.org
, Mar 16 2016Status: Started (was: Untriaged)