AX: Meter: [Mac] Content in label element should be used as AXTitle or AXDescription
authorn_wang@apple.com <n_wang@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Sep 2016 15:13:00 +0000 (15:13 +0000)
committern_wang@apple.com <n_wang@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Sep 2016 15:13:00 +0000 (15:13 +0000)
commit63e66384f90161de3e101719fa0ea12e29e0c29d
treec1c7735dd5dbc3b553f945daec18e1d124b621d3
parent0515c4e1ab091c4600168381ad799f52d3c5e0cf
AX: Meter: [Mac] Content in label element should be used as AXTitle or AXDescription
https://bugs.webkit.org/show_bug.cgi?id=162586

Reviewed by Chris Fleizach.

Source/WebCore:

Exposed the label element's text as AXDescription for meter elements.
Also refactored the code for fetching the label element's text and taken care of
the case where aria-label and aria-labelledby attributes are used on label elements.

Test: accessibility/mac/meter-with-label-element.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::isLabelable):
(WebCore::AccessibilityNodeObject::textForLabelElement):
(WebCore::AccessibilityNodeObject::titleElementText):
(WebCore::AccessibilityNodeObject::title):
(WebCore::AccessibilityNodeObject::usesAltTagForTextComputation): Deleted.
* accessibility/AccessibilityNodeObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::exposesTitleUIElement):

LayoutTests:

* accessibility/mac/aria-label-on-label-element-expected.txt:
* accessibility/mac/aria-label-on-label-element.html:
* accessibility/mac/meter-with-label-element-expected.txt: Added.
* accessibility/mac/meter-with-label-element.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@206581 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/accessibility/mac/aria-label-on-label-element-expected.txt
LayoutTests/accessibility/mac/aria-label-on-label-element.html
LayoutTests/accessibility/mac/meter-with-label-element-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/mac/meter-with-label-element.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityNodeObject.cpp
Source/WebCore/accessibility/AccessibilityNodeObject.h
Source/WebCore/accessibility/AccessibilityRenderObject.cpp