diff options
Diffstat (limited to 'third_party/WebKit/Source/modules')
5 files changed, 11 insertions, 37 deletions
diff --git a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp index bf68f5e..3ba0e4e 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp @@ -1069,31 +1069,6 @@ AXObject* AXLayoutObject::previousOnLine() const // Properties of interactive elements. // -static String queryString(WebLocalizedString::Name name) -{ - return Locale::defaultLocale().queryString(name); -} - -String AXLayoutObject::actionVerb() const -{ - switch (roleValue()) { - case ButtonRole: - case ToggleButtonRole: - return queryString(WebLocalizedString::AXButtonActionVerb); - case TextFieldRole: - return queryString(WebLocalizedString::AXTextFieldActionVerb); - case RadioButtonRole: - return queryString(WebLocalizedString::AXRadioButtonActionVerb); - case CheckBoxRole: - case SwitchRole: - return queryString(isChecked() ? WebLocalizedString::AXCheckedCheckBoxActionVerb : WebLocalizedString::AXUncheckedCheckBoxActionVerb); - case LinkRole: - return queryString(WebLocalizedString::AXLinkActionVerb); - default: - return emptyString(); - } -} - String AXLayoutObject::stringValue() const { if (!m_layoutObject) diff --git a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.h b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.h index 4eab54b..8703649 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.h +++ b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.h @@ -116,7 +116,6 @@ protected: AXObject* previousOnLine() const override; // Properties of interactive elements. - String actionVerb() const override; String stringValue() const override; // ARIA attributes. diff --git a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp index 1716a57..1b59c22 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; } diff --git a/third_party/WebKit/Source/modules/accessibility/AXObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXObject.cpp index 3800577..4592961 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXObject.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXObject.cpp @@ -917,7 +917,8 @@ static String queryString(WebLocalizedString::Name name) String AXObject::actionVerb() const { - // FIXME: Need to add verbs for select elements. + if (!actionElement()) + return emptyString(); switch (roleValue()) { case ButtonRole: @@ -933,13 +934,9 @@ String AXObject::actionVerb() const case LinkRole: return queryString(WebLocalizedString::AXLinkActionVerb); case PopUpButtonRole: - // FIXME: Implement. - return String(); - case MenuListPopupRole: - // FIXME: Implement. - return String(); + return queryString(WebLocalizedString::AXPopUpButtonActionVerb); default: - return emptyString(); + return queryString(WebLocalizedString::AXDefaultActionVerb); } } diff --git a/third_party/WebKit/Source/modules/accessibility/AXObject.h b/third_party/WebKit/Source/modules/accessibility/AXObject.h index bec65aa..e45fb1af 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXObject.h +++ b/third_party/WebKit/Source/modules/accessibility/AXObject.h @@ -728,7 +728,7 @@ public: virtual void wordBoundaries(Vector<AXRange>& words) const { } // Properties of interactive elements. - virtual String actionVerb() const; + String actionVerb() const; virtual AccessibilityButtonState checkboxOrRadioValue() const; virtual InvalidState getInvalidState() const { return InvalidStateUndefined; } // Only used when invalidState() returns InvalidStateOther. |