Bug 9191 - JS*ElementWrapperFactory should be autogenerated
Summary: JS*ElementWrapperFactory should be autogenerated
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-31 10:37 PDT by Eric Seidel (no email)
Modified: 2008-05-22 14:30 PDT (History)
3 users (show)

See Also:


Attachments
First try (46.43 KB, patch)
2008-05-16 18:23 PDT, Julien Chaffraix
eric: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2006-05-31 10:37:16 PDT
Currently we use JSHTMLElementWrapperFactory and JSSVGElementWrapper factory when converting from impl pointers to the actual JS* binding classes.  These are currently manually edited files, but they should be autogenerated.  It should not be hard to modify ksvg2/scripts/make_names.pl to generate this sort of file as well.  Once all of our bindings are autogenerated, it would be simple to use htmltags.in and svgtags.in as source data for these files.  It would also be possible to use exiting logic in WebCore/bindings/scripts/CodeGenerator.pm to crawl through all .idl files to find all classes.

Another way to work this would be to unify JS*ElementWrapperFactory files into a single hash lookup.  That could be autogenerated.
Comment 1 Eric Seidel (no email) 2007-01-31 04:57:41 PST
Yeah, this needs to be fixed.  These files are already out of date.
Comment 2 Eric Seidel (no email) 2007-12-27 02:31:36 PST
Eventually we'll fix this.  It's just an hour or so of tweaking the perl scripts.
Comment 3 Julien Chaffraix 2008-05-16 18:23:54 PDT
Created attachment 21207 [details]
First try
Comment 4 Eric Seidel (no email) 2008-05-20 14:27:29 PDT
Comment on attachment 21207 [details]
First try

Wow.  Totally awesome.

I assume you've diff'd the generated file from the old manual file to confirm that there are no bad changes?

I think long term we want to move away from hacks in the perl file, and instead use a more advanced data file for generation.  For example, you could encode all of the information from the perl hashes in the htmltags.in file using proper comments.  (Or we could turn things like htmltags.in into XML like mozilla has for their bindings stuff.)
Comment 5 Julien Chaffraix 2008-05-21 12:51:02 PDT
(In reply to comment #4)
> (From update of attachment 21207 [details] [edit])
> Wow.  Totally awesome.
> 
> I assume you've diff'd the generated file from the old manual file to confirm
> that there are no bad changes?

Yes (it is not exactly a diff as the old code is using some macros to generate the code). The preparatory work I checked in last week was to guarantee that all tags would be guarded by the right #ifdefine guard and are not taken into account if the guard is not matched.

I have also tested the build thoroughly with different options to confirm that I had not forgotten some generated code.

> I think long term we want to move away from hacks in the perl file, and instead
> use a more advanced data file for generation.  For example, you could encode
> all of the information from the perl hashes in the htmltags.in file using
> proper comments.  (Or we could turn things like htmltags.in into XML like
> mozilla has for their bindings stuff.)

I think the best way here is to opt for XML files. Some of make_names.pl parameters could also be included (like guardCppWith...) in the *.in files. It would also clean and simplify make_names.pl.
Comment 6 Julien Chaffraix 2008-05-22 14:30:45 PDT
Committed in r34034.

Submitted bug 19200 about the information that should be moved to the *.in files.