Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1360)

Unified Diff: third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp

Issue 1809573003: Fix support for accessible action verbs and performing the default action. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix two tests Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
index 0a07d75b0503436d10f4afdd344cb4e1a838b64a..e2d5698b616c41815b6c2ac44bde32057ad5aa0e 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
@@ -685,16 +685,19 @@ Element* AXNodeObject::mouseButtonListener() const
if (!node)
return 0;
- // check if our parent is a mouse button listener
if (!node->isElementNode())
node = node->parentElement();
if (!node)
return 0;
- // FIXME: Do the continuation search like anchorElement does
for (Element* element = toElement(node); element; element = element->parentElement()) {
- if (element->getAttributeEventListener(EventTypeNames::click) || element->getAttributeEventListener(EventTypeNames::mousedown) || element->getAttributeEventListener(EventTypeNames::mouseup))
+ // It's a pretty common practice to put click listeners on the body or document, but that's
+ // almost never what the user wants when clicking on an accessible element.
+ if (isHTMLBodyElement(element))
+ break;
+
+ if (element->hasEventListeners(EventTypeNames::click) || element->hasEventListeners(EventTypeNames::mousedown) || element->hasEventListeners(EventTypeNames::mouseup) || element->hasEventListeners(EventTypeNames::DOMActivate))
return element;
}

Powered by Google App Engine
This is Rietveld 408576698