Bug 124032

Summary: [AX] Clean up static_cast<> to cast from AccessibilityObject
Product: WebKit Reporter: Gyuyoung Kim <gyuyoung.kim>
Component: AccessibilityAssignee: Gyuyoung Kim <gyuyoung.kim>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, mario, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Gyuyoung Kim 2013-11-07 22:51:06 PST
ACCESSIBILITY_OBJECT_TYPE_CASTS can support more helpful casting functions. So, we need to use them as much as possible. This patch cleans up all static_cast<> in accessibility.
This patch generates toAccessibilityFoo() in order to replace static_cast<> with it.

 - Generate toAccessibilityARIAGridRow()
 - Generate toAccessibilityImageMapLink()
 - Generate toAccessibilityListBox()
 - Generate toAccessibilityListBoxOption()
 - Generate toAccessibilityMenuListOption()
 - Generate toAccessibilityMenuListPopup()
 - Generate toAccessibilityScrollbar()
 - Generate toAccessibilitySlider()
Comment 1 Radar WebKit Bug Importer 2013-11-07 22:51:28 PST
<rdar://problem/15421896>
Comment 2 Gyuyoung Kim 2013-11-07 22:55:11 PST
Created attachment 216361 [details]
Patch
Comment 3 Gyuyoung Kim 2013-11-07 23:48:38 PST
Mario, how do you think ?
Comment 4 Mario Sanchez Prada 2013-11-08 02:07:33 PST
Comment on attachment 216361 [details]
Patch

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

(In reply to comment #3)
> Mario, how do you think ?

I think it's a good cleanup. Setting the r+ now, but please fix those small things pointed out below before landing. Thanks!

> Source/WebCore/accessibility/AccessibilityListBoxOption.h:65
> -    bool isListBoxOption() const { return true; }
> +    bool isListBoxOption() const OVERRIDE { return true; }

You should declare it as virtual and use the FINAL modifier here too if you are declaring this in upper classes as a virtual method (as you are)

> Source/WebCore/accessibility/AccessibilitySlider.h:75
> +    virtual bool isSliderThumb() const OVERRIDE { return true; }

FINAL missing
Comment 5 Gyuyoung Kim 2013-11-10 08:05:14 PST
Created attachment 216526 [details]
Patch
Comment 6 Gyuyoung Kim 2013-11-10 08:15:10 PST
(In reply to comment #4)
> (From update of attachment 216361 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=216361&action=review
> 
> (In reply to comment #3)
> > Mario, how do you think ?
> 
> I think it's a good cleanup. Setting the r+ now, but please fix those small things pointed out below before landing. Thanks!
> 
> > Source/WebCore/accessibility/AccessibilityListBoxOption.h:65
> > -    bool isListBoxOption() const { return true; }
> > +    bool isListBoxOption() const OVERRIDE { return true; }
> 
> You should declare it as virtual and use the FINAL modifier here too if you are declaring this in upper classes as a virtual method (as you are)
> 
> > Source/WebCore/accessibility/AccessibilitySlider.h:75
> > +    virtual bool isSliderThumb() const OVERRIDE { return true; }
> 
> FINAL missing

Yes, right. Fixed them.
Comment 7 WebKit Commit Bot 2013-11-10 08:57:52 PST
Comment on attachment 216526 [details]
Patch

Clearing flags on attachment: 216526

Committed r159026: <http://trac.webkit.org/changeset/159026>
Comment 8 WebKit Commit Bot 2013-11-10 08:57:55 PST
All reviewed patches have been landed.  Closing bug.