Bug 102358

Summary: Remove isHTMLInputElement since it's unused and toInputElement exists
Product: WebKit Reporter: Elliott Sprehn <esprehn>
Component: New BugsAssignee: Elliott Sprehn <esprehn>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, mifenton, ojan, rniwa, tkent, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Elliott Sprehn
Reported 2012-11-15 02:19:16 PST
Remove isHTMLInputElement since it's dangerous and unused
Attachments
Patch (1.38 KB, patch)
2012-11-15 02:22 PST, Elliott Sprehn
no flags
Patch (1.57 KB, patch)
2012-11-15 09:28 PST, Elliott Sprehn
no flags
Elliott Sprehn
Comment 1 2012-11-15 02:22:32 PST
Ryosuke Niwa
Comment 2 2012-11-15 03:33:32 PST
Comment on attachment 174378 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=174378&action=review > Source/WebCore/ChangeLog:11 > + isHTMLInputElement only checked if the tag name was input which is bad > + since other things inherit from HTMLInputElement. Instead callers should > + use Node::toInputElement() which is virtual and will handle subclasses > + properly. Why is that dangerous? If an element has the name HTMLNames::inputTag, then it can't certainly be some other element, right? I agree that you can't assume that an element's name is HTMLNames::inputTag just because it's an instance of a HTMLInputElement but that's a separate issue.
Elliott Sprehn
Comment 3 2012-11-15 09:13:53 PST
(In reply to comment #2) > (From update of attachment 174378 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=174378&action=review > > > Source/WebCore/ChangeLog:11 > > + isHTMLInputElement only checked if the tag name was input which is bad > > + since other things inherit from HTMLInputElement. Instead callers should > > + use Node::toInputElement() which is virtual and will handle subclasses > > + properly. > > Why is that dangerous? If an element has the name HTMLNames::inputTag, then it can't certainly be some other element, right? > I agree that you can't assume that an element's name is HTMLNames::inputTag just because it's an instance of a HTMLInputElement but that's a separate issue. Dangerous is probably the wrong word. Why would I ever want to call this method instead of just using toInputElement() though?
Elliott Sprehn
Comment 4 2012-11-15 09:28:17 PST
WebKit Review Bot
Comment 5 2012-11-15 10:14:31 PST
Comment on attachment 174466 [details] Patch Clearing flags on attachment: 174466 Committed r134790: <http://trac.webkit.org/changeset/134790>
WebKit Review Bot
Comment 6 2012-11-15 10:14:35 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.