Bug 114547 - AX: iOS: WAI-ARIA landmarks no longer speak type of landmark on iOS
Summary: AX: iOS: WAI-ARIA landmarks no longer speak type of landmark 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: InRadar
Depends on:
Blocks:
 
Reported: 2013-04-12 16:59 PDT by chris fleizach
Modified: 2013-04-24 11:33 PDT (History)
6 users (show)

See Also:


Attachments
code (12.40 KB, application/octet-stream)
2013-04-12 17:03 PDT, chris fleizach
no flags Details
patch (22.03 KB, patch)
2013-04-23 15:17 PDT, 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-04-12 16:59:51 PDT
WAI-ARIA landmarks no longer speak type of landmark
Comment 1 chris fleizach 2013-04-12 17:03:55 PDT
Created attachment 197911 [details]
code
Comment 2 chris fleizach 2013-04-23 15:11:39 PDT
rdar://8736942
Comment 3 chris fleizach 2013-04-23 15:17:01 PDT
Created attachment 199330 [details]
patch
Comment 4 David Kilzer (:ddkilzer) 2013-04-24 10:14:51 PDT
Comment on attachment 199330 [details]
patch 

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

r=me

> Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:1885
>          switch (m_object->roleValue()) {
>              default:
>                  return NSAccessibilityRoleDescription(NSAccessibilityGroupRole, [self subrole]);

Is it normal to put the default: case at the beginning of the switch statement?

> Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:725
> +    if ([axDescription length]) {
> +        if ([result length])
> +            [result appendString:@", "];
> +        [result appendString:axDescription];
> +    }

This code is essentially written 3 times in this patch.  It could be pulled into a local static (inline) method to make this method a little more readable:

static void appendStringToResult(NSMutableString *result, NSString *string)
{
    ASSERT(result);
    if (![string length])
        return;
    if ([result length])
        [result appendString:@", "];
    [result appendString:string];
}

> Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:744
> +    return ([result length]) ? result : nil;

Nit:  Don't need the extra parenthesis here.
Comment 5 chris fleizach 2013-04-24 11:32:47 PDT
http://trac.webkit.org/changeset/149051
Comment 6 chris fleizach 2013-04-24 11:33:04 PDT
(In reply to comment #4)
> (From update of attachment 199330 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=199330&action=review
> 
> r=me
> 
> > Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:1885
> >          switch (m_object->roleValue()) {
> >              default:
> >                  return NSAccessibilityRoleDescription(NSAccessibilityGroupRole, [self subrole]);
> 
> Is it normal to put the default: case at the beginning of the switch statement?
> 
> > Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:725
> > +    if ([axDescription length]) {
> > +        if ([result length])
> > +            [result appendString:@", "];
> > +        [result appendString:axDescription];
> > +    }
> 
> This code is essentially written 3 times in this patch.  It could be pulled into a local static (inline) method to make this method a little more readable:
> 
> static void appendStringToResult(NSMutableString *result, NSString *string)
> {
>     ASSERT(result);
>     if (![string length])
>         return;
>     if ([result length])
>         [result appendString:@", "];
>     [result appendString:string];
> }
> 
> > Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:744
> > +    return ([result length]) ? result : nil;
> 
> Nit:  Don't need the extra parenthesis here.

Thanks. Addressed all these suggestions in the checkin