Bug 118212 - Adopt is/toHTMLOptionElement for code cleanup
Summary: Adopt is/toHTMLOptionElement for code cleanup
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kangil Han
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-28 23:08 PDT by Kangil Han
Modified: 2013-06-29 01:19 PDT (History)
3 users (show)

See Also:


Attachments
Patch (46.95 KB, patch)
2013-06-28 23:16 PDT, Kangil Han
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kangil Han 2013-06-28 23:08:10 PDT
Adopt is/toHTMLOptionElement for code cleanup
Comment 1 Kangil Han 2013-06-28 23:16:09 PDT
Created attachment 205763 [details]
Patch
Comment 2 Andreas Kling 2013-06-28 23:43:17 PDT
Comment on attachment 205763 [details]
Patch

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

r=me

> Source/WebCore/html/HTMLCollection.cpp:227
>          if (element->hasLocalName(optionTag)) {

I wonder if we could use isHTMLOptionElement() here instead of just checking the localName.

> Source/WebCore/html/HTMLSelectElement.cpp:244
> +        if (items[i]->hasLocalName(optionTag)) {

Ditto.

> Source/WebCore/html/HTMLSelectElement.cpp:265
>          if (items[i]->hasLocalName(optionTag)) {

Ditto.

> Source/WebCore/html/HTMLSelectElement.cpp:979
>          if (!items[i]->hasLocalName(optionTag))

Ditto.
Comment 3 Kangil Han 2013-06-29 00:14:12 PDT
(In reply to comment #2)
> (From update of attachment 205763 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=205763&action=review
> 
> r=me
> 
> > Source/WebCore/html/HTMLCollection.cpp:227
> >          if (element->hasLocalName(optionTag)) {
> 
> I wonder if we could use isHTMLOptionElement() here instead of just checking the localName.
> 
> > Source/WebCore/html/HTMLSelectElement.cpp:244
> > +        if (items[i]->hasLocalName(optionTag)) {
> 
> Ditto.
> 
> > Source/WebCore/html/HTMLSelectElement.cpp:265
> >          if (items[i]->hasLocalName(optionTag)) {
> 
> Ditto.
> 
> > Source/WebCore/html/HTMLSelectElement.cpp:979
> >          if (!items[i]->hasLocalName(optionTag))
> 
> Ditto.

Agreed.
IMHO, I can replace hasLocalName(tag) stuff with isFooElement in another patch when adoption is/toFooElement is completed. :)
Comment 4 WebKit Commit Bot 2013-06-29 01:19:21 PDT
Comment on attachment 205763 [details]
Patch

Clearing flags on attachment: 205763

Committed r152208: <http://trac.webkit.org/changeset/152208>
Comment 5 WebKit Commit Bot 2013-06-29 01:19:23 PDT
All reviewed patches have been landed.  Closing bug.