Bug 118393

Summary: Adopt is/toHTMLTableElement 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
Patch none

Description Kangil Han 2013-07-04 07:43:59 PDT
Adopt is/toHTMLTableElement for code cleanup
Comment 1 Kangil Han 2013-07-04 07:47:23 PDT
Created attachment 206087 [details]
Patch
Comment 2 WebKit Commit Bot 2013-07-04 07:48:35 PDT
Attachment 206087 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCore/accessibility/AccessibilityRenderObject.cpp', u'Source/WebCore/accessibility/AccessibilityTable.cpp', u'Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceTable.cpp', u'Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp', u'Source/WebCore/css/StyleResolver.cpp', u'Source/WebCore/dom/Position.cpp', u'Source/WebCore/editing/DeleteSelectionCommand.cpp', u'Source/WebCore/editing/InsertLineBreakCommand.cpp', u'Source/WebCore/editing/htmlediting.cpp', u'Source/WebCore/editing/markup.cpp', u'Source/WebCore/html/FTPDirectoryDocument.cpp', u'Source/WebCore/html/HTMLFormElement.cpp', u'Source/WebCore/html/HTMLTableElement.h', u'Source/WebCore/html/HTMLTablePartElement.cpp', u'Source/WebCore/html/HTMLTableRowElement.cpp', u'Source/WebCore/html/HTMLTableRowsCollection.cpp', u'Source/WebCore/html/parser/HTMLElementStack.cpp', u'Source/WebCore/html/parser/HTMLTreeBuilder.cpp', u'Source/WebCore/platform/mac/HTMLConverter.mm', u'Source/WebCore/rendering/RenderObject.cpp', u'Source/WebCore/rendering/RenderTable.cpp']" exit_code: 1
Source/WebCore/editing/DeleteSelectionCommand.cpp:449:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Total errors found: 1 in 22 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Kangil Han 2013-07-04 07:51:08 PDT
Style error is not related to this patch. :)
Comment 4 Andreas Kling 2013-07-05 02:44:56 PDT
Comment on attachment 206087 [details]
Patch

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

r=me with some minor changes:

> Source/WebCore/html/HTMLTableElement.h:103
> +inline bool isHTMLTableElement(Node* node)

The argument should be const Node*, otherwise we can only call isHTMLTableElement on non-const Nodes.

> Source/WebCore/html/HTMLTableElement.h:111
> +inline bool isHTMLTableElement(Element* element)
> +{
> +    return element->hasTagName(HTMLNames::tableTag);
> +}

This overload shouldn't be necessary.
Comment 5 Kangil Han 2013-07-07 21:45:16 PDT
Created attachment 206217 [details]
Patch
Comment 6 Kangil Han 2013-07-07 21:47:23 PDT
(In reply to comment #4)
> (From update of attachment 206087 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=206087&action=review
> 
> r=me with some minor changes:
> 
> > Source/WebCore/html/HTMLTableElement.h:103
> > +inline bool isHTMLTableElement(Node* node)
> 
> The argument should be const Node*, otherwise we can only call isHTMLTableElement on non-const Nodes.
> 
> > Source/WebCore/html/HTMLTableElement.h:111
> > +inline bool isHTMLTableElement(Element* element)
> > +{
> > +    return element->hasTagName(HTMLNames::tableTag);
> > +}
> 
> This overload shouldn't be necessary.

Done, thx! :)
Took kling's comment into consideration.
Comment 7 WebKit Commit Bot 2013-07-07 23:53:33 PDT
Comment on attachment 206217 [details]
Patch

Clearing flags on attachment: 206217

Committed r152440: <http://trac.webkit.org/changeset/152440>
Comment 8 WebKit Commit Bot 2013-07-07 23:53:35 PDT
All reviewed patches have been landed.  Closing bug.