Automatically generate template specializations for most Elements
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Sep 2014 02:13:41 +0000 (02:13 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Sep 2014 02:13:41 +0000 (02:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=137174

Reviewed by Darin Adler.

Previously, the template specializations to make is<>() / downcast<>()
work for HTML/SVG/MathML elements were only generated if
"generateTypeHelpers" parameter was 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 this patch drops the "generateTypeHelpers" parameter and
generates those template specializations by default.

One case we cannot generate the specialization ifor is when a class is
associated to several tag names but this patch updates the
make_names.pl script to detect this and skip those classes.

No new tests, no behavior change.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/make_names.pl:
(defaultTagPropertyHash):
(printTypeHelpers):
* html/HTMLTagNames.in:
* mathml/mathtags.in:
* svg/SVGAllInOne.cpp:
* svg/SVGAnimateColorElement.cpp:
(WebCore::SVGAnimateColorElement::SVGAnimateColorElement):
(WebCore::SVGAnimateColorElement::determinePropertyValueTypes):
* svg/SVGAnimateColorElement.h:
* svg/SVGAnimateElement.cpp:
(WebCore::SVGAnimateElement::SVGAnimateElement):
(WebCore::SVGAnimateElement::~SVGAnimateElement): Deleted.
(WebCore::SVGAnimateElement::hasValidAttributeType): Deleted.
(WebCore::SVGAnimateElement::determineAnimatedPropertyType): Deleted.
(WebCore::SVGAnimateElement::calculateAnimatedValue): Deleted.
(WebCore::SVGAnimateElement::calculateToAtEndOfDurationValue): Deleted.
(WebCore::SVGAnimateElement::calculateFromAndToValues): Deleted.
(WebCore::SVGAnimateElement::calculateFromAndByValues): Deleted.
(WebCore::propertyTypesAreConsistent): Deleted.
(WebCore::SVGAnimateElement::resetAnimatedType): Deleted.
(WebCore::applyCSSPropertyToTarget): Deleted.
(WebCore::removeCSSPropertyFromTarget): Deleted.
(WebCore::applyCSSPropertyToTargetAndInstances): Deleted.
(WebCore::removeCSSPropertyFromTargetAndInstances): Deleted.
(WebCore::notifyTargetAboutAnimValChange): Deleted.
(WebCore::notifyTargetAndInstancesAboutAnimValChange): Deleted.
(WebCore::SVGAnimateElement::clearAnimatedType): Deleted.
(WebCore::SVGAnimateElement::applyResultsToTarget): Deleted.
(WebCore::SVGAnimateElement::animatedPropertyTypeSupportsAddition): Deleted.
(WebCore::SVGAnimateElement::isAdditive): Deleted.
(WebCore::SVGAnimateElement::calculateDistance): Deleted.
(WebCore::SVGAnimateElement::setTargetElement): Deleted.
(WebCore::SVGAnimateElement::setAttributeName): Deleted.
(WebCore::SVGAnimateElement::resetAnimatedPropertyType): Deleted.
(WebCore::SVGAnimateElement::ensureAnimator): Deleted.
* svg/SVGAnimateElement.h:
(WebCore::isSVGAnimateElement): Deleted.
* svg/SVGAnimateElementBase.cpp: Copied from Source/WebCore/svg/SVGAnimateElement.cpp.
(WebCore::SVGAnimateElementBase::SVGAnimateElementBase):
(WebCore::SVGAnimateElementBase::~SVGAnimateElementBase):
(WebCore::SVGAnimateElementBase::hasValidAttributeType):
(WebCore::SVGAnimateElementBase::determineAnimatedPropertyType):
(WebCore::SVGAnimateElementBase::calculateAnimatedValue):
(WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue):
(WebCore::SVGAnimateElementBase::calculateFromAndToValues):
(WebCore::SVGAnimateElementBase::calculateFromAndByValues):
(WebCore::propertyTypesAreConsistent):
(WebCore::SVGAnimateElementBase::resetAnimatedType):
(WebCore::applyCSSPropertyToTarget):
(WebCore::removeCSSPropertyFromTarget):
(WebCore::applyCSSPropertyToTargetAndInstances):
(WebCore::removeCSSPropertyFromTargetAndInstances):
(WebCore::notifyTargetAboutAnimValChange):
(WebCore::notifyTargetAndInstancesAboutAnimValChange):
(WebCore::SVGAnimateElementBase::clearAnimatedType):
(WebCore::SVGAnimateElementBase::applyResultsToTarget):
(WebCore::SVGAnimateElementBase::animatedPropertyTypeSupportsAddition):
(WebCore::SVGAnimateElementBase::isAdditive):
(WebCore::SVGAnimateElementBase::calculateDistance):
(WebCore::SVGAnimateElementBase::setTargetElement):
(WebCore::SVGAnimateElementBase::setAttributeName):
(WebCore::SVGAnimateElementBase::resetAnimatedPropertyType):
(WebCore::SVGAnimateElementBase::ensureAnimator):
* svg/SVGAnimateElementBase.h: Copied from Source/WebCore/svg/SVGAnimateElement.h.
(WebCore::isSVGAnimateElementBase):
* svg/SVGAnimateTransformElement.cpp:
(WebCore::SVGAnimateTransformElement::SVGAnimateTransformElement):
(WebCore::SVGAnimateTransformElement::parseAttribute):
* svg/SVGAnimateTransformElement.h:
* svg/SVGAnimatedAngle.cpp:
* svg/SVGAnimatedBoolean.cpp:
* svg/SVGAnimatedColor.cpp:
* svg/SVGAnimatedInteger.cpp:
* svg/SVGAnimatedIntegerOptionalInteger.cpp:
* svg/SVGAnimatedLength.cpp:
* svg/SVGAnimatedLengthList.cpp:
* svg/SVGAnimatedNumber.cpp:
* svg/SVGAnimatedNumberList.cpp:
* svg/SVGAnimatedNumberOptionalNumber.cpp:
* svg/SVGAnimatedPath.cpp:
* svg/SVGAnimatedPointList.cpp:
* svg/SVGAnimatedPreserveAspectRatio.cpp:
* svg/SVGAnimatedRect.cpp:
* svg/SVGAnimatedString.cpp:
* svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::currentValuesForValuesAnimation):
* svg/SVGSetElement.cpp:
(WebCore::SVGSetElement::SVGSetElement):
* svg/SVGSetElement.h:
* svg/svgtags.in:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174050 268f45cc-cd09-0410-ab3c-d52691b4dbfc

34 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/dom/make_names.pl
Source/WebCore/html/HTMLTagNames.in
Source/WebCore/mathml/mathtags.in
Source/WebCore/svg/SVGAllInOne.cpp
Source/WebCore/svg/SVGAnimateColorElement.cpp
Source/WebCore/svg/SVGAnimateColorElement.h
Source/WebCore/svg/SVGAnimateElement.cpp
Source/WebCore/svg/SVGAnimateElement.h
Source/WebCore/svg/SVGAnimateElementBase.cpp [new file with mode: 0644]
Source/WebCore/svg/SVGAnimateElementBase.h [new file with mode: 0644]
Source/WebCore/svg/SVGAnimateTransformElement.cpp
Source/WebCore/svg/SVGAnimateTransformElement.h
Source/WebCore/svg/SVGAnimatedAngle.cpp
Source/WebCore/svg/SVGAnimatedBoolean.cpp
Source/WebCore/svg/SVGAnimatedColor.cpp
Source/WebCore/svg/SVGAnimatedInteger.cpp
Source/WebCore/svg/SVGAnimatedIntegerOptionalInteger.cpp
Source/WebCore/svg/SVGAnimatedLength.cpp
Source/WebCore/svg/SVGAnimatedLengthList.cpp
Source/WebCore/svg/SVGAnimatedNumber.cpp
Source/WebCore/svg/SVGAnimatedNumberList.cpp
Source/WebCore/svg/SVGAnimatedNumberOptionalNumber.cpp
Source/WebCore/svg/SVGAnimatedPath.cpp
Source/WebCore/svg/SVGAnimatedPointList.cpp
Source/WebCore/svg/SVGAnimatedPreserveAspectRatio.cpp
Source/WebCore/svg/SVGAnimatedRect.cpp
Source/WebCore/svg/SVGAnimatedString.cpp
Source/WebCore/svg/SVGAnimationElement.cpp
Source/WebCore/svg/SVGSetElement.cpp
Source/WebCore/svg/SVGSetElement.h
Source/WebCore/svg/svgtags.in

index 8db7d7d..6dadc30 100644 (file)
@@ -2521,6 +2521,7 @@ set(WebCore_SOURCES
     svg/SVGAltGlyphItemElement.cpp
     svg/SVGAngle.cpp
     svg/SVGAnimateColorElement.cpp
+    svg/SVGAnimateElementBase.cpp
     svg/SVGAnimateElement.cpp
     svg/SVGAnimateMotionElement.cpp
     svg/SVGAnimateTransformElement.cpp
index d2acbc8..54e128b 100644 (file)
@@ -1,3 +1,119 @@
+2014-09-28  Christophe Dumez  <cdumez@apple.com>
+
+        Automatically generate template specializations for most Elements
+        https://bugs.webkit.org/show_bug.cgi?id=137174
+
+        Reviewed by Darin Adler.
+
+        Previously, the template specializations to make is<>() / downcast<>()
+        work for HTML/SVG/MathML elements were only generated if
+        "generateTypeHelpers" parameter was 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 this patch drops the "generateTypeHelpers" parameter and
+        generates those template specializations by default.
+
+        One case we cannot generate the specialization ifor is when a class is
+        associated to several tag names but this patch updates the
+        make_names.pl script to detect this and skip those classes.
+
+        No new tests, no behavior change.
+
+        * CMakeLists.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * dom/make_names.pl:
+        (defaultTagPropertyHash):
+        (printTypeHelpers):
+        * html/HTMLTagNames.in:
+        * mathml/mathtags.in:
+        * svg/SVGAllInOne.cpp:
+        * svg/SVGAnimateColorElement.cpp:
+        (WebCore::SVGAnimateColorElement::SVGAnimateColorElement):
+        (WebCore::SVGAnimateColorElement::determinePropertyValueTypes):
+        * svg/SVGAnimateColorElement.h:
+        * svg/SVGAnimateElement.cpp:
+        (WebCore::SVGAnimateElement::SVGAnimateElement):
+        (WebCore::SVGAnimateElement::~SVGAnimateElement): Deleted.
+        (WebCore::SVGAnimateElement::hasValidAttributeType): Deleted.
+        (WebCore::SVGAnimateElement::determineAnimatedPropertyType): Deleted.
+        (WebCore::SVGAnimateElement::calculateAnimatedValue): Deleted.
+        (WebCore::SVGAnimateElement::calculateToAtEndOfDurationValue): Deleted.
+        (WebCore::SVGAnimateElement::calculateFromAndToValues): Deleted.
+        (WebCore::SVGAnimateElement::calculateFromAndByValues): Deleted.
+        (WebCore::propertyTypesAreConsistent): Deleted.
+        (WebCore::SVGAnimateElement::resetAnimatedType): Deleted.
+        (WebCore::applyCSSPropertyToTarget): Deleted.
+        (WebCore::removeCSSPropertyFromTarget): Deleted.
+        (WebCore::applyCSSPropertyToTargetAndInstances): Deleted.
+        (WebCore::removeCSSPropertyFromTargetAndInstances): Deleted.
+        (WebCore::notifyTargetAboutAnimValChange): Deleted.
+        (WebCore::notifyTargetAndInstancesAboutAnimValChange): Deleted.
+        (WebCore::SVGAnimateElement::clearAnimatedType): Deleted.
+        (WebCore::SVGAnimateElement::applyResultsToTarget): Deleted.
+        (WebCore::SVGAnimateElement::animatedPropertyTypeSupportsAddition): Deleted.
+        (WebCore::SVGAnimateElement::isAdditive): Deleted.
+        (WebCore::SVGAnimateElement::calculateDistance): Deleted.
+        (WebCore::SVGAnimateElement::setTargetElement): Deleted.
+        (WebCore::SVGAnimateElement::setAttributeName): Deleted.
+        (WebCore::SVGAnimateElement::resetAnimatedPropertyType): Deleted.
+        (WebCore::SVGAnimateElement::ensureAnimator): Deleted.
+        * svg/SVGAnimateElement.h:
+        (WebCore::isSVGAnimateElement): Deleted.
+        * svg/SVGAnimateElementBase.cpp: Copied from Source/WebCore/svg/SVGAnimateElement.cpp.
+        (WebCore::SVGAnimateElementBase::SVGAnimateElementBase):
+        (WebCore::SVGAnimateElementBase::~SVGAnimateElementBase):
+        (WebCore::SVGAnimateElementBase::hasValidAttributeType):
+        (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType):
+        (WebCore::SVGAnimateElementBase::calculateAnimatedValue):
+        (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue):
+        (WebCore::SVGAnimateElementBase::calculateFromAndToValues):
+        (WebCore::SVGAnimateElementBase::calculateFromAndByValues):
+        (WebCore::propertyTypesAreConsistent):
+        (WebCore::SVGAnimateElementBase::resetAnimatedType):
+        (WebCore::applyCSSPropertyToTarget):
+        (WebCore::removeCSSPropertyFromTarget):
+        (WebCore::applyCSSPropertyToTargetAndInstances):
+        (WebCore::removeCSSPropertyFromTargetAndInstances):
+        (WebCore::notifyTargetAboutAnimValChange):
+        (WebCore::notifyTargetAndInstancesAboutAnimValChange):
+        (WebCore::SVGAnimateElementBase::clearAnimatedType):
+        (WebCore::SVGAnimateElementBase::applyResultsToTarget):
+        (WebCore::SVGAnimateElementBase::animatedPropertyTypeSupportsAddition):
+        (WebCore::SVGAnimateElementBase::isAdditive):
+        (WebCore::SVGAnimateElementBase::calculateDistance):
+        (WebCore::SVGAnimateElementBase::setTargetElement):
+        (WebCore::SVGAnimateElementBase::setAttributeName):
+        (WebCore::SVGAnimateElementBase::resetAnimatedPropertyType):
+        (WebCore::SVGAnimateElementBase::ensureAnimator):
+        * svg/SVGAnimateElementBase.h: Copied from Source/WebCore/svg/SVGAnimateElement.h.
+        (WebCore::isSVGAnimateElementBase):
+        * svg/SVGAnimateTransformElement.cpp:
+        (WebCore::SVGAnimateTransformElement::SVGAnimateTransformElement):
+        (WebCore::SVGAnimateTransformElement::parseAttribute):
+        * svg/SVGAnimateTransformElement.h:
+        * svg/SVGAnimatedAngle.cpp:
+        * svg/SVGAnimatedBoolean.cpp:
+        * svg/SVGAnimatedColor.cpp:
+        * svg/SVGAnimatedInteger.cpp:
+        * svg/SVGAnimatedIntegerOptionalInteger.cpp:
+        * svg/SVGAnimatedLength.cpp:
+        * svg/SVGAnimatedLengthList.cpp:
+        * svg/SVGAnimatedNumber.cpp:
+        * svg/SVGAnimatedNumberList.cpp:
+        * svg/SVGAnimatedNumberOptionalNumber.cpp:
+        * svg/SVGAnimatedPath.cpp:
+        * svg/SVGAnimatedPointList.cpp:
+        * svg/SVGAnimatedPreserveAspectRatio.cpp:
+        * svg/SVGAnimatedRect.cpp:
+        * svg/SVGAnimatedString.cpp:
+        * svg/SVGAnimationElement.cpp:
+        (WebCore::SVGAnimationElement::currentValuesForValuesAnimation):
+        * svg/SVGSetElement.cpp:
+        (WebCore::SVGSetElement::SVGSetElement):
+        * svg/SVGSetElement.h:
+        * svg/svgtags.in:
+
 2014-09-28  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
 
         Use std::unique_ptr for ContextMenuController
index a69e96c..1194c14 100644 (file)
                82AB1776125C826700C5069D /* InspectorResourceAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 82AB1772125C826700C5069D /* InspectorResourceAgent.h */; };
                82E3D8DE122EA0D1003AE5BC /* CSSPropertySourceData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 82E3D8DC122EA0D1003AE5BC /* CSSPropertySourceData.cpp */; };
                82E3D8DF122EA0D1003AE5BC /* CSSPropertySourceData.h in Headers */ = {isa = PBXBuildFile; fileRef = 82E3D8DD122EA0D1003AE5BC /* CSSPropertySourceData.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               832B843419D8E55100B26055 /* SVGAnimateElementBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 832B843319D8E55100B26055 /* SVGAnimateElementBase.h */; };
+               832B843619D8E57400B26055 /* SVGAnimateElementBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 832B843519D8E57400B26055 /* SVGAnimateElementBase.cpp */; };
                836FBCEA178C113200B21A15 /* SVGAnimatedTypeAnimator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 836FBCE9178C113200B21A15 /* SVGAnimatedTypeAnimator.cpp */; };
                836FBCEC178C117F00B21A15 /* SVGAnimatedProperty.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 836FBCEB178C117F00B21A15 /* SVGAnimatedProperty.cpp */; };
                83C1D425178D5AB400141E68 /* SVGPathSegArcAbs.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C1D413178D5AB400141E68 /* SVGPathSegArcAbs.h */; };
                82AB1772125C826700C5069D /* InspectorResourceAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorResourceAgent.h; sourceTree = "<group>"; };
                82E3D8DC122EA0D1003AE5BC /* CSSPropertySourceData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSPropertySourceData.cpp; sourceTree = "<group>"; };
                82E3D8DD122EA0D1003AE5BC /* CSSPropertySourceData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSPropertySourceData.h; sourceTree = "<group>"; };
+               832B843319D8E55100B26055 /* SVGAnimateElementBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimateElementBase.h; sourceTree = "<group>"; };
+               832B843519D8E57400B26055 /* SVGAnimateElementBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimateElementBase.cpp; sourceTree = "<group>"; };
                836FBCE9178C113200B21A15 /* SVGAnimatedTypeAnimator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedTypeAnimator.cpp; sourceTree = "<group>"; };
                836FBCEB178C117F00B21A15 /* SVGAnimatedProperty.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedProperty.cpp; sourceTree = "<group>"; };
                83C1D413178D5AB400141E68 /* SVGPathSegArcAbs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegArcAbs.h; sourceTree = "<group>"; };
                                439D334013A6911C00C20F4F /* SVGAnimatedType.h */,
                                836FBCE9178C113200B21A15 /* SVGAnimatedTypeAnimator.cpp */,
                                439D334113A6911C00C20F4F /* SVGAnimatedTypeAnimator.h */,
+                               832B843519D8E57400B26055 /* SVGAnimateElementBase.cpp */,
+                               832B843319D8E55100B26055 /* SVGAnimateElementBase.h */,
                                B22277F90D00BF1F0071B782 /* SVGAnimateElement.cpp */,
                                B22277FA0D00BF1F0071B782 /* SVGAnimateElement.h */,
                                B22277FB0D00BF1F0071B782 /* SVGAnimateElement.idl */,
                                93D3C1590F97A9D70053C013 /* DOMHTMLCanvasElement.h in Headers */,
                                93F9B6580BA0F35E00854064 /* DOMHTMLCanvasElementInternal.h in Headers */,
                                85DF2F8E0AA3C88100AD64C5 /* DOMHTMLCollection.h in Headers */,
+                               832B843419D8E55100B26055 /* SVGAnimateElementBase.h in Headers */,
                                85E711A20AC5D5350053270F /* DOMHTMLCollectionInternal.h in Headers */,
                                F5C041E30FFCA96D00839D4A /* DOMHTMLDataListElement.h in Headers */,
                                F5C041E50FFCA96D00839D4A /* DOMHTMLDataListElementInternal.h in Headers */,
                                59A8F1D411A69508001AC34A /* DeviceOrientationController.cpp in Sources */,
                                59D1C10411EB5DCF00B638C8 /* DeviceOrientationData.cpp in Sources */,
                                59A85EA2119D68D900DEF1EF /* DeviceOrientationEvent.cpp in Sources */,
+                               832B843619D8E57400B26055 /* SVGAnimateElementBase.cpp in Sources */,
                                CD37B39815C1B971006DC898 /* DiagnosticLoggingKeys.cpp in Sources */,
                                CECADFC6153778FF00E37068 /* DictationAlternative.cpp in Sources */,
                                CECADFC8153778FF00E37068 /* DictationCommand.cpp in Sources */,
index d082601..92a9796 100755 (executable)
@@ -194,7 +194,6 @@ sub defaultTagPropertyHash
         'wrapperOnlyIfMediaIsAvailable' => 0,
         'conditional' => 0,
         'runtimeConditional' => 0,
-        'generateTypeHelpers' => 0
     );
 }
 
@@ -627,12 +626,18 @@ sub printTypeHelpers
     my ($F, $namesRef) = @_;
     my %names = %$namesRef;
 
-    for my $name (sort keys %names) {
-        if (!$parsedTags{$name}{generateTypeHelpers}) {
-            next;
-        }
-
+    # Do a first pass to discard classes that map to several tags.
+    my %classToTags = ();
+    for my $name (keys %names) {
         my $class = $parsedTags{$name}{interfaceName};
+        push(@{$classToTags{$class}}, $name) if defined $class;
+    }
+
+    for my $class (sort keys %classToTags) {
+        # Skip classes that map to more than 1 tag.
+        my $tagCount = scalar @{$classToTags{$class}};
+        next if $tagCount > 1;
+        my $name = $classToTags{$class}[0];
         print F <<END
 class $class;
 template <typename ArgType>
index 0fc8b04..9bb51b8 100644 (file)
@@ -3,28 +3,28 @@ namespacePrefix="xhtml"
 namespaceURI="http://www.w3.org/1999/xhtml"
 fallbackInterfaceName="HTMLUnknownElement"
 
-a interfaceName=HTMLAnchorElement, generateTypeHelpers
+a interfaceName=HTMLAnchorElement
 abbr interfaceName=HTMLElement
 acronym interfaceName=HTMLElement
 address interfaceName=HTMLElement
-applet constructorNeedsCreatedByParser, generateTypeHelpers
-area generateTypeHelpers
+applet constructorNeedsCreatedByParser
+area
 article interfaceName=HTMLElement
 aside interfaceName=HTMLElement
-audio wrapperOnlyIfMediaIsAvailable, conditional=VIDEO, constructorNeedsCreatedByParser, generateTypeHelpers
+audio wrapperOnlyIfMediaIsAvailable, conditional=VIDEO, constructorNeedsCreatedByParser
 b interfaceName=HTMLElement
-base generateTypeHelpers
+base
 basefont interfaceName=HTMLBaseFontElement
-bdi interfaceName=HTMLBDIElement, JSInterfaceName=HTMLElement, generateTypeHelpers
+bdi interfaceName=HTMLBDIElement, JSInterfaceName=HTMLElement
 bdo interfaceName=HTMLElement
 bgsound interfaceName=HTMLElement
 big interfaceName=HTMLElement
 blockquote interfaceName=HTMLQuoteElement
-body generateTypeHelpers
-br interfaceName=HTMLBRElement, generateTypeHelpers
-button constructorNeedsFormElement, generateTypeHelpers
-canvas generateTypeHelpers
-caption interfaceName=HTMLTableCaptionElement, generateTypeHelpers
+body
+br interfaceName=HTMLBRElement
+button constructorNeedsFormElement
+canvas
+caption interfaceName=HTMLTableCaptionElement
 center interfaceName=HTMLElement
 cite interfaceName=HTMLElement
 code interfaceName=HTMLElement
@@ -32,73 +32,73 @@ col interfaceName=HTMLTableColElement
 colgroup interfaceName=HTMLTableColElement
 command interfaceName=HTMLElement
 webkitShadowContent interfaceName=HTMLElement, noConstructor
-datalist interfaceName=HTMLDataListElement, conditional=DATALIST_ELEMENT, generateTypeHelpers
+datalist interfaceName=HTMLDataListElement, conditional=DATALIST_ELEMENT
 dd interfaceName=HTMLElement
 del interfaceName=HTMLModElement
-details conditional=DETAILS_ELEMENT, generateTypeHelpers 
+details conditional=DETAILS_ELEMENT
 dfn interfaceName=HTMLElement
 dir interfaceName=HTMLDirectoryElement
-div generateTypeHelpers
+div
 dl interfaceName=HTMLDListElement
 dt interfaceName=HTMLElement
 em interfaceName=HTMLElement
-embed constructorNeedsCreatedByParser, generateTypeHelpers
-fieldset interfaceName=HTMLFieldSetElement, constructorNeedsFormElement, generateTypeHelpers
+embed constructorNeedsCreatedByParser
+fieldset interfaceName=HTMLFieldSetElement, constructorNeedsFormElement
 figcaption interfaceName=HTMLElement
 figure interfaceName=HTMLElement
-font generateTypeHelpers
+font
 footer interfaceName=HTMLElement
-form generateTypeHelpers
-frame generateTypeHelpers
-frameset interfaceName=HTMLFrameSetElement, generateTypeHelpers
+form
+frame
+frameset interfaceName=HTMLFrameSetElement
 h1 interfaceName=HTMLHeadingElement
 h2 interfaceName=HTMLHeadingElement
 h3 interfaceName=HTMLHeadingElement
 h4 interfaceName=HTMLHeadingElement
 h5 interfaceName=HTMLHeadingElement
 h6 interfaceName=HTMLHeadingElement
-head generateTypeHelpers
+head
 header interfaceName=HTMLElement
 hgroup interfaceName=HTMLElement
-hr interfaceName=HTMLHRElement, generateTypeHelpers
-html generateTypeHelpers
+hr interfaceName=HTMLHRElement
+html
 i interfaceName=HTMLElement
-iframe interfaceName=HTMLIFrameElement, generateTypeHelpers
+iframe interfaceName=HTMLIFrameElement
 image interfaceName=HTMLUnknownElement
-img interfaceName=HTMLImageElement, constructorNeedsFormElement, generateTypeHelpers
-input constructorNeedsFormElement, constructorNeedsCreatedByParser, generateTypeHelpers
+img interfaceName=HTMLImageElement, constructorNeedsFormElement
+input constructorNeedsFormElement, constructorNeedsCreatedByParser
 ins interfaceName=HTMLModElement
 isindex interfaceName=HTMLUnknownElement
 kbd interfaceName=HTMLElement
 keygen constructorNeedsFormElement
-label generateTypeHelpers
+label
 layer interfaceName=HTMLElement
-legend generateTypeHelpers
+legend
 li interfaceName=HTMLLIElement
-link constructorNeedsCreatedByParser, generateTypeHelpers
+link constructorNeedsCreatedByParser
 listing interfaceName=HTMLPreElement
 main interfaceName=HTMLElement
-map generateTypeHelpers
+map
 mark interfaceName=HTMLElement
-marquee generateTypeHelpers
+marquee
 menu
-meta generateTypeHelpers
-meter interfaceName=HTMLMeterElement, conditional=METER_ELEMENT, generateTypeHelpers
+meta
+meter interfaceName=HTMLMeterElement, conditional=METER_ELEMENT
 nav interfaceName=HTMLElement
 nobr interfaceName=HTMLElement
 noembed interfaceName=HTMLElement
 noframes interfaceName=HTMLElement
 nolayer interfaceName=HTMLElement
-object constructorNeedsFormElement, constructorNeedsCreatedByParser, generateTypeHelpers
-ol interfaceName=HTMLOListElement, generateTypeHelpers
-optgroup interfaceName=HTMLOptGroupElement, generateTypeHelpers
-option generateTypeHelpers
+object constructorNeedsFormElement, constructorNeedsCreatedByParser
+ol interfaceName=HTMLOListElement
+optgroup interfaceName=HTMLOptGroupElement
+option
 output constructorNeedsFormElement
-p interfaceName=HTMLParagraphElement, generateTypeHelpers
-param generateTypeHelpers
+p interfaceName=HTMLParagraphElement
+param
 plaintext interfaceName=HTMLElement
 pre
-progress interfaceName=HTMLProgressElement, generateTypeHelpers
+progress interfaceName=HTMLProgressElement
 q interfaceName=HTMLQuoteElement
 rb interfaceName=HTMLElement
 rp interfaceName=HTMLElement
@@ -107,34 +107,34 @@ rtc interfaceName=HTMLElement
 ruby interfaceName=HTMLElement
 s interfaceName=HTMLElement
 samp interfaceName=HTMLElement
-script constructorNeedsCreatedByParser, generateTypeHelpers
+script constructorNeedsCreatedByParser
 section interfaceName=HTMLElement
-select constructorNeedsFormElement, generateTypeHelpers
+select constructorNeedsFormElement
 small interfaceName=HTMLElement
-source wrapperOnlyIfMediaIsAvailable, conditional=VIDEO, generateTypeHelpers
-span generateTypeHelpers
+source wrapperOnlyIfMediaIsAvailable, conditional=VIDEO
+span
 strike interfaceName=HTMLElement
 strong interfaceName=HTMLElement
-style constructorNeedsCreatedByParser, generateTypeHelpers
+style constructorNeedsCreatedByParser
 sub interfaceName=HTMLElement
-summary interfaceName=HTMLSummaryElement, JSInterfaceName=HTMLElement, conditional=DETAILS_ELEMENT, generateTypeHelpers
+summary interfaceName=HTMLSummaryElement, JSInterfaceName=HTMLElement, conditional=DETAILS_ELEMENT
 sup interfaceName=HTMLElement
-table generateTypeHelpers
+table
 tbody interfaceName=HTMLTableSectionElement
 td interfaceName=HTMLTableCellElement
-template conditional=TEMPLATE_ELEMENT, generateTypeHelpers
-textarea interfaceName=HTMLTextAreaElement, constructorNeedsFormElement, generateTypeHelpers
+template conditional=TEMPLATE_ELEMENT
+textarea interfaceName=HTMLTextAreaElement, constructorNeedsFormElement
 tfoot interfaceName=HTMLTableSectionElement
 th interfaceName=HTMLTableCellElement
 thead interfaceName=HTMLTableSectionElement
-title generateTypeHelpers
-tr interfaceName=HTMLTableRowElement, generateTypeHelpers
-track wrapperOnlyIfMediaIsAvailable, conditional=VIDEO_TRACK, generateTypeHelpers
+title
+tr interfaceName=HTMLTableRowElement
+track wrapperOnlyIfMediaIsAvailable, conditional=VIDEO_TRACK
 tt interfaceName=HTMLElement
 u interfaceName=HTMLElement
-ul interfaceName=HTMLUListElement, generateTypeHelpers
+ul interfaceName=HTMLUListElement
 var interfaceName=HTMLElement
-video wrapperOnlyIfMediaIsAvailable, conditional=VIDEO, constructorNeedsCreatedByParser, generateTypeHelpers
+video wrapperOnlyIfMediaIsAvailable, conditional=VIDEO, constructorNeedsCreatedByParser
 wbr interfaceName=HTMLElement
 xmp interfaceName=HTMLPreElement
 noscript interfaceName=HTMLElement
index 9ef714e..7cce6d7 100644 (file)
@@ -6,7 +6,7 @@ fallbackInterfaceName="MathMLElement"
 annotation interfaceName=MathMLTextElement
 annotation-xml interfaceName=MathMLInlineContainerElement
 maction interfaceName=MathMLSelectElement
-math generateTypeHelpers
+math
 mfrac interfaceName=MathMLInlineContainerElement
 mfenced interfaceName=MathMLInlineContainerElement
 msubsup interfaceName=MathMLInlineContainerElement
@@ -31,7 +31,7 @@ mtr interfaceName=MathMLElement
 mtd interfaceName=MathMLElement
 mmultiscripts interfaceName=MathMLInlineContainerElement
 mprescripts interfaceName=MathMLInlineContainerElement
-menclose interfaceName=MathMLMencloseElement, generateTypeHelpers
+menclose interfaceName=MathMLMencloseElement
 none interfaceName=MathMLInlineContainerElement
 semantics interfaceName=MathMLSelectElement
 
index 7b8185d..6aa71fd 100644 (file)
@@ -33,6 +33,7 @@
 #include "SVGAngle.cpp"
 #include "SVGAnimateColorElement.cpp"
 #include "SVGAnimateElement.cpp"
+#include "SVGAnimateElementBase.cpp"
 #include "SVGAnimateMotionElement.cpp"
 #include "SVGAnimateTransformElement.cpp"
 #include "SVGAnimatedAngle.cpp"
index 9e1db13..8d05b33 100644 (file)
@@ -27,7 +27,7 @@
 namespace WebCore {
     
 inline SVGAnimateColorElement::SVGAnimateColorElement(const QualifiedName& tagName, Document& document)
-    : SVGAnimateElement(tagName, document)
+    : SVGAnimateElementBase(tagName, document)
 {
     ASSERT(hasTagName(SVGNames::animateColorTag));
 }
@@ -45,7 +45,7 @@ static bool attributeValueIsCurrentColor(const String& value)
 
 void SVGAnimateColorElement::determinePropertyValueTypes(const String& from, const String& to)
 {
-    SVGAnimateElement::determinePropertyValueTypes(from, to);
+    SVGAnimateElementBase::determinePropertyValueTypes(from, to);
     if (attributeValueIsCurrentColor(from))
         m_fromPropertyValueType = CurrentColorValue;
     if (attributeValueIsCurrentColor(to))
index d14138c..afe17d2 100644 (file)
 #ifndef SVGAnimateColorElement_h
 #define SVGAnimateColorElement_h
 
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
 
 namespace WebCore {
 
-class SVGAnimateColorElement final : public SVGAnimateElement {
+class SVGAnimateColorElement final : public SVGAnimateElementBase {
 public:
     static PassRefPtr<SVGAnimateColorElement> create(const QualifiedName&, Document&);
 
index 6354968..6f01e3a 100644 (file)
@@ -1,45 +1,37 @@
 /*
- * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
- * Copyright (C) 2008 Apple Inc. All rights reserved.
- * Copyright (C) Research In Motion Limited 2011. All rights reserved.
- * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
  *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #include "config.h"
 #include "SVGAnimateElement.h"
 
-#include "CSSParser.h"
-#include "CSSPropertyNames.h"
-#include "QualifiedName.h"
-#include "RenderObject.h"
-#include "SVGAnimatorFactory.h"
-#include "SVGElement.h"
-#include "SVGNames.h"
-#include "StyleProperties.h"
-
 namespace WebCore {
 
 SVGAnimateElement::SVGAnimateElement(const QualifiedName& tagName, Document& document)
-    : SVGAnimationElement(tagName, document)
-    , m_animatedPropertyType(AnimatedString)
+    : SVGAnimateElementBase(tagName, document)
 {
-    ASSERT(hasTagName(SVGNames::animateTag) || hasTagName(SVGNames::setTag) || hasTagName(SVGNames::animateColorTag) || hasTagName(SVGNames::animateTransformTag));
+    ASSERT(hasTagName(SVGNames::animateTag));
 }
 
 PassRefPtr<SVGAnimateElement> SVGAnimateElement::create(const QualifiedName& tagName, Document& document)
@@ -47,416 +39,4 @@ PassRefPtr<SVGAnimateElement> SVGAnimateElement::create(const QualifiedName& tag
     return adoptRef(new SVGAnimateElement(tagName, document));
 }
 
-SVGAnimateElement::~SVGAnimateElement()
-{
-}
-
-bool SVGAnimateElement::hasValidAttributeType()
-{
-    SVGElement* targetElement = this->targetElement();
-    if (!targetElement)
-        return false;
-
-    return m_animatedPropertyType != AnimatedUnknown && !hasInvalidCSSAttributeType();
-}
-
-AnimatedPropertyType SVGAnimateElement::determineAnimatedPropertyType(SVGElement* targetElement) const
-{
-    ASSERT(targetElement);
-
-    Vector<AnimatedPropertyType> propertyTypes;
-    targetElement->animatedPropertyTypeForAttribute(attributeName(), propertyTypes);
-    if (propertyTypes.isEmpty())
-        return AnimatedUnknown;
-
-    ASSERT(propertyTypes.size() <= 2);
-    AnimatedPropertyType type = propertyTypes[0];
-    if (hasTagName(SVGNames::animateColorTag) && type != AnimatedColor)
-        return AnimatedUnknown;
-
-    // Animations of transform lists are not allowed for <animate> or <set>
-    // http://www.w3.org/TR/SVG/animate.html#AnimationAttributesAndProperties
-    if (type == AnimatedTransformList && !hasTagName(SVGNames::animateTransformTag))
-        return AnimatedUnknown;
-
-    // Fortunately there's just one special case needed here: SVGMarkerElements orientAttr, which
-    // corresponds to SVGAnimatedAngle orientAngle and SVGAnimatedEnumeration orientType. We have to
-    // figure out whose value to change here.
-    if (targetElement->hasTagName(SVGNames::markerTag) && type == AnimatedAngle) {
-        ASSERT(propertyTypes.size() == 2);
-        ASSERT(propertyTypes[0] == AnimatedAngle);
-        ASSERT(propertyTypes[1] == AnimatedEnumeration);
-    } else if (propertyTypes.size() == 2)
-        ASSERT(propertyTypes[0] == propertyTypes[1]);
-
-    return type;
-}
-
-void SVGAnimateElement::calculateAnimatedValue(float percentage, unsigned repeatCount, SVGSMILElement* resultElement)
-{
-    ASSERT(resultElement);
-    SVGElement* targetElement = this->targetElement();
-    if (!targetElement)
-        return;
-
-    ASSERT(m_animatedPropertyType == determineAnimatedPropertyType(targetElement));
-
-    ASSERT(percentage >= 0 && percentage <= 1);
-    ASSERT(m_animatedPropertyType != AnimatedTransformList || hasTagName(SVGNames::animateTransformTag));
-    ASSERT(m_animatedPropertyType != AnimatedUnknown);
-    ASSERT(m_animator);
-    ASSERT(m_animator->type() == m_animatedPropertyType);
-    ASSERT(m_fromType);
-    ASSERT(m_fromType->type() == m_animatedPropertyType);
-    ASSERT(m_toType);
-
-    SVGAnimateElement& resultAnimationElement = downcast<SVGAnimateElement>(*resultElement);
-    ASSERT(resultAnimationElement.m_animatedType);
-    ASSERT(resultAnimationElement.m_animatedPropertyType == m_animatedPropertyType);
-
-    if (hasTagName(SVGNames::setTag))
-        percentage = 1;
-
-    if (calcMode() == CalcModeDiscrete)
-        percentage = percentage < 0.5 ? 0 : 1;
-
-    // Target element might have changed.
-    m_animator->setContextElement(targetElement);
-
-    // Be sure to detach list wrappers before we modfiy their underlying value. If we'd do
-    // if after calculateAnimatedValue() ran the cached pointers in the list propery tear
-    // offs would point nowhere, and we couldn't create copies of those values anymore,
-    // while detaching. This is covered by assertions, moving this down would fire them.
-    if (!m_animatedProperties.isEmpty())
-        m_animator->animValWillChange(m_animatedProperties);
-
-    // Values-animation accumulates using the last values entry corresponding to the end of duration time.
-    SVGAnimatedType* toAtEndOfDurationType = m_toAtEndOfDurationType ? m_toAtEndOfDurationType.get() : m_toType.get();
-    m_animator->calculateAnimatedValue(percentage, repeatCount, m_fromType.get(), m_toType.get(), toAtEndOfDurationType, resultAnimationElement.m_animatedType.get());
-}
-
-bool SVGAnimateElement::calculateToAtEndOfDurationValue(const String& toAtEndOfDurationString)
-{
-    if (toAtEndOfDurationString.isEmpty())
-        return false;
-    m_toAtEndOfDurationType = ensureAnimator()->constructFromString(toAtEndOfDurationString);
-    return true;
-}
-
-bool SVGAnimateElement::calculateFromAndToValues(const String& fromString, const String& toString)
-{
-    SVGElement* targetElement = this->targetElement();
-    if (!targetElement)
-        return false;
-
-    determinePropertyValueTypes(fromString, toString);
-    ensureAnimator()->calculateFromAndToValues(m_fromType, m_toType, fromString, toString);
-    ASSERT(m_animatedPropertyType == m_animator->type());
-    return true;
-}
-
-bool SVGAnimateElement::calculateFromAndByValues(const String& fromString, const String& byString)
-{
-    SVGElement* targetElement = this->targetElement();
-    if (!targetElement)
-        return false;
-
-    if (animationMode() == ByAnimation && !isAdditive())
-        return false;
-
-    // from-by animation may only be used with attributes that support addition (e.g. most numeric attributes).
-    if (animationMode() == FromByAnimation && !animatedPropertyTypeSupportsAddition())
-        return false;
-
-    ASSERT(!hasTagName(SVGNames::setTag));
-
-    determinePropertyValueTypes(fromString, byString);
-    ensureAnimator()->calculateFromAndByValues(m_fromType, m_toType, fromString, byString);
-    ASSERT(m_animatedPropertyType == m_animator->type());
-    return true;
-}
-
-#ifndef NDEBUG
-static inline bool propertyTypesAreConsistent(AnimatedPropertyType expectedPropertyType, const SVGElementAnimatedPropertyList& animatedTypes)
-{
-    SVGElementAnimatedPropertyList::const_iterator end = animatedTypes.end();
-    for (SVGElementAnimatedPropertyList::const_iterator it = animatedTypes.begin(); it != end; ++it) {
-        for (size_t i = 0; i < it->properties.size(); ++i) {
-            if (expectedPropertyType != it->properties[i]->animatedPropertyType()) {
-                // This is the only allowed inconsistency. SVGAnimatedAngleAnimator handles both SVGAnimatedAngle & SVGAnimatedEnumeration for markers orient attribute.
-                if (expectedPropertyType == AnimatedAngle && it->properties[i]->animatedPropertyType() == AnimatedEnumeration)
-                    return true;
-                return false;
-            }
-        }
-    }
-
-    return true;
-}
-#endif
-
-void SVGAnimateElement::resetAnimatedType()
-{
-    SVGAnimatedTypeAnimator* animator = ensureAnimator();
-    ASSERT(m_animatedPropertyType == animator->type());
-
-    SVGElement* targetElement = this->targetElement();
-    const QualifiedName& attributeName = this->attributeName();
-    ShouldApplyAnimation shouldApply = shouldApplyAnimation(targetElement, attributeName);
-
-    if (shouldApply == DontApplyAnimation)
-        return;
-
-    if (shouldApply == ApplyXMLAnimation || shouldApply == ApplyXMLandCSSAnimation) {
-        // SVG DOM animVal animation code-path.
-        m_animatedProperties = animator->findAnimatedPropertiesForAttributeName(targetElement, attributeName);
-        ASSERT(!m_animatedProperties.isEmpty());
-
-        ASSERT(propertyTypesAreConsistent(m_animatedPropertyType, m_animatedProperties));
-        if (!m_animatedType)
-            m_animatedType = animator->startAnimValAnimation(m_animatedProperties);
-        else {
-            animator->resetAnimValToBaseVal(m_animatedProperties, m_animatedType.get());
-            animator->animValDidChange(m_animatedProperties);
-        }
-        return;
-    }
-
-    // CSS properties animation code-path.
-    ASSERT(m_animatedProperties.isEmpty());
-    String baseValue;
-
-    if (shouldApply == ApplyCSSAnimation) {
-        ASSERT(SVGAnimationElement::isTargetAttributeCSSProperty(targetElement, attributeName));
-        computeCSSPropertyValue(targetElement, cssPropertyID(attributeName.localName()), baseValue);
-    }
-
-    if (!m_animatedType)
-        m_animatedType = animator->constructFromString(baseValue);
-    else
-        m_animatedType->setValueAsString(attributeName, baseValue);
-}
-
-static inline void applyCSSPropertyToTarget(SVGElement* targetElement, CSSPropertyID id, const String& value)
-{
-    ASSERT(!targetElement->m_deletionHasBegun);
-
-    if (!targetElement->ensureAnimatedSMILStyleProperties().setProperty(id, value, false, 0))
-        return;
-
-    targetElement->setNeedsStyleRecalc(SyntheticStyleChange);
-}
-
-static inline void removeCSSPropertyFromTarget(SVGElement* targetElement, CSSPropertyID id)
-{
-    ASSERT(!targetElement->m_deletionHasBegun);
-    targetElement->ensureAnimatedSMILStyleProperties().removeProperty(id);
-    targetElement->setNeedsStyleRecalc(SyntheticStyleChange);
-}
-
-static inline void applyCSSPropertyToTargetAndInstances(SVGElement* targetElement, const QualifiedName& attributeName, const String& valueAsString)
-{
-    ASSERT(targetElement);
-    if (attributeName == anyQName() || !targetElement->inDocument() || !targetElement->parentNode())
-        return;
-
-    CSSPropertyID id = cssPropertyID(attributeName.localName());
-
-    SVGElementInstance::InstanceUpdateBlocker blocker(targetElement);
-    applyCSSPropertyToTarget(targetElement, id, valueAsString);
-
-    // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt.
-    const HashSet<SVGElementInstance*>& instances = targetElement->instancesForElement();
-    const HashSet<SVGElementInstance*>::const_iterator end = instances.end();
-    for (HashSet<SVGElementInstance*>::const_iterator it = instances.begin(); it != end; ++it) {
-        if (SVGElement* shadowTreeElement = (*it)->shadowTreeElement())
-            applyCSSPropertyToTarget(shadowTreeElement, id, valueAsString);
-    }
-}
-
-static inline void removeCSSPropertyFromTargetAndInstances(SVGElement* targetElement, const QualifiedName& attributeName)
-{
-    ASSERT(targetElement);
-    if (attributeName == anyQName() || !targetElement->inDocument() || !targetElement->parentNode())
-        return;
-
-    CSSPropertyID id = cssPropertyID(attributeName.localName());
-
-    SVGElementInstance::InstanceUpdateBlocker blocker(targetElement);
-    removeCSSPropertyFromTarget(targetElement, id);
-
-    // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt.
-    const HashSet<SVGElementInstance*>& instances = targetElement->instancesForElement();
-    const HashSet<SVGElementInstance*>::const_iterator end = instances.end();
-    for (HashSet<SVGElementInstance*>::const_iterator it = instances.begin(); it != end; ++it) {
-        if (SVGElement* shadowTreeElement = (*it)->shadowTreeElement())
-            removeCSSPropertyFromTarget(shadowTreeElement, id);
-    }
-}
-
-static inline void notifyTargetAboutAnimValChange(SVGElement* targetElement, const QualifiedName& attributeName)
-{
-    ASSERT(!targetElement->m_deletionHasBegun);
-    targetElement->svgAttributeChanged(attributeName);
-}
-
-static inline void notifyTargetAndInstancesAboutAnimValChange(SVGElement* targetElement, const QualifiedName& attributeName)
-{
-    ASSERT(targetElement);
-    if (attributeName == anyQName() || !targetElement->inDocument() || !targetElement->parentNode())
-        return;
-
-    SVGElementInstance::InstanceUpdateBlocker blocker(targetElement);
-    notifyTargetAboutAnimValChange(targetElement, attributeName);
-
-    // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt.
-    const HashSet<SVGElementInstance*>& instances = targetElement->instancesForElement();
-    const HashSet<SVGElementInstance*>::const_iterator end = instances.end();
-    for (HashSet<SVGElementInstance*>::const_iterator it = instances.begin(); it != end; ++it) {
-        if (SVGElement* shadowTreeElement = (*it)->shadowTreeElement())
-            notifyTargetAboutAnimValChange(shadowTreeElement, attributeName);
-    }
-}
-
-void SVGAnimateElement::clearAnimatedType(SVGElement* targetElement)
-{
-    if (!m_animatedType)
-        return;
-
-    if (!targetElement) {
-        m_animatedType = nullptr;
-        return;
-    }
-
-    if (m_animatedProperties.isEmpty()) {
-        // CSS properties animation code-path.
-        removeCSSPropertyFromTargetAndInstances(targetElement, attributeName());
-        m_animatedType = nullptr;
-        return;
-    }
-
-    ShouldApplyAnimation shouldApply = shouldApplyAnimation(targetElement, attributeName());
-    if (shouldApply == ApplyXMLandCSSAnimation)
-        removeCSSPropertyFromTargetAndInstances(targetElement, attributeName());
-
-    // SVG DOM animVal animation code-path.
-    if (m_animator) {
-        m_animator->stopAnimValAnimation(m_animatedProperties);
-        notifyTargetAndInstancesAboutAnimValChange(targetElement, attributeName());
-    }
-
-    m_animatedProperties.clear();
-    m_animatedType = nullptr;
-}
-
-void SVGAnimateElement::applyResultsToTarget()
-{
-    ASSERT(m_animatedPropertyType != AnimatedTransformList || hasTagName(SVGNames::animateTransformTag));
-    ASSERT(m_animatedPropertyType != AnimatedUnknown);
-    ASSERT(m_animator);
-
-    // Early exit if our animated type got destructed by a previous endedActiveInterval().
-    if (!m_animatedType)
-        return;
-
-    SVGElement* targetElement = this->targetElement();
-    const QualifiedName& attributeName = this->attributeName();
-    if (m_animatedProperties.isEmpty()) {
-        // CSS properties animation code-path.
-        // Convert the result of the animation to a String and apply it as CSS property on the target & all instances.
-        applyCSSPropertyToTargetAndInstances(targetElement, attributeName, m_animatedType->valueAsString());
-        return;
-    }
-
-    // We do update the style and the animation property independent of each other.
-    ShouldApplyAnimation shouldApply = shouldApplyAnimation(targetElement, attributeName);
-    if (shouldApply == ApplyXMLandCSSAnimation)
-        applyCSSPropertyToTargetAndInstances(targetElement, attributeName, m_animatedType->valueAsString());
-
-    // SVG DOM animVal animation code-path.
-    // At this point the SVG DOM values are already changed, unlike for CSS.
-    // We only have to trigger update notifications here.
-    m_animator->animValDidChange(m_animatedProperties);
-    notifyTargetAndInstancesAboutAnimValChange(targetElement, attributeName);
-}
-
-bool SVGAnimateElement::animatedPropertyTypeSupportsAddition() const
-{
-    // Spec: http://www.w3.org/TR/SVG/animate.html#AnimationAttributesAndProperties.
-    switch (m_animatedPropertyType) {
-    case AnimatedBoolean:
-    case AnimatedEnumeration:
-    case AnimatedPreserveAspectRatio:
-    case AnimatedString:
-    case AnimatedUnknown:
-        return false;
-    case AnimatedAngle:
-    case AnimatedColor:
-    case AnimatedInteger:
-    case AnimatedIntegerOptionalInteger:
-    case AnimatedLength:
-    case AnimatedLengthList:
-    case AnimatedNumber:
-    case AnimatedNumberList:
-    case AnimatedNumberOptionalNumber:
-    case AnimatedPath:
-    case AnimatedPoints:
-    case AnimatedRect:
-    case AnimatedTransformList:
-        return true;
-    default:
-        RELEASE_ASSERT_NOT_REACHED();
-        return true;
-    }
-}
-
-bool SVGAnimateElement::isAdditive() const
-{
-    if (animationMode() == ByAnimation || animationMode() == FromByAnimation)
-        if (!animatedPropertyTypeSupportsAddition())
-            return false;
-
-    return SVGAnimationElement::isAdditive();
-}
-
-float SVGAnimateElement::calculateDistance(const String& fromString, const String& toString)
-{
-    // FIXME: A return value of float is not enough to support paced animations on lists.
-    SVGElement* targetElement = this->targetElement();
-    if (!targetElement)
-        return -1;
-
-    return ensureAnimator()->calculateDistance(fromString, toString);
-}
-
-void SVGAnimateElement::setTargetElement(SVGElement* target)
-{
-    SVGAnimationElement::setTargetElement(target);
-    resetAnimatedPropertyType();
-}
-
-void SVGAnimateElement::setAttributeName(const QualifiedName& attributeName)
-{
-    SVGAnimationElement::setAttributeName(attributeName);
-    resetAnimatedPropertyType();
-}
-
-void SVGAnimateElement::resetAnimatedPropertyType()
-{
-    ASSERT(!m_animatedType);
-    m_fromType = nullptr;
-    m_toType = nullptr;
-    m_toAtEndOfDurationType = nullptr;
-    m_animator = nullptr;
-    m_animatedPropertyType = targetElement() ? determineAnimatedPropertyType(targetElement()) : AnimatedString;
-}
-
-SVGAnimatedTypeAnimator* SVGAnimateElement::ensureAnimator()
-{
-    if (!m_animator)
-        m_animator = SVGAnimatorFactory::create(this, targetElement(), m_animatedPropertyType);
-    ASSERT(m_animatedPropertyType == m_animator->type());
-    return m_animator.get();
-}
-
-}
+} // namespace WebCore
index 641bff3..e3d0794 100644 (file)
@@ -1,88 +1,45 @@
 /*
- * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org>
- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
- * Copyright (C) 2008 Apple Inc. All rights reserved.
- * Copyright (C) Research In Motion Limited 2011. All rights reserved.
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
  *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #ifndef SVGAnimateElement_h
 #define SVGAnimateElement_h
 
-#include "SVGAnimatedType.h"
-#include "SVGAnimatedTypeAnimator.h"
-#include "SVGAnimationElement.h"
-#include "SVGNames.h"
+#include "SVGAnimateElementBase.h"
 
 namespace WebCore {
 
 class SVGAnimatedProperty;
 
-class SVGAnimateElement : public SVGAnimationElement {
+class SVGAnimateElement final : public SVGAnimateElementBase {
 public:
     static PassRefPtr<SVGAnimateElement> create(const QualifiedName&, Document&);
-    virtual ~SVGAnimateElement();
-
-    AnimatedPropertyType determineAnimatedPropertyType(SVGElement*) const;
-
-protected:
-    SVGAnimateElement(const QualifiedName&, Document&);
-
-    virtual void resetAnimatedType() override;
-    virtual void clearAnimatedType(SVGElement* targetElement) override;
-
-    virtual bool calculateToAtEndOfDurationValue(const String& toAtEndOfDurationString) override;
-    virtual bool calculateFromAndToValues(const String& fromString, const String& toString) override;
-    virtual bool calculateFromAndByValues(const String& fromString, const String& byString) override;
-    virtual void calculateAnimatedValue(float percentage, unsigned repeatCount, SVGSMILElement* resultElement) override;
-    virtual void applyResultsToTarget() override;
-    virtual float calculateDistance(const String& fromString, const String& toString) override;
-    virtual bool isAdditive() const override;
-
-    virtual void setTargetElement(SVGElement*) override;
-    virtual void setAttributeName(const QualifiedName&) override;
-
-    AnimatedPropertyType m_animatedPropertyType;
 
 private:
-    void resetAnimatedPropertyType();
-    SVGAnimatedTypeAnimator* ensureAnimator();
-    bool animatedPropertyTypeSupportsAddition() const;
-
-    virtual bool hasValidAttributeType() override;
-
-    std::unique_ptr<SVGAnimatedType> m_fromType;
-    std::unique_ptr<SVGAnimatedType> m_toType;
-    std::unique_ptr<SVGAnimatedType> m_toAtEndOfDurationType;
-    std::unique_ptr<SVGAnimatedType> m_animatedType;
-
-    SVGElementAnimatedPropertyList m_animatedProperties;
-    std::unique_ptr<SVGAnimatedTypeAnimator> m_animator;
+    SVGAnimateElement(const QualifiedName&, Document&);
 };
 
-SPECIALIZE_TYPE_TRAITS_BEGIN(SVGAnimateElement)
-    static bool isSVGAnimateElement(const SVGElement& element)
-    {
-        return element.hasTagName(SVGNames::animateTag) || element.hasTagName(SVGNames::animateColorTag)
-            || element.hasTagName(SVGNames::animateTransformTag) || element.hasTagName(SVGNames::setTag);
-    }
-    static bool isSVGAnimateElement(const Node& node) { return is<SVGElement>(node) && isSVGAnimateElement(downcast<SVGElement>(node)); }
-SPECIALIZE_TYPE_TRAITS_END()
-
 } // namespace WebCore
 
 #endif // SVGAnimateElement_h
diff --git a/Source/WebCore/svg/SVGAnimateElementBase.cpp b/Source/WebCore/svg/SVGAnimateElementBase.cpp
new file mode 100644 (file)
index 0000000..ba126e8
--- /dev/null
@@ -0,0 +1,458 @@
+/*
+ * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
+ * Copyright (C) 2008 Apple Inc. All rights reserved.
+ * Copyright (C) Research In Motion Limited 2011. All rights reserved.
+ * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "SVGAnimateElementBase.h"
+
+#include "CSSParser.h"
+#include "CSSPropertyNames.h"
+#include "QualifiedName.h"
+#include "RenderObject.h"
+#include "SVGAnimatorFactory.h"
+#include "SVGElement.h"
+#include "SVGNames.h"
+#include "StyleProperties.h"
+
+namespace WebCore {
+
+SVGAnimateElementBase::SVGAnimateElementBase(const QualifiedName& tagName, Document& document)
+    : SVGAnimationElement(tagName, document)
+    , m_animatedPropertyType(AnimatedString)
+{
+    ASSERT(hasTagName(SVGNames::animateTag) || hasTagName(SVGNames::setTag) || hasTagName(SVGNames::animateColorTag) || hasTagName(SVGNames::animateTransformTag));
+}
+
+SVGAnimateElementBase::~SVGAnimateElementBase()
+{
+}
+
+bool SVGAnimateElementBase::hasValidAttributeType()
+{
+    SVGElement* targetElement = this->targetElement();
+    if (!targetElement)
+        return false;
+
+    return m_animatedPropertyType != AnimatedUnknown && !hasInvalidCSSAttributeType();
+}
+
+AnimatedPropertyType SVGAnimateElementBase::determineAnimatedPropertyType(SVGElement* targetElement) const
+{
+    ASSERT(targetElement);
+
+    Vector<AnimatedPropertyType> propertyTypes;
+    targetElement->animatedPropertyTypeForAttribute(attributeName(), propertyTypes);
+    if (propertyTypes.isEmpty())
+        return AnimatedUnknown;
+
+    ASSERT(propertyTypes.size() <= 2);
+    AnimatedPropertyType type = propertyTypes[0];
+    if (hasTagName(SVGNames::animateColorTag) && type != AnimatedColor)
+        return AnimatedUnknown;
+
+    // Animations of transform lists are not allowed for <animate> or <set>
+    // http://www.w3.org/TR/SVG/animate.html#AnimationAttributesAndProperties
+    if (type == AnimatedTransformList && !hasTagName(SVGNames::animateTransformTag))
+        return AnimatedUnknown;
+
+    // Fortunately there's just one special case needed here: SVGMarkerElements orientAttr, which
+    // corresponds to SVGAnimatedAngle orientAngle and SVGAnimatedEnumeration orientType. We have to
+    // figure out whose value to change here.
+    if (targetElement->hasTagName(SVGNames::markerTag) && type == AnimatedAngle) {
+        ASSERT(propertyTypes.size() == 2);
+        ASSERT(propertyTypes[0] == AnimatedAngle);
+        ASSERT(propertyTypes[1] == AnimatedEnumeration);
+    } else if (propertyTypes.size() == 2)
+        ASSERT(propertyTypes[0] == propertyTypes[1]);
+
+    return type;
+}
+
+void SVGAnimateElementBase::calculateAnimatedValue(float percentage, unsigned repeatCount, SVGSMILElement* resultElement)
+{
+    ASSERT(resultElement);
+    SVGElement* targetElement = this->targetElement();
+    if (!targetElement)
+        return;
+
+    ASSERT(m_animatedPropertyType == determineAnimatedPropertyType(targetElement));
+
+    ASSERT(percentage >= 0 && percentage <= 1);
+    ASSERT(m_animatedPropertyType != AnimatedTransformList || hasTagName(SVGNames::animateTransformTag));
+    ASSERT(m_animatedPropertyType != AnimatedUnknown);
+    ASSERT(m_animator);
+    ASSERT(m_animator->type() == m_animatedPropertyType);
+    ASSERT(m_fromType);
+    ASSERT(m_fromType->type() == m_animatedPropertyType);
+    ASSERT(m_toType);
+
+    SVGAnimateElementBase& resultAnimationElement = downcast<SVGAnimateElementBase>(*resultElement);
+    ASSERT(resultAnimationElement.m_animatedType);
+    ASSERT(resultAnimationElement.m_animatedPropertyType == m_animatedPropertyType);
+
+    if (hasTagName(SVGNames::setTag))
+        percentage = 1;
+
+    if (calcMode() == CalcModeDiscrete)
+        percentage = percentage < 0.5 ? 0 : 1;
+
+    // Target element might have changed.
+    m_animator->setContextElement(targetElement);
+
+    // Be sure to detach list wrappers before we modfiy their underlying value. If we'd do
+    // if after calculateAnimatedValue() ran the cached pointers in the list propery tear
+    // offs would point nowhere, and we couldn't create copies of those values anymore,
+    // while detaching. This is covered by assertions, moving this down would fire them.
+    if (!m_animatedProperties.isEmpty())
+        m_animator->animValWillChange(m_animatedProperties);
+
+    // Values-animation accumulates using the last values entry corresponding to the end of duration time.
+    SVGAnimatedType* toAtEndOfDurationType = m_toAtEndOfDurationType ? m_toAtEndOfDurationType.get() : m_toType.get();
+    m_animator->calculateAnimatedValue(percentage, repeatCount, m_fromType.get(), m_toType.get(), toAtEndOfDurationType, resultAnimationElement.m_animatedType.get());
+}
+
+bool SVGAnimateElementBase::calculateToAtEndOfDurationValue(const String& toAtEndOfDurationString)
+{
+    if (toAtEndOfDurationString.isEmpty())
+        return false;
+    m_toAtEndOfDurationType = ensureAnimator()->constructFromString(toAtEndOfDurationString);
+    return true;
+}
+
+bool SVGAnimateElementBase::calculateFromAndToValues(const String& fromString, const String& toString)
+{
+    SVGElement* targetElement = this->targetElement();
+    if (!targetElement)
+        return false;
+
+    determinePropertyValueTypes(fromString, toString);
+    ensureAnimator()->calculateFromAndToValues(m_fromType, m_toType, fromString, toString);
+    ASSERT(m_animatedPropertyType == m_animator->type());
+    return true;
+}
+
+bool SVGAnimateElementBase::calculateFromAndByValues(const String& fromString, const String& byString)
+{
+    SVGElement* targetElement = this->targetElement();
+    if (!targetElement)
+        return false;
+
+    if (animationMode() == ByAnimation && !isAdditive())
+        return false;
+
+    // from-by animation may only be used with attributes that support addition (e.g. most numeric attributes).
+    if (animationMode() == FromByAnimation && !animatedPropertyTypeSupportsAddition())
+        return false;
+
+    ASSERT(!hasTagName(SVGNames::setTag));
+
+    determinePropertyValueTypes(fromString, byString);
+    ensureAnimator()->calculateFromAndByValues(m_fromType, m_toType, fromString, byString);
+    ASSERT(m_animatedPropertyType == m_animator->type());
+    return true;
+}
+
+#ifndef NDEBUG
+static inline bool propertyTypesAreConsistent(AnimatedPropertyType expectedPropertyType, const SVGElementAnimatedPropertyList& animatedTypes)
+{
+    SVGElementAnimatedPropertyList::const_iterator end = animatedTypes.end();
+    for (SVGElementAnimatedPropertyList::const_iterator it = animatedTypes.begin(); it != end; ++it) {
+        for (size_t i = 0; i < it->properties.size(); ++i) {
+            if (expectedPropertyType != it->properties[i]->animatedPropertyType()) {
+                // This is the only allowed inconsistency. SVGAnimatedAngleAnimator handles both SVGAnimatedAngle & SVGAnimatedEnumeration for markers orient attribute.
+                if (expectedPropertyType == AnimatedAngle && it->properties[i]->animatedPropertyType() == AnimatedEnumeration)
+                    return true;
+                return false;
+            }
+        }
+    }
+
+    return true;
+}
+#endif
+
+void SVGAnimateElementBase::resetAnimatedType()
+{
+    SVGAnimatedTypeAnimator* animator = ensureAnimator();
+    ASSERT(m_animatedPropertyType == animator->type());
+
+    SVGElement* targetElement = this->targetElement();
+    const QualifiedName& attributeName = this->attributeName();
+    ShouldApplyAnimation shouldApply = shouldApplyAnimation(targetElement, attributeName);
+
+    if (shouldApply == DontApplyAnimation)
+        return;
+
+    if (shouldApply == ApplyXMLAnimation || shouldApply == ApplyXMLandCSSAnimation) {
+        // SVG DOM animVal animation code-path.
+        m_animatedProperties = animator->findAnimatedPropertiesForAttributeName(targetElement, attributeName);
+        ASSERT(!m_animatedProperties.isEmpty());
+
+        ASSERT(propertyTypesAreConsistent(m_animatedPropertyType, m_animatedProperties));
+        if (!m_animatedType)
+            m_animatedType = animator->startAnimValAnimation(m_animatedProperties);
+        else {
+            animator->resetAnimValToBaseVal(m_animatedProperties, m_animatedType.get());
+            animator->animValDidChange(m_animatedProperties);
+        }
+        return;
+    }
+
+    // CSS properties animation code-path.
+    ASSERT(m_animatedProperties.isEmpty());
+    String baseValue;
+
+    if (shouldApply == ApplyCSSAnimation) {
+        ASSERT(SVGAnimationElement::isTargetAttributeCSSProperty(targetElement, attributeName));
+        computeCSSPropertyValue(targetElement, cssPropertyID(attributeName.localName()), baseValue);
+    }
+
+    if (!m_animatedType)
+        m_animatedType = animator->constructFromString(baseValue);
+    else
+        m_animatedType->setValueAsString(attributeName, baseValue);
+}
+
+static inline void applyCSSPropertyToTarget(SVGElement* targetElement, CSSPropertyID id, const String& value)
+{
+    ASSERT(!targetElement->m_deletionHasBegun);
+
+    if (!targetElement->ensureAnimatedSMILStyleProperties().setProperty(id, value, false, 0))
+        return;
+
+    targetElement->setNeedsStyleRecalc(SyntheticStyleChange);
+}
+
+static inline void removeCSSPropertyFromTarget(SVGElement* targetElement, CSSPropertyID id)
+{
+    ASSERT(!targetElement->m_deletionHasBegun);
+    targetElement->ensureAnimatedSMILStyleProperties().removeProperty(id);
+    targetElement->setNeedsStyleRecalc(SyntheticStyleChange);
+}
+
+static inline void applyCSSPropertyToTargetAndInstances(SVGElement* targetElement, const QualifiedName& attributeName, const String& valueAsString)
+{
+    ASSERT(targetElement);
+    if (attributeName == anyQName() || !targetElement->inDocument() || !targetElement->parentNode())
+        return;
+
+    CSSPropertyID id = cssPropertyID(attributeName.localName());
+
+    SVGElementInstance::InstanceUpdateBlocker blocker(targetElement);
+    applyCSSPropertyToTarget(targetElement, id, valueAsString);
+
+    // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt.
+    const HashSet<SVGElementInstance*>& instances = targetElement->instancesForElement();
+    const HashSet<SVGElementInstance*>::const_iterator end = instances.end();
+    for (HashSet<SVGElementInstance*>::const_iterator it = instances.begin(); it != end; ++it) {
+        if (SVGElement* shadowTreeElement = (*it)->shadowTreeElement())
+            applyCSSPropertyToTarget(shadowTreeElement, id, valueAsString);
+    }
+}
+
+static inline void removeCSSPropertyFromTargetAndInstances(SVGElement* targetElement, const QualifiedName& attributeName)
+{
+    ASSERT(targetElement);
+    if (attributeName == anyQName() || !targetElement->inDocument() || !targetElement->parentNode())
+        return;
+
+    CSSPropertyID id = cssPropertyID(attributeName.localName());
+
+    SVGElementInstance::InstanceUpdateBlocker blocker(targetElement);
+    removeCSSPropertyFromTarget(targetElement, id);
+
+    // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt.
+    const HashSet<SVGElementInstance*>& instances = targetElement->instancesForElement();
+    const HashSet<SVGElementInstance*>::const_iterator end = instances.end();
+    for (HashSet<SVGElementInstance*>::const_iterator it = instances.begin(); it != end; ++it) {
+        if (SVGElement* shadowTreeElement = (*it)->shadowTreeElement())
+            removeCSSPropertyFromTarget(shadowTreeElement, id);
+    }
+}
+
+static inline void notifyTargetAboutAnimValChange(SVGElement* targetElement, const QualifiedName& attributeName)
+{
+    ASSERT(!targetElement->m_deletionHasBegun);
+    targetElement->svgAttributeChanged(attributeName);
+}
+
+static inline void notifyTargetAndInstancesAboutAnimValChange(SVGElement* targetElement, const QualifiedName& attributeName)
+{
+    ASSERT(targetElement);
+    if (attributeName == anyQName() || !targetElement->inDocument() || !targetElement->parentNode())
+        return;
+
+    SVGElementInstance::InstanceUpdateBlocker blocker(targetElement);
+    notifyTargetAboutAnimValChange(targetElement, attributeName);
+
+    // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt.
+    const HashSet<SVGElementInstance*>& instances = targetElement->instancesForElement();
+    const HashSet<SVGElementInstance*>::const_iterator end = instances.end();
+    for (HashSet<SVGElementInstance*>::const_iterator it = instances.begin(); it != end; ++it) {
+        if (SVGElement* shadowTreeElement = (*it)->shadowTreeElement())
+            notifyTargetAboutAnimValChange(shadowTreeElement, attributeName);
+    }
+}
+
+void SVGAnimateElementBase::clearAnimatedType(SVGElement* targetElement)
+{
+    if (!m_animatedType)
+        return;
+
+    if (!targetElement) {
+        m_animatedType = nullptr;
+        return;
+    }
+
+    if (m_animatedProperties.isEmpty()) {
+        // CSS properties animation code-path.
+        removeCSSPropertyFromTargetAndInstances(targetElement, attributeName());
+        m_animatedType = nullptr;
+        return;
+    }
+
+    ShouldApplyAnimation shouldApply = shouldApplyAnimation(targetElement, attributeName());
+    if (shouldApply == ApplyXMLandCSSAnimation)
+        removeCSSPropertyFromTargetAndInstances(targetElement, attributeName());
+
+    // SVG DOM animVal animation code-path.
+    if (m_animator) {
+        m_animator->stopAnimValAnimation(m_animatedProperties);
+        notifyTargetAndInstancesAboutAnimValChange(targetElement, attributeName());
+    }
+
+    m_animatedProperties.clear();
+    m_animatedType = nullptr;
+}
+
+void SVGAnimateElementBase::applyResultsToTarget()
+{
+    ASSERT(m_animatedPropertyType != AnimatedTransformList || hasTagName(SVGNames::animateTransformTag));
+    ASSERT(m_animatedPropertyType != AnimatedUnknown);
+    ASSERT(m_animator);
+
+    // Early exit if our animated type got destructed by a previous endedActiveInterval().
+    if (!m_animatedType)
+        return;
+
+    SVGElement* targetElement = this->targetElement();
+    const QualifiedName& attributeName = this->attributeName();
+    if (m_animatedProperties.isEmpty()) {
+        // CSS properties animation code-path.
+        // Convert the result of the animation to a String and apply it as CSS property on the target & all instances.
+        applyCSSPropertyToTargetAndInstances(targetElement, attributeName, m_animatedType->valueAsString());
+        return;
+    }
+
+    // We do update the style and the animation property independent of each other.
+    ShouldApplyAnimation shouldApply = shouldApplyAnimation(targetElement, attributeName);
+    if (shouldApply == ApplyXMLandCSSAnimation)
+        applyCSSPropertyToTargetAndInstances(targetElement, attributeName, m_animatedType->valueAsString());
+
+    // SVG DOM animVal animation code-path.
+    // At this point the SVG DOM values are already changed, unlike for CSS.
+    // We only have to trigger update notifications here.
+    m_animator->animValDidChange(m_animatedProperties);
+    notifyTargetAndInstancesAboutAnimValChange(targetElement, attributeName);
+}
+
+bool SVGAnimateElementBase::animatedPropertyTypeSupportsAddition() const
+{
+    // Spec: http://www.w3.org/TR/SVG/animate.html#AnimationAttributesAndProperties.
+    switch (m_animatedPropertyType) {
+    case AnimatedBoolean:
+    case AnimatedEnumeration:
+    case AnimatedPreserveAspectRatio:
+    case AnimatedString:
+    case AnimatedUnknown:
+        return false;
+    case AnimatedAngle:
+    case AnimatedColor:
+    case AnimatedInteger:
+    case AnimatedIntegerOptionalInteger:
+    case AnimatedLength:
+    case AnimatedLengthList:
+    case AnimatedNumber:
+    case AnimatedNumberList:
+    case AnimatedNumberOptionalNumber:
+    case AnimatedPath:
+    case AnimatedPoints:
+    case AnimatedRect:
+    case AnimatedTransformList:
+        return true;
+    default:
+        RELEASE_ASSERT_NOT_REACHED();
+        return true;
+    }
+}
+
+bool SVGAnimateElementBase::isAdditive() const
+{
+    if (animationMode() == ByAnimation || animationMode() == FromByAnimation) {
+        if (!animatedPropertyTypeSupportsAddition())
+            return false;
+    }
+
+    return SVGAnimationElement::isAdditive();
+}
+
+float SVGAnimateElementBase::calculateDistance(const String& fromString, const String& toString)
+{
+    // FIXME: A return value of float is not enough to support paced animations on lists.
+    SVGElement* targetElement = this->targetElement();
+    if (!targetElement)
+        return -1;
+
+    return ensureAnimator()->calculateDistance(fromString, toString);
+}
+
+void SVGAnimateElementBase::setTargetElement(SVGElement* target)
+{
+    SVGAnimationElement::setTargetElement(target);
+    resetAnimatedPropertyType();
+}
+
+void SVGAnimateElementBase::setAttributeName(const QualifiedName& attributeName)
+{
+    SVGAnimationElement::setAttributeName(attributeName);
+    resetAnimatedPropertyType();
+}
+
+void SVGAnimateElementBase::resetAnimatedPropertyType()
+{
+    ASSERT(!m_animatedType);
+    m_fromType = nullptr;
+    m_toType = nullptr;
+    m_toAtEndOfDurationType = nullptr;
+    m_animator = nullptr;
+    m_animatedPropertyType = targetElement() ? determineAnimatedPropertyType(targetElement()) : AnimatedString;
+}
+
+SVGAnimatedTypeAnimator* SVGAnimateElementBase::ensureAnimator()
+{
+    if (!m_animator)
+        m_animator = SVGAnimatorFactory::create(this, targetElement(), m_animatedPropertyType);
+    ASSERT(m_animatedPropertyType == m_animator->type());
+    return m_animator.get();
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/svg/SVGAnimateElementBase.h b/Source/WebCore/svg/SVGAnimateElementBase.h
new file mode 100644 (file)
index 0000000..7d94a3d
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
+ * Copyright (C) 2008 Apple Inc. All rights reserved.
+ * Copyright (C) Research In Motion Limited 2011. All rights reserved.
+ * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef SVGAnimateElementBase_h
+#define SVGAnimateElementBase_h
+
+#include "SVGAnimatedType.h"
+#include "SVGAnimatedTypeAnimator.h"
+#include "SVGAnimationElement.h"
+#include "SVGNames.h"
+
+namespace WebCore {
+
+class SVGAnimateElementBase : public SVGAnimationElement {
+public:
+    virtual ~SVGAnimateElementBase();
+
+    AnimatedPropertyType determineAnimatedPropertyType(SVGElement*) const;
+
+protected:
+    SVGAnimateElementBase(const QualifiedName&, Document&);
+
+    virtual void resetAnimatedType() override;
+    virtual void clearAnimatedType(SVGElement* targetElement) override;
+
+    virtual bool calculateToAtEndOfDurationValue(const String& toAtEndOfDurationString) override;
+    virtual bool calculateFromAndToValues(const String& fromString, const String& toString) override;
+    virtual bool calculateFromAndByValues(const String& fromString, const String& byString) override;
+    virtual void calculateAnimatedValue(float percentage, unsigned repeatCount, SVGSMILElement* resultElement) override;
+    virtual void applyResultsToTarget() override;
+    virtual float calculateDistance(const String& fromString, const String& toString) override;
+    virtual bool isAdditive() const override;
+
+    virtual void setTargetElement(SVGElement*) override;
+    virtual void setAttributeName(const QualifiedName&) override;
+
+    AnimatedPropertyType m_animatedPropertyType;
+
+private:
+    void resetAnimatedPropertyType();
+    SVGAnimatedTypeAnimator* ensureAnimator();
+    bool animatedPropertyTypeSupportsAddition() const;
+
+    virtual bool hasValidAttributeType() override;
+
+    std::unique_ptr<SVGAnimatedType> m_fromType;
+    std::unique_ptr<SVGAnimatedType> m_toType;
+    std::unique_ptr<SVGAnimatedType> m_toAtEndOfDurationType;
+    std::unique_ptr<SVGAnimatedType> m_animatedType;
+
+    SVGElementAnimatedPropertyList m_animatedProperties;
+    std::unique_ptr<SVGAnimatedTypeAnimator> m_animator;
+};
+
+SPECIALIZE_TYPE_TRAITS_BEGIN(SVGAnimateElementBase)
+    static bool isSVGAnimateElementBase(const SVGElement& element)
+    {
+        return element.hasTagName(SVGNames::animateTag) || element.hasTagName(SVGNames::animateColorTag)
+            || element.hasTagName(SVGNames::animateTransformTag) || element.hasTagName(SVGNames::setTag);
+    }
+    static bool isSVGAnimateElementBase(const Node& node) { return is<SVGElement>(node) && isSVGAnimateElementBase(downcast<SVGElement>(node)); }
+SPECIALIZE_TYPE_TRAITS_END()
+
+} // namespace WebCore
+
+#endif // SVGAnimateElementBase_h
index 22ba79b..fea1f01 100644 (file)
@@ -31,7 +31,7 @@
 namespace WebCore {
 
 inline SVGAnimateTransformElement::SVGAnimateTransformElement(const QualifiedName& tagName, Document& document)
-    : SVGAnimateElement(tagName, document)
+    : SVGAnimateElementBase(tagName, document)
     , m_type(SVGTransform::SVG_TRANSFORM_UNKNOWN)
 {
     ASSERT(hasTagName(SVGNames::animateTransformTag));
@@ -65,7 +65,7 @@ bool SVGAnimateTransformElement::isSupportedAttribute(const QualifiedName& attrN
 void SVGAnimateTransformElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
 {
     if (!isSupportedAttribute(name)) {
-        SVGAnimateElement::parseAttribute(name, value);
+        SVGAnimateElementBase::parseAttribute(name, value);
         return;
     }
 
index b1a44ea..b7d48f1 100644 (file)
 #ifndef SVGAnimateTransformElement_h
 #define SVGAnimateTransformElement_h
 
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
 #include "SVGTransform.h"
 
 namespace WebCore {
 
 class AffineTransform;
 
-class SVGAnimateTransformElement final : public SVGAnimateElement {
+class SVGAnimateTransformElement final : public SVGAnimateElementBase {
 public:
     static PassRefPtr<SVGAnimateTransformElement> create(const QualifiedName&, Document&);
 
index c13cd50..e1689cf 100644 (file)
@@ -20,7 +20,7 @@
 #include "config.h"
 #include "SVGAnimatedAngle.h"
 
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
 #include "SVGMarkerElement.h"
 
 namespace WebCore {
index 6f820aa..835f181 100644 (file)
@@ -20,7 +20,7 @@
 #include "config.h"
 #include "SVGAnimatedBoolean.h"
 
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
 
 namespace WebCore {
 
index f916342..ac48645 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "ColorDistance.h"
 #include "RenderElement.h"
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
 #include "SVGColor.h"
 
 namespace WebCore {
index 978001d..404cca7 100644 (file)
@@ -20,7 +20,7 @@
 #include "config.h"
 #include "SVGAnimatedInteger.h"
 
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
 #include "SVGAnimatedNumber.h"
 #include <wtf/MathExtras.h>
 
index e45f07e..4283300 100644 (file)
@@ -20,7 +20,7 @@
 #include "config.h"
 #include "SVGAnimatedIntegerOptionalInteger.h"
 
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
 #include "SVGAnimatedInteger.h"
 #include "SVGParserUtilities.h"
 
index 69d90cc..c8b33a5 100644 (file)
@@ -20,7 +20,7 @@
 #include "config.h"
 #include "SVGAnimatedLength.h"
 
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
 #include "SVGAnimatedNumber.h"
 #include <wtf/NeverDestroyed.h>
 
index 3ebb842..7056b80 100644 (file)
@@ -20,7 +20,7 @@
 #include "config.h"
 #include "SVGAnimatedLengthList.h"
 
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
 #include "SVGAnimatedNumber.h"
 
 namespace WebCore {
index f983cf4..8bc23b2 100644 (file)
@@ -20,7 +20,7 @@
 #include "config.h"
 #include "SVGAnimatedNumber.h"
 
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
 #include "SVGParserUtilities.h"
 
 namespace WebCore {
index 6739276..40accda 100644 (file)
@@ -20,7 +20,7 @@
 #include "config.h"
 #include "SVGAnimatedNumberList.h"
 
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
 #include "SVGAnimatedNumber.h"
 
 namespace WebCore {
index 878f625..8b1032e 100644 (file)
@@ -20,7 +20,7 @@
 #include "config.h"
 #include "SVGAnimatedNumberOptionalNumber.h"
 
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
 #include "SVGAnimatedNumber.h"
 #include "SVGParserUtilities.h"
 
index 14c0354..e0a7310 100644 (file)
@@ -20,7 +20,7 @@
 #include "config.h"
 #include "SVGAnimatedPath.h"
 
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
 #include "SVGAnimatedPathSegListPropertyTearOff.h"
 #include "SVGPathUtilities.h"
 
index 0398036..fdadac1 100644 (file)
@@ -20,7 +20,7 @@
 #include "config.h"
 #include "SVGAnimatedPointList.h"
 
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
 #include "SVGParserUtilities.h"
 #include "SVGPointList.h"
 
index 45feda0..487f994 100644 (file)
@@ -20,7 +20,7 @@
 #include "config.h"
 #include "SVGAnimatedPreserveAspectRatio.h"
 
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
 
 namespace WebCore {
 
index cd420c6..21ff60c 100644 (file)
@@ -20,7 +20,7 @@
 #include "config.h"
 #include "SVGAnimatedRect.h"
 
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
 #include "SVGParserUtilities.h"
 
 namespace WebCore {
index 9dc3215..9d16061 100644 (file)
@@ -20,7 +20,7 @@
 #include "config.h"
 #include "SVGAnimatedString.h"
 
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
 
 namespace WebCore {
 
index d1f3589..00bc0b9 100644 (file)
@@ -507,8 +507,8 @@ void SVGAnimationElement::currentValuesForValuesAnimation(float percent, float&
     }
 
     CalcMode calcMode = this->calcMode();
-    if (hasTagName(SVGNames::animateTag) || hasTagName(SVGNames::animateColorTag)) {
-        AnimatedPropertyType attributeType = downcast<SVGAnimateElement>(*this).determineAnimatedPropertyType(targetElement());
+    if (is<SVGAnimateElement>(*this) || is<SVGAnimateColorElement>(*this)) {
+        AnimatedPropertyType attributeType = downcast<SVGAnimateElementBase>(*this).determineAnimatedPropertyType(targetElement());
         // Fall back to discrete animations for Strings.
         if (attributeType == AnimatedBoolean
             || attributeType == AnimatedEnumeration
index 9bdde62..d7915b6 100644 (file)
@@ -26,7 +26,7 @@
 namespace WebCore {
     
 inline SVGSetElement::SVGSetElement(const QualifiedName& tagName, Document& document)
-    : SVGAnimateElement(tagName, document)
+    : SVGAnimateElementBase(tagName, document)
 {
     setAnimationMode(ToAnimation);
     ASSERT(hasTagName(SVGNames::setTag));
index d702287..fb68e67 100644 (file)
 #ifndef SVGSetElement_h
 #define SVGSetElement_h
 
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
 
 namespace WebCore {
 
 // SVGAnimateElement implements superset of the functionality.
-class SVGSetElement final : public SVGAnimateElement {
+class SVGSetElement final : public SVGAnimateElementBase {
 public:
     static PassRefPtr<SVGSetElement> create(const QualifiedName&, Document&);
 
index b7708c1..efa5f50 100644 (file)
@@ -3,26 +3,26 @@ namespaceURI="http://www.w3.org/2000/svg"
 fallbackInterfaceName="SVGUnknownElement"
 fallbackJSInterfaceName="SVGElement"
 
-a generateTypeHelpers
+a
 #if ENABLE_SVG_FONTS
-altGlyph generateTypeHelpers
-altGlyphDef generateTypeHelpers
-altGlyphItem generateTypeHelpers
+altGlyph
+altGlyphDef
+altGlyphItem
 #endif
 animate
 animateColor
-animateMotion generateTypeHelpers
-animateTransform generateTypeHelpers
+animateMotion
+animateTransform
 set
-circle generateTypeHelpers
-clipPath generateTypeHelpers
+circle
+clipPath
 #if 0
 color_profile
 #endif
-cursor generateTypeHelpers
+cursor
 defs
 desc
-ellipse generateTypeHelpers
+ellipse
 feBlend
 feColorMatrix
 feComponentTransfer
@@ -30,69 +30,69 @@ feComposite
 feConvolveMatrix
 feDiffuseLighting
 feDisplacementMap
-feDistantLight generateTypeHelpers
+feDistantLight
 feDropShadow
 feFlood
-feFuncA generateTypeHelpers
-feFuncB generateTypeHelpers
-feFuncG generateTypeHelpers
-feFuncR generateTypeHelpers
+feFuncA
+feFuncB
+feFuncG
+feFuncR
 feGaussianBlur
 feImage
 feMerge
-feMergeNode generateTypeHelpers
+feMergeNode
 feMorphology
 feOffset
-fePointLight generateTypeHelpers
+fePointLight
 feSpecularLighting
-feSpotLight generateTypeHelpers
+feSpotLight
 feTile
 feTurbulence
-filter generateTypeHelpers
+filter
 #if ENABLE_SVG_FONTS
-font generateTypeHelpers
-font_face generateTypeHelpers
+font
+font_face
 font_face_format
-font_face_name generateTypeHelpers
-font_face_src generateTypeHelpers
-font_face_uri generateTypeHelpers
+font_face_name
+font_face_src
+font_face_uri
 #endif
-foreignObject generateTypeHelpers
-g generateTypeHelpers
+foreignObject
+g
 #if ENABLE_SVG_FONTS
-glyph generateTypeHelpers
-glyphRef generateTypeHelpers
-hkern interfaceName=SVGHKernElement, generateTypeHelpers
+glyph
+glyphRef
+hkern interfaceName=SVGHKernElement
 #endif
-image generateTypeHelpers
-line generateTypeHelpers
-linearGradient generateTypeHelpers
-marker generateTypeHelpers
-mask generateTypeHelpers
+image
+line
+linearGradient
+marker
+mask
 metadata
 #if ENABLE_SVG_FONTS
-missing_glyph generateTypeHelpers
+missing_glyph
 #endif
-mpath interfaceName=SVGMPathElement, generateTypeHelpers
-path generateTypeHelpers
-pattern generateTypeHelpers
-polygon generateTypeHelpers
-polyline generateTypeHelpers
-radialGradient generateTypeHelpers
-rect generateTypeHelpers
-script constructorNeedsCreatedByParser, generateTypeHelpers
-stop generateTypeHelpers
-style constructorNeedsCreatedByParser, generateTypeHelpers
-svg interfaceName=SVGSVGElement, generateTypeHelpers
+mpath interfaceName=SVGMPathElement
+path
+pattern
+polygon
+polyline
+radialGradient
+rect
+script constructorNeedsCreatedByParser
+stop
+style constructorNeedsCreatedByParser
+svg interfaceName=SVGSVGElement
 switch
 symbol
-text generateTypeHelpers
-textPath generateTypeHelpers
-title generateTypeHelpers
+text
+textPath
+title
 tref interfaceName=SVGTRefElement
 tspan interfaceName=SVGTSpanElement
-use constructorNeedsCreatedByParser, generateTypeHelpers
-view generateTypeHelpers
+use constructorNeedsCreatedByParser
+view
 #if ENABLE_SVG_FONTS
-vkern interfaceName=SVGVKernElement, generateTypeHelpers
+vkern interfaceName=SVGVKernElement
 #endif