AX: VoiceOver says everything that isn't a link is a "clickable" in Safari reader?
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Apr 2013 00:37:14 +0000 (00:37 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Apr 2013 00:37:14 +0000 (00:37 +0000)
commit2e30270783a9b7dd2e51a64e4cced4ac75d2a441
treedb18c710695d380e723617ba2bb9a83ad9950f20
parentd1886f450fd5853e77f95ebbb0846024b22f85ac
AX: VoiceOver says everything that isn't a link is a "clickable" in Safari reader?
https://bugs.webkit.org/show_bug.cgi?id=114687

Reviewed by Tim Horton.

Source/WebCore:

VoiceOver is saying all text is clickable, because AXPress is exposed as an action on static text.
That is happening, because there's a click handler on the body element in this case.

I think the best plan to keep existing functionality, but fix this case is not to expose
the press action for static text when the handler is on the body element.

Test: platform/mac/accessibility/press-action-not-exposed-when-body-is-click-handler.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::mouseButtonListener):
   Change from checking getAttributeEventListener to hasEventListeners. The former only
   checks if "onclick" is installed on the element and does not work with addEventListener!

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isStaticText):

LayoutTests:

* platform/mac/accessibility/press-action-not-exposed-when-body-is-click-handler-expected.txt: Added.
* platform/mac/accessibility/press-action-not-exposed-when-body-is-click-handler.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@148652 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/mac/accessibility/press-action-not-exposed-when-body-is-click-handler-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/accessibility/press-action-not-exposed-when-body-is-click-handler.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityNodeObject.cpp
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/accessibility/AccessibilityObject.h