Bug 111222 - AX: aria-label does not override text content on iOS
Summary: AX: aria-label does not override text content on iOS
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: chris fleizach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-01 14:35 PST by chris fleizach
Modified: 2013-03-05 09:28 PST (History)
6 users (show)

See Also:


Attachments
patch (6.24 KB, patch)
2013-03-01 15:02 PST, chris fleizach
ddkilzer: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description chris fleizach 2013-03-01 14:35:15 PST
iOS needs to use the text alternative computation rules already being used by the Mac
Comment 1 chris fleizach 2013-03-01 15:02:06 PST
Created attachment 191046 [details]
patch
Comment 2 David Kilzer (:ddkilzer) 2013-03-04 15:16:23 PST
Comment on attachment 191046 [details]
patch

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

r=me, but consider expanding the layout test to cover all four scenarios if possible.

> Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:685
> +    if ([axTitle length] && [axDescription length])
> +        return [axTitle stringByAppendingFormat:@", %@", axDescription];
> +    else if ([axTitle length])
> +        return axTitle;
> +    else if ([axDescription length])
> +        return axDescription;

Nit: Might be worth pulling [axTitle length] and [axDescription length] into local variables since they're used multiple times here.

> Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:687
> +    else if ([self stringValueShouldBeUsedInLabel])
> +        return m_object->stringValue();

Also, is it possible to test all of these code paths (title and description, title only, description only, neither) using a layout test?

If so, the layout test should be changed to test all four scenarios.
Comment 3 chris fleizach 2013-03-04 15:29:20 PST
(In reply to comment #2)
> (From update of attachment 191046 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=191046&action=review
> 
> r=me, but consider expanding the layout test to cover all four scenarios if possible.
> 
> > Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:685
> > +    if ([axTitle length] && [axDescription length])
> > +        return [axTitle stringByAppendingFormat:@", %@", axDescription];
> > +    else if ([axTitle length])
> > +        return axTitle;
> > +    else if ([axDescription length])
> > +        return axDescription;
> 
> Nit: Might be worth pulling [axTitle length] and [axDescription length] into local variables since they're used multiple times here.
> 
> > Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:687
> > +    else if ([self stringValueShouldBeUsedInLabel])
> > +        return m_object->stringValue();
> 
> Also, is it possible to test all of these code paths (title and description, title only, description only, neither) using a layout test?
> 
> If so, the layout test should be changed to test all four scenarios.

Yep, I'll fix up this layout test to test all 4 scenarios.

Thanks!
Comment 4 chris fleizach 2013-03-05 09:28:20 PST
http://trac.webkit.org/changeset/144766