WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
102358
Remove isHTMLInputElement since it's unused and toInputElement exists
https://bugs.webkit.org/show_bug.cgi?id=102358
Summary
Remove isHTMLInputElement since it's unused and toInputElement exists
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
Details
Formatted Diff
Diff
Patch
(1.57 KB, patch)
2012-11-15 09:28 PST
,
Elliott Sprehn
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Elliott Sprehn
Comment 1
2012-11-15 02:22:32 PST
Created
attachment 174378
[details]
Patch
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
Created
attachment 174466
[details]
Patch
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.
Top of Page
Format For Printing
XML
Clone This Bug