Diff
Modified: trunk/Source/WebCore/CMakeLists.txt (174049 => 174050)
--- trunk/Source/WebCore/CMakeLists.txt 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/CMakeLists.txt 2014-09-29 02:13:41 UTC (rev 174050)
@@ -2521,6 +2521,7 @@
svg/SVGAltGlyphItemElement.cpp
svg/SVGAngle.cpp
svg/SVGAnimateColorElement.cpp
+ svg/SVGAnimateElementBase.cpp
svg/SVGAnimateElement.cpp
svg/SVGAnimateMotionElement.cpp
svg/SVGAnimateTransformElement.cpp
Modified: trunk/Source/WebCore/ChangeLog (174049 => 174050)
--- trunk/Source/WebCore/ChangeLog 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/ChangeLog 2014-09-29 02:13:41 UTC (rev 174050)
@@ -1,3 +1,119 @@
+2014-09-28 Christophe Dumez <[email protected]>
+
+ 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 <[email protected]>
Use std::unique_ptr for ContextMenuController
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (174049 => 174050)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2014-09-29 02:13:41 UTC (rev 174050)
@@ -2476,6 +2476,8 @@
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 */; };
@@ -9627,6 +9629,8 @@
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>"; };
@@ -19780,6 +19784,8 @@
439D334013A6911C00C20F4F /* SVGAnimatedType.h */,
836FBCE9178C113200B21A15 /* SVGAnimatedTypeAnimator.cpp */,
439D334113A6911C00C20F4F /* SVGAnimatedTypeAnimator.h */,
+ 832B843519D8E57400B26055 /* SVGAnimateElementBase.cpp */,
+ 832B843319D8E55100B26055 /* SVGAnimateElementBase.h */,
B22277F90D00BF1F0071B782 /* SVGAnimateElement.cpp */,
B22277FA0D00BF1F0071B782 /* SVGAnimateElement.h */,
B22277FB0D00BF1F0071B782 /* SVGAnimateElement.idl */,
@@ -23856,6 +23862,7 @@
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 */,
@@ -27370,6 +27377,7 @@
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 */,
Modified: trunk/Source/WebCore/dom/make_names.pl (174049 => 174050)
--- trunk/Source/WebCore/dom/make_names.pl 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/dom/make_names.pl 2014-09-29 02:13:41 UTC (rev 174050)
@@ -194,7 +194,6 @@
'wrapperOnlyIfMediaIsAvailable' => 0,
'conditional' => 0,
'runtimeConditional' => 0,
- 'generateTypeHelpers' => 0
);
}
@@ -627,12 +626,18 @@
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;
+ }
- my $class = $parsedTags{$name}{interfaceName};
+ 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>
Modified: trunk/Source/WebCore/html/HTMLTagNames.in (174049 => 174050)
--- trunk/Source/WebCore/html/HTMLTagNames.in 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/html/HTMLTagNames.in 2014-09-29 02:13:41 UTC (rev 174050)
@@ -3,28 +3,28 @@
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 @@
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 @@
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
Modified: trunk/Source/WebCore/mathml/mathtags.in (174049 => 174050)
--- trunk/Source/WebCore/mathml/mathtags.in 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/mathml/mathtags.in 2014-09-29 02:13:41 UTC (rev 174050)
@@ -6,7 +6,7 @@
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 @@
mtd interfaceName=MathMLElement
mmultiscripts interfaceName=MathMLInlineContainerElement
mprescripts interfaceName=MathMLInlineContainerElement
-menclose interfaceName=MathMLMencloseElement, generateTypeHelpers
+menclose interfaceName=MathMLMencloseElement
none interfaceName=MathMLInlineContainerElement
semantics interfaceName=MathMLSelectElement
Modified: trunk/Source/WebCore/svg/SVGAllInOne.cpp (174049 => 174050)
--- trunk/Source/WebCore/svg/SVGAllInOne.cpp 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/svg/SVGAllInOne.cpp 2014-09-29 02:13:41 UTC (rev 174050)
@@ -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"
Modified: trunk/Source/WebCore/svg/SVGAnimateColorElement.cpp (174049 => 174050)
--- trunk/Source/WebCore/svg/SVGAnimateColorElement.cpp 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/svg/SVGAnimateColorElement.cpp 2014-09-29 02:13:41 UTC (rev 174050)
@@ -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 @@
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))
Modified: trunk/Source/WebCore/svg/SVGAnimateColorElement.h (174049 => 174050)
--- trunk/Source/WebCore/svg/SVGAnimateColorElement.h 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/svg/SVGAnimateColorElement.h 2014-09-29 02:13:41 UTC (rev 174050)
@@ -22,11 +22,11 @@
#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&);
Modified: trunk/Source/WebCore/svg/SVGAnimateElement.cpp (174049 => 174050)
--- trunk/Source/WebCore/svg/SVGAnimateElement.cpp 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/svg/SVGAnimateElement.cpp 2014-09-29 02:13:41 UTC (rev 174050)
@@ -1,45 +1,37 @@
/*
- * Copyright (C) 2004, 2005 Nikolas Zimmermann <[email protected]>
- * Copyright (C) 2004, 2005, 2006 Rob Buis <[email protected]>
- * 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 @@
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
Modified: trunk/Source/WebCore/svg/SVGAnimateElement.h (174049 => 174050)
--- trunk/Source/WebCore/svg/SVGAnimateElement.h 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/svg/SVGAnimateElement.h 2014-09-29 02:13:41 UTC (rev 174050)
@@ -1,88 +1,45 @@
/*
- * Copyright (C) 2004, 2005 Nikolas Zimmermann <[email protected]>
- * Copyright (C) 2004, 2005 Rob Buis <[email protected]>
- * 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
Copied: trunk/Source/WebCore/svg/SVGAnimateElementBase.cpp (from rev 174049, trunk/Source/WebCore/svg/SVGAnimateElement.cpp) (0 => 174050)
--- trunk/Source/WebCore/svg/SVGAnimateElementBase.cpp (rev 0)
+++ trunk/Source/WebCore/svg/SVGAnimateElementBase.cpp 2014-09-29 02:13:41 UTC (rev 174050)
@@ -0,0 +1,458 @@
+/*
+ * Copyright (C) 2004, 2005 Nikolas Zimmermann <[email protected]>
+ * Copyright (C) 2004, 2005, 2006 Rob Buis <[email protected]>
+ * 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
Copied: trunk/Source/WebCore/svg/SVGAnimateElementBase.h (from rev 174049, trunk/Source/WebCore/svg/SVGAnimateElement.h) (0 => 174050)
--- trunk/Source/WebCore/svg/SVGAnimateElementBase.h (rev 0)
+++ trunk/Source/WebCore/svg/SVGAnimateElementBase.h 2014-09-29 02:13:41 UTC (rev 174050)
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2004, 2005 Nikolas Zimmermann <[email protected]>
+ * Copyright (C) 2004, 2005, 2006 Rob Buis <[email protected]>
+ * 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
Modified: trunk/Source/WebCore/svg/SVGAnimateTransformElement.cpp (174049 => 174050)
--- trunk/Source/WebCore/svg/SVGAnimateTransformElement.cpp 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/svg/SVGAnimateTransformElement.cpp 2014-09-29 02:13:41 UTC (rev 174050)
@@ -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 @@
void SVGAnimateTransformElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
if (!isSupportedAttribute(name)) {
- SVGAnimateElement::parseAttribute(name, value);
+ SVGAnimateElementBase::parseAttribute(name, value);
return;
}
Modified: trunk/Source/WebCore/svg/SVGAnimateTransformElement.h (174049 => 174050)
--- trunk/Source/WebCore/svg/SVGAnimateTransformElement.h 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/svg/SVGAnimateTransformElement.h 2014-09-29 02:13:41 UTC (rev 174050)
@@ -23,14 +23,14 @@
#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&);
Modified: trunk/Source/WebCore/svg/SVGAnimatedAngle.cpp (174049 => 174050)
--- trunk/Source/WebCore/svg/SVGAnimatedAngle.cpp 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/svg/SVGAnimatedAngle.cpp 2014-09-29 02:13:41 UTC (rev 174050)
@@ -20,7 +20,7 @@
#include "config.h"
#include "SVGAnimatedAngle.h"
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
#include "SVGMarkerElement.h"
namespace WebCore {
Modified: trunk/Source/WebCore/svg/SVGAnimatedBoolean.cpp (174049 => 174050)
--- trunk/Source/WebCore/svg/SVGAnimatedBoolean.cpp 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/svg/SVGAnimatedBoolean.cpp 2014-09-29 02:13:41 UTC (rev 174050)
@@ -20,7 +20,7 @@
#include "config.h"
#include "SVGAnimatedBoolean.h"
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
namespace WebCore {
Modified: trunk/Source/WebCore/svg/SVGAnimatedColor.cpp (174049 => 174050)
--- trunk/Source/WebCore/svg/SVGAnimatedColor.cpp 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/svg/SVGAnimatedColor.cpp 2014-09-29 02:13:41 UTC (rev 174050)
@@ -22,7 +22,7 @@
#include "ColorDistance.h"
#include "RenderElement.h"
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
#include "SVGColor.h"
namespace WebCore {
Modified: trunk/Source/WebCore/svg/SVGAnimatedInteger.cpp (174049 => 174050)
--- trunk/Source/WebCore/svg/SVGAnimatedInteger.cpp 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/svg/SVGAnimatedInteger.cpp 2014-09-29 02:13:41 UTC (rev 174050)
@@ -20,7 +20,7 @@
#include "config.h"
#include "SVGAnimatedInteger.h"
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
#include "SVGAnimatedNumber.h"
#include <wtf/MathExtras.h>
Modified: trunk/Source/WebCore/svg/SVGAnimatedIntegerOptionalInteger.cpp (174049 => 174050)
--- trunk/Source/WebCore/svg/SVGAnimatedIntegerOptionalInteger.cpp 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/svg/SVGAnimatedIntegerOptionalInteger.cpp 2014-09-29 02:13:41 UTC (rev 174050)
@@ -20,7 +20,7 @@
#include "config.h"
#include "SVGAnimatedIntegerOptionalInteger.h"
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
#include "SVGAnimatedInteger.h"
#include "SVGParserUtilities.h"
Modified: trunk/Source/WebCore/svg/SVGAnimatedLength.cpp (174049 => 174050)
--- trunk/Source/WebCore/svg/SVGAnimatedLength.cpp 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/svg/SVGAnimatedLength.cpp 2014-09-29 02:13:41 UTC (rev 174050)
@@ -20,7 +20,7 @@
#include "config.h"
#include "SVGAnimatedLength.h"
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
#include "SVGAnimatedNumber.h"
#include <wtf/NeverDestroyed.h>
Modified: trunk/Source/WebCore/svg/SVGAnimatedLengthList.cpp (174049 => 174050)
--- trunk/Source/WebCore/svg/SVGAnimatedLengthList.cpp 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/svg/SVGAnimatedLengthList.cpp 2014-09-29 02:13:41 UTC (rev 174050)
@@ -20,7 +20,7 @@
#include "config.h"
#include "SVGAnimatedLengthList.h"
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
#include "SVGAnimatedNumber.h"
namespace WebCore {
Modified: trunk/Source/WebCore/svg/SVGAnimatedNumber.cpp (174049 => 174050)
--- trunk/Source/WebCore/svg/SVGAnimatedNumber.cpp 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/svg/SVGAnimatedNumber.cpp 2014-09-29 02:13:41 UTC (rev 174050)
@@ -20,7 +20,7 @@
#include "config.h"
#include "SVGAnimatedNumber.h"
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
#include "SVGParserUtilities.h"
namespace WebCore {
Modified: trunk/Source/WebCore/svg/SVGAnimatedNumberList.cpp (174049 => 174050)
--- trunk/Source/WebCore/svg/SVGAnimatedNumberList.cpp 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/svg/SVGAnimatedNumberList.cpp 2014-09-29 02:13:41 UTC (rev 174050)
@@ -20,7 +20,7 @@
#include "config.h"
#include "SVGAnimatedNumberList.h"
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
#include "SVGAnimatedNumber.h"
namespace WebCore {
Modified: trunk/Source/WebCore/svg/SVGAnimatedNumberOptionalNumber.cpp (174049 => 174050)
--- trunk/Source/WebCore/svg/SVGAnimatedNumberOptionalNumber.cpp 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/svg/SVGAnimatedNumberOptionalNumber.cpp 2014-09-29 02:13:41 UTC (rev 174050)
@@ -20,7 +20,7 @@
#include "config.h"
#include "SVGAnimatedNumberOptionalNumber.h"
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
#include "SVGAnimatedNumber.h"
#include "SVGParserUtilities.h"
Modified: trunk/Source/WebCore/svg/SVGAnimatedPath.cpp (174049 => 174050)
--- trunk/Source/WebCore/svg/SVGAnimatedPath.cpp 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/svg/SVGAnimatedPath.cpp 2014-09-29 02:13:41 UTC (rev 174050)
@@ -20,7 +20,7 @@
#include "config.h"
#include "SVGAnimatedPath.h"
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
#include "SVGAnimatedPathSegListPropertyTearOff.h"
#include "SVGPathUtilities.h"
Modified: trunk/Source/WebCore/svg/SVGAnimatedPointList.cpp (174049 => 174050)
--- trunk/Source/WebCore/svg/SVGAnimatedPointList.cpp 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/svg/SVGAnimatedPointList.cpp 2014-09-29 02:13:41 UTC (rev 174050)
@@ -20,7 +20,7 @@
#include "config.h"
#include "SVGAnimatedPointList.h"
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
#include "SVGParserUtilities.h"
#include "SVGPointList.h"
Modified: trunk/Source/WebCore/svg/SVGAnimatedPreserveAspectRatio.cpp (174049 => 174050)
--- trunk/Source/WebCore/svg/SVGAnimatedPreserveAspectRatio.cpp 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/svg/SVGAnimatedPreserveAspectRatio.cpp 2014-09-29 02:13:41 UTC (rev 174050)
@@ -20,7 +20,7 @@
#include "config.h"
#include "SVGAnimatedPreserveAspectRatio.h"
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
namespace WebCore {
Modified: trunk/Source/WebCore/svg/SVGAnimatedRect.cpp (174049 => 174050)
--- trunk/Source/WebCore/svg/SVGAnimatedRect.cpp 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/svg/SVGAnimatedRect.cpp 2014-09-29 02:13:41 UTC (rev 174050)
@@ -20,7 +20,7 @@
#include "config.h"
#include "SVGAnimatedRect.h"
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
#include "SVGParserUtilities.h"
namespace WebCore {
Modified: trunk/Source/WebCore/svg/SVGAnimatedString.cpp (174049 => 174050)
--- trunk/Source/WebCore/svg/SVGAnimatedString.cpp 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/svg/SVGAnimatedString.cpp 2014-09-29 02:13:41 UTC (rev 174050)
@@ -20,7 +20,7 @@
#include "config.h"
#include "SVGAnimatedString.h"
-#include "SVGAnimateElement.h"
+#include "SVGAnimateElementBase.h"
namespace WebCore {
Modified: trunk/Source/WebCore/svg/SVGAnimationElement.cpp (174049 => 174050)
--- trunk/Source/WebCore/svg/SVGAnimationElement.cpp 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/svg/SVGAnimationElement.cpp 2014-09-29 02:13:41 UTC (rev 174050)
@@ -507,8 +507,8 @@
}
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
Modified: trunk/Source/WebCore/svg/SVGSetElement.cpp (174049 => 174050)
--- trunk/Source/WebCore/svg/SVGSetElement.cpp 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/svg/SVGSetElement.cpp 2014-09-29 02:13:41 UTC (rev 174050)
@@ -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));
Modified: trunk/Source/WebCore/svg/SVGSetElement.h (174049 => 174050)
--- trunk/Source/WebCore/svg/SVGSetElement.h 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/svg/SVGSetElement.h 2014-09-29 02:13:41 UTC (rev 174050)
@@ -21,12 +21,12 @@
#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&);
Modified: trunk/Source/WebCore/svg/svgtags.in (174049 => 174050)
--- trunk/Source/WebCore/svg/svgtags.in 2014-09-29 01:52:42 UTC (rev 174049)
+++ trunk/Source/WebCore/svg/svgtags.in 2014-09-29 02:13:41 UTC (rev 174050)
@@ -3,26 +3,26 @@
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 @@
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