Bug 157219 - AX: @aria-label attribute should work on <label> element
Summary: AX: @aria-label attribute should work on <label> element
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-04-29 17:50 PDT by Nan Wang
Modified: 2016-04-30 11:06 PDT (History)
11 users (show)

See Also:


Attachments
initial patch (5.89 KB, patch)
2016-04-29 17:57 PDT, Nan Wang
no flags Details | Formatted Diff | Diff
patch (5.82 KB, patch)
2016-04-30 00:14 PDT, Nan Wang
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nan Wang 2016-04-29 17:50:24 PDT
In case:
<label for="txtBox1" aria-label="Enter date in format MM/DD/YY">Date:</label>
<input id="txtBox1" />

I would expect the value specified in the aria-label attribute to supersede the actual value of the label. I.e. I would expect VoiceOver to announce "Enter date in format MM/DD/YY". Instead the base value is announced ("Date").

<rdar://problem/15199588>
Comment 1 Nan Wang 2016-04-29 17:57:33 PDT
Created attachment 277769 [details]
initial patch
Comment 2 chris fleizach 2016-04-29 18:03:22 PDT
Comment on attachment 277769 [details]
initial patch

View in context: https://bugs.webkit.org/attachment.cgi?id=277769&action=review

> Source/WebCore/accessibility/AccessibilityNodeObject.cpp:1269
> +            // If there's aria-label on the label, we should use it instead.

this comment seems unnecessary, since its self evident from the code

> Source/WebCore/accessibility/AccessibilityNodeObject.cpp:1270
> +            const AtomicString& labelStr = labelObject->getAttribute(aria_labelAttr);

const AtomicString& ariaLabel

> Source/WebCore/accessibility/AccessibilityRenderObject.cpp:1075
> +    // otherwise its inner text will be announced by screenreader.

announced by "a" screenrea
Comment 3 Nan Wang 2016-04-30 00:14:53 PDT
Created attachment 277799 [details]
patch

applied review comments
Comment 4 WebKit Commit Bot 2016-04-30 11:06:16 PDT
Comment on attachment 277799 [details]
patch

Clearing flags on attachment: 277799

Committed r200290: <http://trac.webkit.org/changeset/200290>
Comment 5 WebKit Commit Bot 2016-04-30 11:06:21 PDT
All reviewed patches have been landed.  Closing bug.