Changeset 63111 in webkit


Ignore:
Timestamp:
Jul 12, 2010 1:53:58 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-07-11 Eric Seidel <eric@webkit.org>

Reviewed by Darin Adler.

Always generate SVGNames and MathMLNames for all ports (to support HTML5)
https://bugs.webkit.org/show_bug.cgi?id=42050

Historically, FOONames has only been generate when ENABLE(FOO) is defined.
However, for HTML5 parser support, we need to have access to the SVG
and MathML tag names regardless of whether we the engine is configured
to render SVG or MathML content.

This change enables generation of SVGNames and MathMLNames on all ports and
makes it so that ports can include FOOElementFactory.* regardless of whether
ENABLE(FOO) is defined (and have it do the right thing).

No functional change (yet) so no tests.

  • DerivedSources.make:
  • GNUmakefile.am:
  • WebCore.gyp/WebCore.gyp:
  • WebCore.pri:
  • dom/make_names.pl:
Location:
trunk/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r63109 r63111  
     12010-07-11  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Always generate SVGNames and MathMLNames for all ports (to support HTML5)
     6        https://bugs.webkit.org/show_bug.cgi?id=42050
     7
     8        Historically, FOONames has only been generate when ENABLE(FOO) is defined.
     9        However, for HTML5 parser support, we need to have access to the SVG
     10        and MathML tag names regardless of whether we the engine is configured
     11        to render SVG or MathML content.
     12
     13        This change enables generation of SVGNames and MathMLNames on all ports and
     14        makes it so that ports can include FOOElementFactory.* regardless of whether
     15        ENABLE(FOO) is defined (and have it do the right thing).
     16
     17        No functional change (yet) so no tests.
     18
     19        * DerivedSources.make:
     20        * GNUmakefile.am:
     21        * WebCore.gyp/WebCore.gyp:
     22        * WebCore.pri:
     23        * dom/make_names.pl:
     24
    1252010-07-10  Eric Seidel  <eric@webkit.org>
    226
  • trunk/WebCore/DerivedSources.make

    r63064 r63111  
    715715# SVG tag and attribute names, and element factory
    716716
    717 ifeq ($(findstring ENABLE_SVG,$(FEATURE_DEFINES)), ENABLE_SVG)
    718 
    719717ifeq ($(findstring ENABLE_SVG_USE,$(FEATURE_DEFINES)), ENABLE_SVG_USE)
    720718    SVG_FLAGS := $(SVG_FLAGS) ENABLE_SVG_USE=1
     
    759757        perl -I $(WebCore)/bindings/scripts $< --attrs $(WebCore)/svg/xlinkattrs.in
    760758
    761 else
    762 
    763 SVGElementFactory.cpp :
    764         echo > $@
    765 
    766 SVGNames.cpp :
    767         echo > $@
    768 
    769 XLinkNames.cpp :
    770         echo > $@
    771 
    772 # This file is autogenerated by make_names.pl when SVG is enabled.
    773 
    774 JSSVGElementWrapperFactory.cpp :
    775         echo > $@
    776 
    777 endif
    778 
    779759# --------
    780760
     
    800780# MathML tag and attribute names, and element factory
    801781
    802 ifeq ($(findstring ENABLE_MATHML,$(FEATURE_DEFINES)), ENABLE_MATHML)
    803 
    804782MathMLElementFactory.cpp MathMLNames.cpp : dom/make_names.pl mathml/mathtags.in mathml/mathattrs.in
    805783        perl -I $(WebCore)/bindings/scripts $< --tags $(WebCore)/mathml/mathtags.in --attrs $(WebCore)/mathml/mathattrs.in --factory --wrapperFactory
    806 
    807 else
    808 
    809 MathMLElementFactory.cpp :
    810         echo > $@
    811 
    812 MathMLNames.cpp :
    813         echo > $@
    814 
    815 endif
    816 
    817 
    818784
    819785# --------
  • trunk/WebCore/GNUmakefile.am

    r63050 r63111  
    31373137        WebCore/mathml/RenderMathMLUnderOver.h
    31383138
     3139endif # END ENABLE_MATHML
     3140
    31393141webcore_built_sources += \
    31403142        DerivedSources/WebCore/MathMLElementFactory.cpp \
     
    31503152DerivedSources/WebCore/MathMLElementFactory.cpp DerivedSources/WebCore/MathMLNames.cpp: $(WebCore)/dom/make_names.pl $(WebCore)/mathml/mathtags.in $(WebCore)/mathml/mathattrs.in
    31513153        $(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $< --tags $(WebCore)/mathml/mathtags.in --attrs $(WebCore)/mathml/mathattrs.in --factory --wrapperFactory --outputDir "$(GENSOURCES_WEBCORE)"
    3152 else
    3153 DerivedSources/WebCore/MathMLElementFactory.cpp:
    3154         echo > $@
    3155 
    3156 DerivedSources/WebCore/MathMLNames.cpp:
    3157         echo > $@
    3158 
    3159 endif # END ENABLE_MATHML
     3154
    31603155
    31613156# ----
     
    31883183WEBCORE_CSS_PROPERTY_NAMES += $(WebCore)/css/SVGCSSPropertyNames.in
    31893184WEBCORE_CSS_VALUE_KEYWORDS += $(WebCore)/css/SVGCSSValueKeywords.in
    3190 
    3191 webcore_built_sources += \
    3192         DerivedSources/WebCore/JSSVGElementWrapperFactory.cpp \
    3193         DerivedSources/WebCore/SVGElementFactory.cpp \
    3194         DerivedSources/WebCore/SVGNames.cpp \
    3195         DerivedSources/WebCore/XLinkNames.cpp
    31963185
    31973186IDL_BINDINGS += \
     
    38013790endif
    38023791
     3792endif # END ENABLE_SVG
     3793
     3794webcore_built_sources += \
     3795        DerivedSources/WebCore/JSSVGElementWrapperFactory.cpp \
     3796        DerivedSources/WebCore/SVGElementFactory.cpp \
     3797        DerivedSources/WebCore/SVGNames.cpp \
     3798        DerivedSources/WebCore/XLinkNames.cpp
     3799
    38033800# SVG tag and attribute names (need to pass an extra flag if svg experimental features are enabled)
    38043801DerivedSources/WebCore/SVGNames.cpp: DerivedSources/WebCore/SVGElementFactory.cpp;
     
    38203817DerivedSources/WebCore/XLinkNames.cpp : $(WebCore)/dom/make_names.pl $(WebCore)/svg/xlinkattrs.in
    38213818        $(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $< --attrs $(WebCore)/svg/xlinkattrs.in --outputDir "$(GENSOURCES_WEBCORE)"
    3822 
    3823 endif # END ENABLE_SVG
    38243819
    38253820# ----
  • trunk/WebCore/WebCore.gyp/WebCore.gyp

    r62793 r63111  
    389389        },
    390390        {
     391          'action_name': 'MathMLNames',
     392          'inputs': [
     393            '../dom/make_names.pl',
     394            '../mathml/mathtags.in',
     395            '../mathml/mathattrs.in',
     396          ],
     397          'outputs': [
     398            '<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLNames.cpp',
     399            '<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLNames.h',
     400          ],
     401          'action': [
     402            'python',
     403            'scripts/action_makenames.py',
     404            '<@(_outputs)',
     405            '--',
     406            '<@(_inputs)',
     407            '--',
     408            '--extraDefines', '<(feature_defines)'
     409          ],
     410        },
     411        {
    391412          'action_name': 'UserAgentStyleSheets',
    392413          'inputs': [
     
    686707        '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLNSNames.cpp',
    687708        '<(SHARED_INTERMEDIATE_DIR)/webkit/XMLNames.cpp',
     709        '<(SHARED_INTERMEDIATE_DIR)/webkit/SVGNames.cpp',
     710        '<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLNames.cpp',
    688711
    689712        # Additional .cpp files from the webcore_bindings_sources rules.
     
    710733          'sources': [
    711734            '<(SHARED_INTERMEDIATE_DIR)/webkit/SVGElementFactory.cpp',
    712             '<(SHARED_INTERMEDIATE_DIR)/webkit/SVGNames.cpp',
    713735            '<(SHARED_INTERMEDIATE_DIR)/webkit/V8SVGElementWrapperFactory.cpp',
    714736         ],
  • trunk/WebCore/WebCore.pri

    r63064 r63111  
    667667INSPECTOR_INTERFACES = inspector/InspectorFrontend2.idl
    668668
    669 contains(DEFINES, ENABLE_MATHML=1) {
    670     mathmlnames.output = $${WC_GENERATED_SOURCES_DIR}/MathMLNames.cpp
    671     mathmlnames.input = MATHML_NAMES
    672     mathmlnames.wkScript = $$PWD/dom/make_names.pl
    673     mathmlnames.commands = perl -I$$PWD/bindings/scripts $$mathmlnames.wkScript --tags $$PWD/mathml/mathtags.in --attrs $$PWD/mathml/mathattrs.in --extraDefines \"$${DEFINES}\" --preprocessor \"$${QMAKE_MOC} -E\" --factory --wrapperFactory --outputDir $$WC_GENERATED_SOURCES_DIR
    674     mathmlnames.wkExtraSources = $${WC_GENERATED_SOURCES_DIR}/MathMLElementFactory.cpp
    675     addExtraCompiler(mathmlnames)
    676 }
     669mathmlnames.output = $${WC_GENERATED_SOURCES_DIR}/MathMLNames.cpp
     670mathmlnames.input = MATHML_NAMES
     671mathmlnames.wkScript = $$PWD/dom/make_names.pl
     672mathmlnames.commands = perl -I$$PWD/bindings/scripts $$mathmlnames.wkScript --tags $$PWD/mathml/mathtags.in --attrs $$PWD/mathml/mathattrs.in --extraDefines \"$${DEFINES}\" --preprocessor \"$${QMAKE_MOC} -E\" --factory --wrapperFactory --outputDir $$WC_GENERATED_SOURCES_DIR
     673mathmlnames.wkExtraSources = $${WC_GENERATED_SOURCES_DIR}/MathMLElementFactory.cpp
     674addExtraCompiler(mathmlnames)
    677675
    678676contains(DEFINES, ENABLE_WML=1) {
     
    685683}
    686684
    687 contains(DEFINES, ENABLE_SVG=1) {
    688     # GENERATOR 5-C:
    689     svgnames.output = $${WC_GENERATED_SOURCES_DIR}/SVGNames.cpp
    690     svgnames.input = SVG_NAMES
    691     svgnames.depends = $$PWD/svg/svgattrs.in
    692     svgnames.wkScript = $$PWD/dom/make_names.pl
    693     svgnames.commands = perl -I$$PWD/bindings/scripts $$svgnames.wkScript --tags $$PWD/svg/svgtags.in --attrs $$PWD/svg/svgattrs.in --extraDefines \"$${DEFINES}\" --preprocessor \"$${QMAKE_MOC} -E\" --factory --wrapperFactory --outputDir $$WC_GENERATED_SOURCES_DIR
    694     svgnames.wkExtraSources = $${WC_GENERATED_SOURCES_DIR}/SVGElementFactory.cpp $${WC_GENERATED_SOURCES_DIR}/JSSVGElementWrapperFactory.cpp
    695     addExtraCompiler(svgnames)
    696 }
     685# GENERATOR 5-C:
     686svgnames.output = $${WC_GENERATED_SOURCES_DIR}/SVGNames.cpp
     687svgnames.input = SVG_NAMES
     688svgnames.depends = $$PWD/svg/svgattrs.in
     689svgnames.wkScript = $$PWD/dom/make_names.pl
     690svgnames.commands = perl -I$$PWD/bindings/scripts $$svgnames.wkScript --tags $$PWD/svg/svgtags.in --attrs $$PWD/svg/svgattrs.in --extraDefines \"$${DEFINES}\" --preprocessor \"$${QMAKE_MOC} -E\" --factory --wrapperFactory --outputDir $$WC_GENERATED_SOURCES_DIR
     691svgnames.wkExtraSources = $${WC_GENERATED_SOURCES_DIR}/SVGElementFactory.cpp $${WC_GENERATED_SOURCES_DIR}/JSSVGElementWrapperFactory.cpp
     692addExtraCompiler(svgnames)
    697693
    698694# GENERATOR 5-D:
  • trunk/WebCore/dom/make_names.pl

    r63109 r63111  
    338338    my %tagConstructorMap = %$tagConstructorMapRef;
    339339
    340     print F "#if $parameters{guardFactoryWith}\n" if $parameters{guardFactoryWith};
    341 
    342340    # This is to avoid generating the same constructor several times.
    343341    my %uniqueTags = ();
     
    373371        }
    374372    }
    375 
    376     print F "#endif\n" if $parameters{guardFactoryWith};
    377373}
    378374
     
    653649#include "config.h"
    654650#include "$parameters{namespace}ElementFactory.h"
    655 
    656651#include "$parameters{namespace}Names.h"
    657652END
    658653;
     654
     655print F "\n#if $parameters{guardFactoryWith}\n\n" if $parameters{guardFactoryWith};
    659656
    660657printElementIncludes($F);
     
    690687printConstructors($F, \%tagConstructorMap);
    691688
    692 print F "#if $parameters{guardFactoryWith}\n" if $parameters{guardFactoryWith};
    693 
    694689print F <<END
    695690static void addTag(const QualifiedName& tag, ConstructorFunction func)
     
    712707
    713708print F "}\n";
    714 print F "#endif\n" if $parameters{guardFactoryWith};
    715709
    716710print F "\nPassRefPtr<$parameters{namespace}Element> $parameters{namespace}ElementFactory::create$parameters{namespace}Element(const QualifiedName& qName, Document* document";
    717711print F ", HTMLFormElement* formElement" if $parameters{namespace} eq "HTML";
    718712print F ", bool createdByParser)\n{\n";
    719 
    720 print F "#if $parameters{guardFactoryWith}\n" if $parameters{guardFactoryWith};
    721713
    722714print F <<END
     
    754746print F "    return $parameters{namespace}Element::create(qName, document);\n";
    755747
    756 if ($parameters{guardFactoryWith}) {
    757 
    758748print F <<END
    759 #else
    760     return 0;
    761 #endif
    762 END
    763 ;
    764 
    765 }
    766 
    767 print F <<END
    768749}
    769750
     
    772753END
    773754;
     755
     756    print F "#endif\n" if $parameters{guardFactoryWith};
    774757
    775758    close F;
     
    815798print F "        static PassRefPtr<$parameters{namespace}Element> create$parameters{namespace}Element(const WebCore::QualifiedName&, WebCore::Document*";
    816799print F ", HTMLFormElement* = 0" if $parameters{namespace} eq "HTML";
    817 print F ", bool /*createdByParser*/ = true);\n";
     800print F ", bool createdByParser = true);\n";
    818801
    819802printf F<<END
     
    924907    printLicenseHeader($F);
    925908
    926     print F "#include \"config.h\"\n\n";
    927 
    928     print F "#if $parameters{guardFactoryWith}\n\n" if $parameters{guardFactoryWith};
    929 
     909    print F "#include \"config.h\"\n";
    930910    print F "#include \"$wrapperFactoryType$parameters{namespace}ElementWrapperFactory.h\"\n";
     911
     912    print F "\n#if $parameters{guardFactoryWith}\n\n" if $parameters{guardFactoryWith};
    931913
    932914    printJSElementIncludes($F, $wrapperFactoryType);
Note: See TracChangeset for help on using the changeset viewer.