Changeset 34484 in webkit
- Timestamp:
- Jun 10, 2008 1:49:27 PM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r34475 r34484 1 2008-06-10 Julien Chaffraix <jchaffraix@webkit.org> 2 3 Reviewed by Eric. 4 5 Part of bug 19200: *.in files should embed more information 6 https://bugs.webkit.org/show_bug.cgi?id=19200 7 8 Move more parameters to the XML files. 9 10 * dom/make_names.pl: 11 * html/HTMLAttributeNames.in: 12 * html/HTMLTagNames.in: 13 * svg/svgattrs.in: 14 * svg/svgtags.in: 15 1 16 2008-06-09 Dan Bernstein <mitz@apple.com> 2 17 -
trunk/WebCore/dom/make_names.pl
r34467 r34484 36 36 use XMLTiny qw(parsefile); 37 37 38 my $printFactory = 0;39 my $printWrapperFactory = 0;40 38 my $tagsFile = ""; 41 39 my $attrsFile = ""; … … 44 42 my %attrs = (); 45 43 my %parameters = (); 46 my $tagsNullNamespace = 0;47 my $attrsNullNamespace = 0;48 44 my $extraDefines = 0; 49 45 my $preprocessor = "/usr/bin/gcc -E -P -x c++"; 50 my $guardFactoryWith = 0;51 46 my %svgCustomMappings = (); 52 47 my %htmlCustomMappings = (); … … 55 50 'attrs=s' => \$attrsFile, 56 51 'outputDir=s' => \$outputDir, 57 'factory' => \$printFactory,58 'wrapperFactory' => \$printWrapperFactory,59 'tagsNullNamespace' => \$tagsNullNamespace,60 'attrsNullNamespace' => \$attrsNullNamespace,61 52 'extraDefines=s' => \$extraDefines, 62 'preprocessor=s' => \$preprocessor, 63 'guardFactoryWith=s' => \$guardFactoryWith); 53 'preprocessor=s' => \$preprocessor); 64 54 65 55 die "You must specify at least one of --tags <file> or --attrs <file>" unless (length($tagsFile) || length($attrsFile)); … … 82 72 printNamesCppFile("$namesBasePath.cpp"); 83 73 84 if ($p rintFactory) {74 if ($parameters{'generateFactory'}) { 85 75 printFactoryCppFile("$factoryBasePath.cpp"); 86 76 printFactoryHeaderFile("$factoryBasePath.h"); 87 77 } 88 78 89 if ($p rintWrapperFactory) {79 if ($parameters{'generateWrapperFactory'}) { 90 80 printWrapperFactoryCppFile("$wrapperFactoryBasePath.cpp"); 91 81 printWrapperFactoryHeaderFile("$wrapperFactoryBasePath.h"); … … 110 100 'namespacePrefix' => '', 111 101 'namespaceURI' => '', 112 'cppNamespace' => ''); 102 'cppNamespace' => '', 103 'generateFactory' => 0, 104 'guardFactoryWith' => '', 105 'generateWrapperFactory' => 0, 106 # The 2 nullNamespace properties are generated from the "nullNamespace" attribute with respect to the file parsed (attrs or tags). 107 'tagsNullNamespace' => 0, 108 'attrsNullNamespace' => 0); 113 109 } 114 110 … … 162 158 sub parseParameters 163 159 { 164 my $propertiesRef = shift;160 my ($propertiesRef, $elementName) = @_; 165 161 my %properties = %$propertiesRef; 166 162 … … 170 166 # Parse the XML attributes. 171 167 foreach my $property (keys %properties) { 172 die "Unknown parameter $property for tags/attrs\n" if !defined($parameters{$property}); 173 $parameters{$property} = $properties{$property}; 168 # This is used in case we want to change the parameter name depending 169 # on what is parsed. 170 my $parameter = $property; 171 172 # "nullNamespace" case 173 if ($property eq "nullNamespace") { 174 $parameter = $elementName.(ucfirst $property); 175 } 176 177 die "Unknown parameter $property for tags/attrs\n" if !defined($parameters{$parameter}); 178 $parameters{$parameter} = $properties{$property}; 174 179 } 175 180 } … … 201 206 switch($name) { 202 207 case "tags" { 203 parseParameters(\%{$document{'attrib'}} );208 parseParameters(\%{$document{'attrib'}}, $name); 204 209 parseTags(\@{$document{'content'}}); 205 210 } 206 211 case "attrs" { 207 parseParameters(\%{$document{'attrib'}} );212 parseParameters(\%{$document{'attrib'}}, $name); 208 213 parseAttrs(\@{$document{'content'}}); 209 214 } else { … … 230 235 my %names = %$namesRef; 231 236 232 print F "#if $ guardFactoryWith\n" if $guardFactoryWith;237 print F "#if $parameters{'guardFactoryWith'}\n" if $parameters{'guardFactoryWith'}; 233 238 for my $name (sort keys %names) { 234 239 my $ucName = $names{$name}{"upperCase"}; … … 239 244 print F "}\n\n"; 240 245 } 241 print F "#endif\n" if $ guardFactoryWith;246 print F "#endif\n" if $parameters{'guardFactoryWith'}; 242 247 } 243 248 … … 426 431 print(F " new ((void*)&${lowerNamespace}NamespaceURI) AtomicString(${lowerNamespace}NS);\n\n"); 427 432 if (keys %tags) { 428 my $tagsNamespace = $ tagsNullNamespace? "nullAtom" : "${lowerNamespace}NS";433 my $tagsNamespace = $parameters{'tagsNullNamespace'} ? "nullAtom" : "${lowerNamespace}NS"; 429 434 printDefinitions($F, \%tags, "tags", $tagsNamespace); 430 435 } 431 436 if (keys %attrs) { 432 my $attrsNamespace = $ attrsNullNamespace? "nullAtom" : "${lowerNamespace}NS";437 my $attrsNamespace = $parameters{'attrsNullNamespace'} ? "nullAtom" : "${lowerNamespace}NS"; 433 438 printDefinitions($F, \%attrs, "attributes", $attrsNamespace); 434 439 } … … 530 535 printConstructors($F, \%tags); 531 536 532 print F "#if $ guardFactoryWith\n" if $guardFactoryWith;537 print F "#if $parameters{'guardFactoryWith'}\n" if $parameters{'guardFactoryWith'}; 533 538 534 539 print F <<END … … 547 552 548 553 print F "}\n"; 549 print F "#endif\n\n" if $ guardFactoryWith;554 print F "#endif\n\n" if $parameters{'guardFactoryWith'}; 550 555 551 556 print F <<END … … 555 560 ; 556 561 557 print F "#if $ guardFactoryWith\n" if $guardFactoryWith;562 print F "#if $parameters{'guardFactoryWith'}\n" if $parameters{'guardFactoryWith'}; 558 563 559 564 print F <<END … … 577 582 ; 578 583 579 if ($ guardFactoryWith) {584 if ($parameters{'guardFactoryWith'}) { 580 585 581 586 print F <<END … … 754 759 print F "#include \"config.h\"\n\n"; 755 760 756 print F "#if $ guardFactoryWith\n\n" if $guardFactoryWith;761 print F "#if $parameters{'guardFactoryWith'}\n\n" if $parameters{'guardFactoryWith'}; 757 762 758 763 print F "#include \"JS$parameters{'namespace'}ElementWrapperFactory.h\"\n"; … … 817 822 ; 818 823 819 print F "#endif\n" if $ guardFactoryWith;824 print F "#endif\n" if $parameters{'guardFactoryWith'}; 820 825 821 826 close F; … … 833 838 print F "#define JS$parameters{'namespace'}ElementWrapperFactory_h\n\n"; 834 839 835 print F "#if $ {guardFactoryWith}\n" if $guardFactoryWith;840 print F "#if $parameters{'guardFactoryWith'}\n" if $parameters{'guardFactoryWith'}; 836 841 837 842 print F <<END … … 854 859 ; 855 860 856 print F "#endif // $ guardFactoryWith\n\n" if $guardFactoryWith;861 print F "#endif // $parameters{'guardFactoryWith'}\n\n" if $parameters{'guardFactoryWith'}; 857 862 858 863 print F "#endif // JS$parameters{'namespace'}ElementWrapperFactory_h\n"; -
trunk/WebCore/html/HTMLAttributeNames.in
r34467 r34484 1 <attrs namespace="HTML" namespacePrefix="xhtml" cppNamespace="WebCore" namespaceURI="http://www.w3.org/1999/xhtml" >1 <attrs namespace="HTML" namespacePrefix="xhtml" cppNamespace="WebCore" namespaceURI="http://www.w3.org/1999/xhtml" generateFactory="1" generateWrapperFactory="1" nullNamespace="1"> 2 2 <abbr/> 3 3 <accept_charset/> -
trunk/WebCore/html/HTMLTagNames.in
r34467 r34484 1 <tags namespace="HTML" namespacePrefix="xhtml" cppNamespace="WebCore" namespaceURI="http://www.w3.org/1999/xhtml" >1 <tags namespace="HTML" namespacePrefix="xhtml" cppNamespace="WebCore" namespaceURI="http://www.w3.org/1999/xhtml" generateFactory="1" generateWrapperFactory="1"> 2 2 <a upperCase="Anchor"/> 3 3 <abbr/> -
trunk/WebCore/svg/svgattrs.in
r34467 r34484 1 <attrs namespace="SVG" cppNamespace="WebCore" namespaceURI="http://www.w3.org/2000/svg" >1 <attrs namespace="SVG" cppNamespace="WebCore" namespaceURI="http://www.w3.org/2000/svg" generateFactory="1" generateWrapperFactory="1" guardFactoryWith="ENABLE(SVG)" nullNamespace="1"> 2 2 <accent-height/> 3 3 <accumulate/> -
trunk/WebCore/svg/svgtags.in
r34467 r34484 1 <tags namespace="SVG" cppNamespace="WebCore" namespaceURI="http://www.w3.org/2000/svg" >1 <tags namespace="SVG" cppNamespace="WebCore" namespaceURI="http://www.w3.org/2000/svg" generateFactory="1" generateWrapperFactory="1" guardFactoryWith="ENABLE(SVG)"> 2 2 <a/> 3 3 #if ENABLE_SVG_FONTS
Note: See TracChangeset
for help on using the changeset viewer.