Bug 120676 - Generate toFooElement() functions from tagname data.
Summary: Generate toFooElement() functions from tagname data.
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Gyuyoung Kim
Depends on: 120584
  Show dependency treegraph
Reported: 2013-09-04 04:16 PDT by Gyuyoung Kim
Modified: 2013-09-09 23:37 PDT (History)
4 users (show)

See Also:

Simple suggestion based on r154965 (3.76 KB, patch)
2013-09-04 04:18 PDT, Gyuyoung Kim
no flags Details | Formatted Diff | Diff
WIP (20.34 KB, patch)
2013-09-04 05:59 PDT, Gyuyoung Kim
no flags Details | Formatted Diff | Diff
Patch (39.68 KB, patch)
2013-09-04 20:37 PDT, 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 2013-09-04 04:16:07 PDT
As r154965, it looks we can also generate toFooElement() functions from tagname data. Kling, how do you think to generate toFooElement() as well ?
Comment 1 Gyuyoung Kim 2013-09-04 04:18:18 PDT
Created attachment 210444 [details]
Simple suggestion based on r154965
Comment 2 Gyuyoung Kim 2013-09-04 05:59:21 PDT
Created attachment 210451 [details]
Comment 3 Gyuyoung Kim 2013-09-04 20:37:20 PDT
Created attachment 210542 [details]
Comment 4 WebKit Commit Bot 2013-09-04 20:38:55 PDT
Attachment 210542 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCore/GNUmakefile.am', u'Source/WebCore/GNUmakefile.list.am', u'Source/WebCore/WebCore.vcxproj/WebCore.vcxproj', u'Source/WebCore/WebCore.xcodeproj/project.pbxproj', u'Source/WebCore/dom/make_names.pl', u'Source/WebCore/html/HTMLAnchorElement.h', u'Source/WebCore/html/HTMLAreaElement.h', u'Source/WebCore/html/HTMLAudioElement.h', u'Source/WebCore/html/HTMLCanvasElement.h', u'Source/WebCore/html/HTMLElement.h', u'Source/WebCore/html/HTMLFormElement.h', u'Source/WebCore/html/HTMLFrameSetElement.h', u'Source/WebCore/html/HTMLImageElement.h', u'Source/WebCore/html/HTMLInputElement.h', u'Source/WebCore/html/HTMLLabelElement.h', u'Source/WebCore/html/HTMLMapElement.h', u'Source/WebCore/html/HTMLMeterElement.h', u'Source/WebCore/html/HTMLOptGroupElement.h', u'Source/WebCore/html/HTMLOptionElement.h', u'Source/WebCore/html/HTMLProgressElement.h', u'Source/WebCore/html/HTMLScriptElement.h', u'Source/WebCore/html/HTMLStyleElement.h', u'Source/WebCore/html/HTMLTableElement.h', u'Source/WebCore/html/HTMLTableRowElement.h', u'Source/WebCore/html/HTMLTagNames.in', u'Source/WebCore/html/HTMLTextAreaElement.h', u'Source/WebCore/html/HTMLTitleElement.h', u'Source/WebCore/svg/SVGElement.h', u'Source/WebCore/svg/SVGFontElement.h', u'Source/WebCore/svg/SVGFontFaceElement.h', u'Source/WebCore/svg/SVGImageElement.h', u'Source/WebCore/svg/SVGScriptElement.h', u'Source/WebCore/svg/svgtags.in']" exit_code: 1
Source/WebCore/html/HTMLElement.h:28:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 1 in 11 files

If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Andreas Kling 2013-09-05 15:29:33 PDT
Comment on attachment 210542 [details]

So cool! r=me
Comment 6 WebKit Commit Bot 2013-09-05 15:56:42 PDT
Comment on attachment 210542 [details]

Clearing flags on attachment: 210542

Committed r155155: <http://trac.webkit.org/changeset/155155>
Comment 7 WebKit Commit Bot 2013-09-05 15:56:45 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Kent Tamura 2013-09-09 23:37:29 PDT
Comment on attachment 210542 [details]

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

> Source/WebCore/dom/make_names.pl:638
> +        print F "inline $class* $castingHelper(Node* node) { ASSERT_WITH_SECURITY_IMPLICATION(!node || $checkHelper(node)); return reinterpret_cast<".$class."*>(node); }\n";

AFAIK, C++ standard doesn't have guarantee that reinterpret_cast<derived_class*>(base_class_pointer) works.  It's a compiler-dependent behavior.