Bug 137174

Summary: Automatically generate template specializations for most Elements
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, commit-queue, dbarton, d-r, esprehn+autocc, fmalita, fred.wang, gyuyoung.kim, kangil.han, kling, mrobinson, pdr, rakuco, rniwa, ryuan.choi, schenney, sergio
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
WIP Patch
none
Patch
none
Patch none

Description Chris Dumez 2014-09-27 00:43:19 PDT
Currently, the template specializations to make is<>() / downcast<>() work for HTML/SVG/MathML elements are only generated if "generateTypeHelpers" parameter is explicitly specified for the corresponding tag name in the *Tags.in file. We are however able to generate the template specializations for most types so I would propose we generate those helpers by default.

One case we cannot generate the specialization is when a class is associated to several tag names but the make_names.pl script could easily detect this and skip those classes.
Comment 1 Chris Dumez 2014-09-27 00:50:04 PDT
Created attachment 238768 [details]
WIP Patch
Comment 2 Chris Dumez 2014-09-27 10:59:14 PDT
Created attachment 238781 [details]
Patch
Comment 3 WebKit Commit Bot 2014-09-27 11:00:56 PDT
Attachment 238781 [details] did not pass style-queue:


ERROR: Source/WebCore/svg/SVGAnimateElement.h:82:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
Total errors found: 1 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Darin Adler 2014-09-28 17:27:44 PDT
Comment on attachment 238781 [details]
Patch

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

Looks great.

> Source/WebCore/svg/SVGAnimateElement.h:35
> +class SVGAnimateElementBase : public SVGAnimationElement {

I think we should consider moving SVGAnimateElementBase to its own separate source file.
Comment 5 Chris Dumez 2014-09-28 18:17:18 PDT
Created attachment 238833 [details]
Patch
Comment 6 WebKit Commit Bot 2014-09-28 18:18:36 PDT
Attachment 238833 [details] did not pass style-queue:


ERROR: Source/WebCore/svg/SVGAnimateElementBase.h:81:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
Total errors found: 1 in 34 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 WebKit Commit Bot 2014-09-28 19:13:47 PDT
Comment on attachment 238833 [details]
Patch

Clearing flags on attachment: 238833

Committed r174050: <http://trac.webkit.org/changeset/174050>
Comment 8 WebKit Commit Bot 2014-09-28 19:13:56 PDT
All reviewed patches have been landed.  Closing bug.