Bug 31525

Summary: WAI-ARIA roles not supported on image map <area>
Product: WebKit Reporter: chris fleizach <cfleizach>
Component: AccessibilityAssignee: chris fleizach <cfleizach>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, commit-queue
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
patch
darin: review-
patch none

Description chris fleizach 2009-11-15 18:26:42 PST
WAI-ARIA roles not supported on image map <area>
Comment 1 chris fleizach 2009-11-17 23:20:58 PST
Created attachment 43409 [details]
patch
Comment 2 Darin Adler 2009-11-18 10:06:08 PST
Comment on attachment 43409 [details]
patch

> +    String ariaRole = m_areaElement->getAttribute(roleAttr);

It's usually a slightly better idiom to put fetched attributes into const AtomicString& local variables instead of String, because it avoids a little bit of reference count churn.

> +static const ARIARoleMap& createARIARoleMap()

I think it's cleaner for a create function to return an ARIARoleMap* rather than a const ARIARoleMap&. I realize you're just moving this code.

> +AccessibilityRole AccessibilityObject::ariaRoleToWebCoreRole(String& value)

The argument should be const String&, not String&.

> +    ASSERT(!value.isEmpty() && !value.isNull());

Normally we don't use && in assertions. Instead we do multiple assertions in such cases; that way we know which one failed. Also, all null strings are also empty, so the only reason to have both assertions is if you want to know from the assertion which is which, and if so, the null assertion has to come first.

> -    AccessibilityRole role = ariaRoleToWebCoreRole(ariaRole);
> +    AccessibilityRole role = AccessibilityObject::ariaRoleToWebCoreRole(ariaRole);

Do you really need to change this? Since AccessibilityRenderObject is derived from AccessibilityObject I'd expect this to already be in scope.

review- because of the String& thing -- everything else is too minor to matter, but that is not good
Comment 3 chris fleizach 2009-11-18 21:31:02 PST
Created attachment 43483 [details]
patch

made all of darin's suggestions
Comment 4 chris fleizach 2009-11-19 10:58:39 PST
adding to commit queue, cuz the code is elsewhere
Comment 5 WebKit Commit Bot 2009-11-19 11:28:34 PST
Comment on attachment 43483 [details]
patch

Clearing flags on attachment: 43483

Committed r51195: <http://trac.webkit.org/changeset/51195>
Comment 6 WebKit Commit Bot 2009-11-19 11:28:40 PST
All reviewed patches have been landed.  Closing bug.