Bug 118393 - Adopt is/toHTMLTableElement for code cleanup
Summary: Adopt is/toHTMLTableElement 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-07-04 07:43 PDT by Kangil Han
Modified: 2013-07-07 23:53 PDT (History)
3 users (show)

See Also:


Attachments
Patch (29.13 KB, patch)
2013-07-04 07:47 PDT, Kangil Han
no flags Details | Formatted Diff | Diff
Patch (29.07 KB, patch)
2013-07-07 21:45 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-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.