Bug 118021 - Remove many static_casts to Element types from AccessibilityNodeObject
Summary: Remove many static_casts to Element types from AccessibilityNodeObject
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords: BlinkMergeCandidate
Depends on:
Blocks:
 
Reported: 2013-06-25 21:00 PDT by Ryosuke Niwa
Modified: 2013-06-26 08:39 PDT (History)
11 users (show)

See Also:


Attachments
Cleanup (2.76 KB, patch)
2013-06-25 21:01 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2013-06-25 21:00:27 PDT
Merge https://chromium.googlesource.com/chromium/blink/+/ecd837f94996a20fdb8798e24f26cf6edea2a423

Some of these casts were to overly specific types, like casting to HTMLFrameElementBase*
just to call getAttribute. In other cases we can cast to a more generic type like
HTMLTextFormControlElement to avoid the extra cases the code originally had.
Comment 1 Ryosuke Niwa 2013-06-25 21:01:11 PDT
Created attachment 205444 [details]
Cleanup
Comment 2 chris fleizach 2013-06-26 00:34:30 PDT
Comment on attachment 205444 [details]
Cleanup

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

> Source/WebCore/accessibility/AccessibilityNodeObject.cpp:1647
> +        return toHTMLTextFormControlElement(node)->value();

Isn't this a bad cast for input type=checkbox for instance?
Comment 3 Ryosuke Niwa 2013-06-26 01:47:05 PDT
(In reply to comment #2)
> (From update of attachment 205444 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=205444&action=review
> 
> > Source/WebCore/accessibility/AccessibilityNodeObject.cpp:1647
> > +        return toHTMLTextFormControlElement(node)->value();
> 
> Isn't this a bad cast for input type=checkbox for instance?

No. Both HTMLInputElement and HTMLTextAreaElement inherit from HTMLTextFormControlElement.
Comment 4 WebKit Commit Bot 2013-06-26 08:39:28 PDT
Comment on attachment 205444 [details]
Cleanup

Clearing flags on attachment: 205444

Committed r151990: <http://trac.webkit.org/changeset/151990>
Comment 5 WebKit Commit Bot 2013-06-26 08:39:31 PDT
All reviewed patches have been landed.  Closing bug.