Bug 126418 - Add toHTMLTableSectionElement() functions, and use it
Summary: Add toHTMLTableSectionElement() functions, and use it
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Gyuyoung Kim
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-02 22:37 PST by Gyuyoung Kim
Modified: 2014-01-07 05:58 PST (History)
4 users (show)

See Also:


Attachments
Patch (4.47 KB, patch)
2014-01-02 22:38 PST, Gyuyoung Kim
no flags Details | Formatted Diff | Diff
Patch (5.20 KB, patch)
2014-01-03 01:42 PST, Gyuyoung Kim
no flags Details | Formatted Diff | Diff
Patch (5.20 KB, patch)
2014-01-03 01:43 PST, Gyuyoung Kim
no flags Details | Formatted Diff | Diff
Patch (4.11 KB, patch)
2014-01-07 01:44 PST, Gyuyoung Kim
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gyuyoung Kim 2014-01-02 22:37:30 PST
When    9          generating toFoo(), we can use more plenty of helper functions. This patch generate toHTMLTableElement() using existing templates.
Comment 1 Gyuyoung Kim 2014-01-02 22:38:23 PST
Created attachment 220280 [details]
Patch
Comment 2 Gyuyoung Kim 2014-01-02 22:39:13 PST
CC'ing Kling.
Comment 3 Andreas Kling 2014-01-02 23:25:21 PST
Comment on attachment 220280 [details]
Patch

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

> Source/WebCore/ChangeLog:3
> +        Generate toHTMLTableElement(), and use it

This patch seems to be about toHTMLTableSectionElement(), not toHTMLTableElement().

> Source/WebCore/html/HTMLTagNames.in:121
> -tbody interfaceName=HTMLTableSectionElement
> +tbody interfaceName=HTMLTableSectionElement, generateTypeHelpers

HTMLTableSectionElement can have one of three tags: <thead>, <tbody> or <tfoot>.
This would generate an isHTMLTableSectionElement() that only returns true for <tbody>.
Comment 4 Gyuyoung Kim 2014-01-03 00:35:20 PST
Comment on attachment 220280 [details]
Patch

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

>> Source/WebCore/ChangeLog:3
>> +        Generate toHTMLTableElement(), and use it
> 
> This patch seems to be about toHTMLTableSectionElement(), not toHTMLTableElement().

Oops. my mistake.

>> Source/WebCore/html/HTMLTagNames.in:121
>> +tbody interfaceName=HTMLTableSectionElement, generateTypeHelpers
> 
> HTMLTableSectionElement can have one of three tags: <thead>, <tbody> or <tfoot>.
> This would generate an isHTMLTableSectionElement() that only returns true for <tbody>.

Ah, right. I forget it. I'm sorry. If so, how about adding manual toHTMLTableSectionElement() for HTMLTableSectionElement ?
Comment 5 Gyuyoung Kim 2014-01-03 01:42:24 PST
Created attachment 220293 [details]
Patch
Comment 6 Gyuyoung Kim 2014-01-03 01:43:56 PST
Created attachment 220294 [details]
Patch
Comment 7 Gyuyoung Kim 2014-01-03 02:38:56 PST
kling, how about this latest one ?
Comment 8 WebKit Commit Bot 2014-01-06 21:11:13 PST
Comment on attachment 220294 [details]
Patch

Clearing flags on attachment: 220294

Committed r161401: <http://trac.webkit.org/changeset/161401>
Comment 9 WebKit Commit Bot 2014-01-06 21:11:17 PST
All reviewed patches have been landed.  Closing bug.
Comment 10 Alexey Proskuryakov 2014-01-06 22:24:59 PST
This broke dozens of tests, which crash now.

http://build.webkit.org/results/Apple%20Mavericks%20Debug%20WK1%20(Tests)/r161401%20(1535)/results.html
Comment 11 Gyuyoung Kim 2014-01-06 23:08:12 PST
Reverted r161401 for reason:

REGRESSION(r161401): Break layout test on mac-wk1(Debug)

Committed r161408: <http://trac.webkit.org/changeset/161408>
Comment 12 Andreas Kling 2014-01-06 23:17:17 PST
Comment on attachment 220294 [details]
Patch

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

Can't this just use NODE_TYPE_CASTS instead? SVGSMILElement does something similar.

> Source/WebCore/html/HTMLTableSectionElement.h:66
> +    return node.hasTagName(HTMLNames::trTag) || node.hasTagName(HTMLNames::tfootTag) || node.hasTagName(HTMLNames::tbodyTag);

trTag should be theadTag here.

> Source/WebCore/html/HTMLTableSectionElement.h:94
> +inline HTMLTableSectionElement* toHTMLTableSectionElement(Node* node)
> +{
> +    ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLTableSectionElement(*node));
> +    return static_cast<HTMLTableSectionElement*>(node);
> +}
> +
> +inline const HTMLTableSectionElement* toHTMLTableSectionElement(const Node* node)
> +{
> +    ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLTableSectionElement(*node));
> +    return static_cast<const HTMLTableSectionElement*>(node);
> +}
> +
> +inline HTMLTableSectionElement& toHTMLTableSectionElement(Node& node)
> +{
> +    ASSERT_WITH_SECURITY_IMPLICATION(isHTMLTableSectionElement(node));
> +    return static_cast<HTMLTableSectionElement&>(node);
> +}
> +
> +inline const HTMLTableSectionElement& toHTMLTableSectionElement(const Node& node)
> +{
> +    ASSERT_WITH_SECURITY_IMPLICATION(isHTMLTableSectionElement(node));
> +    return static_cast<const HTMLTableSectionElement&>(node);
> +}
> +
> +void toHTMLTableSectionElement(const HTMLTableSectionElement*);
> +void toHTMLTableSectionElement(const HTMLTableSectionElement&);

Can't
Comment 13 Gyuyoung Kim 2014-01-07 01:44:23 PST
Created attachment 220504 [details]
Patch
Comment 14 Gyuyoung Kim 2014-01-07 01:45:45 PST
(In reply to comment #12)
> (From update of attachment 220294 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=220294&action=review
> 
> Can't this just use NODE_TYPE_CASTS instead? SVGSMILElement does something similar.

There were many faults. I updated this patch according to your suggestion. Thanks.
Comment 15 WebKit Commit Bot 2014-01-07 05:58:23 PST
Comment on attachment 220504 [details]
Patch

Clearing flags on attachment: 220504

Committed r161420: <http://trac.webkit.org/changeset/161420>
Comment 16 WebKit Commit Bot 2014-01-07 05:58:26 PST
All reviewed patches have been landed.  Closing bug.