Bug 118212

Summary: Adopt is/toHTMLOptionElement for code cleanup
Product: WebKit Reporter: Kangil Han <kangil.han>
Component: WebCore Misc.Assignee: Kangil Han <kangil.han>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, kling, koivisto
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

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.