Commit ecf8ab4d authored by eric@webkit.org's avatar eric@webkit.org

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:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63111 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3084db72
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:
2010-07-10 Eric Seidel <eric@webkit.org>
Reviewed by Adam Barth.
......@@ -714,8 +714,6 @@ XMLNames.cpp : dom/make_names.pl xml/xmlattrs.in
# SVG tag and attribute names, and element factory
ifeq ($(findstring ENABLE_SVG,$(FEATURE_DEFINES)), ENABLE_SVG)
ifeq ($(findstring ENABLE_SVG_USE,$(FEATURE_DEFINES)), ENABLE_SVG_USE)
SVG_FLAGS := $(SVG_FLAGS) ENABLE_SVG_USE=1
endif
......@@ -758,24 +756,6 @@ JSSVGElementWrapperFactory.cpp : SVGNames.cpp
XLinkNames.cpp : dom/make_names.pl svg/xlinkattrs.in
perl -I $(WebCore)/bindings/scripts $< --attrs $(WebCore)/svg/xlinkattrs.in
else
SVGElementFactory.cpp :
echo > $@
SVGNames.cpp :
echo > $@
XLinkNames.cpp :
echo > $@
# This file is autogenerated by make_names.pl when SVG is enabled.
JSSVGElementWrapperFactory.cpp :
echo > $@
endif
# --------
# WML tag and attribute names, and element factory
......@@ -799,23 +779,9 @@ endif
# MathML tag and attribute names, and element factory
ifeq ($(findstring ENABLE_MATHML,$(FEATURE_DEFINES)), ENABLE_MATHML)
MathMLElementFactory.cpp MathMLNames.cpp : dom/make_names.pl mathml/mathtags.in mathml/mathattrs.in
perl -I $(WebCore)/bindings/scripts $< --tags $(WebCore)/mathml/mathtags.in --attrs $(WebCore)/mathml/mathattrs.in --factory --wrapperFactory
else
MathMLElementFactory.cpp :
echo > $@
MathMLNames.cpp :
echo > $@
endif
# --------
# Common generator things
......
......@@ -3136,6 +3136,8 @@ webcore_sources += \
WebCore/mathml/RenderMathMLUnderOver.cpp \
WebCore/mathml/RenderMathMLUnderOver.h
endif # END ENABLE_MATHML
webcore_built_sources += \
DerivedSources/WebCore/MathMLElementFactory.cpp \
DerivedSources/WebCore/MathMLElementFactory.h \
......@@ -3149,14 +3151,7 @@ DerivedSources/WebCore/MathMLNames.h: DerivedSources/WebCore/MathMLNames.cpp
DerivedSources/WebCore/MathMLElementFactory.cpp DerivedSources/WebCore/MathMLNames.cpp: $(WebCore)/dom/make_names.pl $(WebCore)/mathml/mathtags.in $(WebCore)/mathml/mathattrs.in
$(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $< --tags $(WebCore)/mathml/mathtags.in --attrs $(WebCore)/mathml/mathattrs.in --factory --wrapperFactory --outputDir "$(GENSOURCES_WEBCORE)"
else
DerivedSources/WebCore/MathMLElementFactory.cpp:
echo > $@
DerivedSources/WebCore/MathMLNames.cpp:
echo > $@
endif # END ENABLE_MATHML
# ----
# Notifications support
......@@ -3188,12 +3183,6 @@ FEATURE_DEFINES += ENABLE_SVG=1
WEBCORE_CSS_PROPERTY_NAMES += $(WebCore)/css/SVGCSSPropertyNames.in
WEBCORE_CSS_VALUE_KEYWORDS += $(WebCore)/css/SVGCSSValueKeywords.in
webcore_built_sources += \
DerivedSources/WebCore/JSSVGElementWrapperFactory.cpp \
DerivedSources/WebCore/SVGElementFactory.cpp \
DerivedSources/WebCore/SVGNames.cpp \
DerivedSources/WebCore/XLinkNames.cpp
IDL_BINDINGS += \
WebCore/svg/ElementTimeControl.idl \
WebCore/svg/SVGAElement.idl \
......@@ -3800,6 +3789,14 @@ SVG_FEATURES += ENABLE_SVG_ANIMATION=1
webcore_cppflags += -DENABLE_SVG_ANIMATION=1
endif
endif # END ENABLE_SVG
webcore_built_sources += \
DerivedSources/WebCore/JSSVGElementWrapperFactory.cpp \
DerivedSources/WebCore/SVGElementFactory.cpp \
DerivedSources/WebCore/SVGNames.cpp \
DerivedSources/WebCore/XLinkNames.cpp
# SVG tag and attribute names (need to pass an extra flag if svg experimental features are enabled)
DerivedSources/WebCore/SVGNames.cpp: DerivedSources/WebCore/SVGElementFactory.cpp;
DerivedSources/WebCore/JSSVGElementWrapperFactory.cpp: DerivedSources/WebCore/SVGElementFactory.cpp
......@@ -3820,8 +3817,6 @@ DerivedSources/WebCore/XLinkNames.h: DerivedSources/WebCore/XLinkNames.cpp;
DerivedSources/WebCore/XLinkNames.cpp : $(WebCore)/dom/make_names.pl $(WebCore)/svg/xlinkattrs.in
$(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $< --attrs $(WebCore)/svg/xlinkattrs.in --outputDir "$(GENSOURCES_WEBCORE)"
endif # END ENABLE_SVG
# ----
# Web Sockets Support
# ----
......
......@@ -387,6 +387,27 @@
'--extraDefines', '<(feature_defines)'
],
},
{
'action_name': 'MathMLNames',
'inputs': [
'../dom/make_names.pl',
'../mathml/mathtags.in',
'../mathml/mathattrs.in',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLNames.cpp',
'<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLNames.h',
],
'action': [
'python',
'scripts/action_makenames.py',
'<@(_outputs)',
'--',
'<@(_inputs)',
'--',
'--extraDefines', '<(feature_defines)'
],
},
{
'action_name': 'UserAgentStyleSheets',
'inputs': [
......@@ -685,6 +706,8 @@
'<(SHARED_INTERMEDIATE_DIR)/webkit/XLinkNames.cpp',
'<(SHARED_INTERMEDIATE_DIR)/webkit/XMLNSNames.cpp',
'<(SHARED_INTERMEDIATE_DIR)/webkit/XMLNames.cpp',
'<(SHARED_INTERMEDIATE_DIR)/webkit/SVGNames.cpp',
'<(SHARED_INTERMEDIATE_DIR)/webkit/MathMLNames.cpp',
# Additional .cpp files from the webcore_bindings_sources rules.
'<(SHARED_INTERMEDIATE_DIR)/webkit/CSSGrammar.cpp',
......@@ -709,7 +732,6 @@
['enable_svg!=0', {
'sources': [
'<(SHARED_INTERMEDIATE_DIR)/webkit/SVGElementFactory.cpp',
'<(SHARED_INTERMEDIATE_DIR)/webkit/SVGNames.cpp',
'<(SHARED_INTERMEDIATE_DIR)/webkit/V8SVGElementWrapperFactory.cpp',
],
}],
......
......@@ -666,14 +666,12 @@ IDL_BINDINGS += \
INSPECTOR_INTERFACES = inspector/InspectorFrontend2.idl
contains(DEFINES, ENABLE_MATHML=1) {
mathmlnames.output = $${WC_GENERATED_SOURCES_DIR}/MathMLNames.cpp
mathmlnames.input = MATHML_NAMES
mathmlnames.wkScript = $$PWD/dom/make_names.pl
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
mathmlnames.wkExtraSources = $${WC_GENERATED_SOURCES_DIR}/MathMLElementFactory.cpp
addExtraCompiler(mathmlnames)
}
mathmlnames.output = $${WC_GENERATED_SOURCES_DIR}/MathMLNames.cpp
mathmlnames.input = MATHML_NAMES
mathmlnames.wkScript = $$PWD/dom/make_names.pl
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
mathmlnames.wkExtraSources = $${WC_GENERATED_SOURCES_DIR}/MathMLElementFactory.cpp
addExtraCompiler(mathmlnames)
contains(DEFINES, ENABLE_WML=1) {
wmlnames.output = $${WC_GENERATED_SOURCES_DIR}/WMLNames.cpp
......@@ -684,16 +682,14 @@ contains(DEFINES, ENABLE_WML=1) {
addExtraCompiler(wmlnames)
}
contains(DEFINES, ENABLE_SVG=1) {
# GENERATOR 5-C:
svgnames.output = $${WC_GENERATED_SOURCES_DIR}/SVGNames.cpp
svgnames.input = SVG_NAMES
svgnames.depends = $$PWD/svg/svgattrs.in
svgnames.wkScript = $$PWD/dom/make_names.pl
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
svgnames.wkExtraSources = $${WC_GENERATED_SOURCES_DIR}/SVGElementFactory.cpp $${WC_GENERATED_SOURCES_DIR}/JSSVGElementWrapperFactory.cpp
addExtraCompiler(svgnames)
}
# GENERATOR 5-C:
svgnames.output = $${WC_GENERATED_SOURCES_DIR}/SVGNames.cpp
svgnames.input = SVG_NAMES
svgnames.depends = $$PWD/svg/svgattrs.in
svgnames.wkScript = $$PWD/dom/make_names.pl
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
svgnames.wkExtraSources = $${WC_GENERATED_SOURCES_DIR}/SVGElementFactory.cpp $${WC_GENERATED_SOURCES_DIR}/JSSVGElementWrapperFactory.cpp
addExtraCompiler(svgnames)
# GENERATOR 5-D:
xlinknames.output = $${WC_GENERATED_SOURCES_DIR}/XLinkNames.cpp
......
......@@ -337,8 +337,6 @@ sub printConstructors
my ($F, $tagConstructorMapRef) = @_;
my %tagConstructorMap = %$tagConstructorMapRef;
print F "#if $parameters{guardFactoryWith}\n" if $parameters{guardFactoryWith};
# This is to avoid generating the same constructor several times.
my %uniqueTags = ();
for my $tagName (sort keys %tagConstructorMap) {
......@@ -372,8 +370,6 @@ sub printConstructors
printConstructorInterior($F, $mappedName, $enabledTags{$mappedName}{interfaceName}, "QualifiedName(tagName.prefix(), ${mappedName}Tag.localName(), tagName.namespaceURI())");
}
}
print F "#endif\n" if $parameters{guardFactoryWith};
}
sub printFunctionInits
......@@ -652,11 +648,12 @@ printLicenseHeader($F);
print F <<END
#include "config.h"
#include "$parameters{namespace}ElementFactory.h"
#include "$parameters{namespace}Names.h"
END
;
print F "\n#if $parameters{guardFactoryWith}\n\n" if $parameters{guardFactoryWith};
printElementIncludes($F);
print F <<END
......@@ -689,8 +686,6 @@ my %tagConstructorMap = buildConstructorMap();
printConstructors($F, \%tagConstructorMap);
print F "#if $parameters{guardFactoryWith}\n" if $parameters{guardFactoryWith};
print F <<END
static void addTag(const QualifiedName& tag, ConstructorFunction func)
{
......@@ -711,14 +706,11 @@ END
printFunctionInits($F, \%tagConstructorMap);
print F "}\n";
print F "#endif\n" if $parameters{guardFactoryWith};
print F "\nPassRefPtr<$parameters{namespace}Element> $parameters{namespace}ElementFactory::create$parameters{namespace}Element(const QualifiedName& qName, Document* document";
print F ", HTMLFormElement* formElement" if $parameters{namespace} eq "HTML";
print F ", bool createdByParser)\n{\n";
print F "#if $parameters{guardFactoryWith}\n" if $parameters{guardFactoryWith};
print F <<END
if (!document)
return 0;
......@@ -753,17 +745,6 @@ if ($parameters{namespace} eq "HTML") {
print F " return $parameters{namespace}Element::create(qName, document);\n";
if ($parameters{guardFactoryWith}) {
print F <<END
#else
return 0;
#endif
END
;
}
print F <<END
}
......@@ -772,6 +753,8 @@ print F <<END
END
;
print F "#endif\n" if $parameters{guardFactoryWith};
close F;
}
......@@ -814,7 +797,7 @@ END
;
print F " static PassRefPtr<$parameters{namespace}Element> create$parameters{namespace}Element(const WebCore::QualifiedName&, WebCore::Document*";
print F ", HTMLFormElement* = 0" if $parameters{namespace} eq "HTML";
print F ", bool /*createdByParser*/ = true);\n";
print F ", bool createdByParser = true);\n";
printf F<<END
};
......@@ -923,12 +906,11 @@ sub printWrapperFactoryCppFile
printLicenseHeader($F);
print F "#include \"config.h\"\n\n";
print F "#if $parameters{guardFactoryWith}\n\n" if $parameters{guardFactoryWith};
print F "#include \"config.h\"\n";
print F "#include \"$wrapperFactoryType$parameters{namespace}ElementWrapperFactory.h\"\n";
print F "\n#if $parameters{guardFactoryWith}\n\n" if $parameters{guardFactoryWith};
printJSElementIncludes($F, $wrapperFactoryType);
print F "\n#include \"$parameters{namespace}Names.h\"\n\n";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment