Title: [177166] trunk
- Revision
- 177166
- Author
- [email protected]
- Date
- 2014-12-11 11:35:13 -0800 (Thu, 11 Dec 2014)
Log Message
ASSERTION FAILED: animatedTypes[0].properties.size() == 1 in WebCore::SVGAnimatedTypeAnimator::constructFromBaseValue.
https://bugs.webkit.org/show_bug.cgi?id=139046.
Patch by Said Abou-Hallawa <[email protected]> on 2014-12-11
Reviewed by Dirk Schulze.
Source/WebCore:
Test: svg/animations/unsupported-animate-element-attributes.svg.
The SVG base animator element should not animate an attribute if it is not
supported by the target SVG element. Besides the CSS presentation attributes,
every SVG element defines which attributes can be animated by including them
between BEGIN_DECLARE_ANIMATED_PROPERTIES and END_DECLARE_ANIMATED_PROPERTIES
in the definition of the class. This definition builds attribute-properties map.
When restarting the animation, the animator looks for all the attributes that
match the animated attribute name. If the supported attribute-properties map
does not include the animated attribute name, an empty element-properties list
should be returned. When getting an empty element-properties list, the animator
should not start any animation for the unsupported attribute.
Do not start the animation if the animated attribute is not supported by
the target SVG element.
* svg/SVGAnimateElementBase.cpp:
(WebCore::SVGAnimateElementBase::resetAnimatedType):
Return an empty element-properties list if the animated attribute is not
supported by the target SVG element.
* svg/SVGAnimatedTypeAnimator.cpp:
(WebCore::SVGAnimatedTypeAnimator::findAnimatedPropertiesForAttributeName):
LayoutTests:
Ensure the animation attributes will be ignored by the SVG base animator if
they are not supported by the SVG target element.
* svg/animations/unsupported-animate-element-attributes-expected.svg: Added.
* svg/animations/unsupported-animate-element-attributes.svg: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (177165 => 177166)
--- trunk/LayoutTests/ChangeLog 2014-12-11 19:29:18 UTC (rev 177165)
+++ trunk/LayoutTests/ChangeLog 2014-12-11 19:35:13 UTC (rev 177166)
@@ -1,3 +1,16 @@
+2014-12-11 Said Abou-Hallawa <[email protected]>
+
+ ASSERTION FAILED: animatedTypes[0].properties.size() == 1 in WebCore::SVGAnimatedTypeAnimator::constructFromBaseValue.
+ https://bugs.webkit.org/show_bug.cgi?id=139046.
+
+ Reviewed by Dirk Schulze.
+
+ Ensure the animation attributes will be ignored by the SVG base animator if
+ they are not supported by the SVG target element.
+
+ * svg/animations/unsupported-animate-element-attributes-expected.svg: Added.
+ * svg/animations/unsupported-animate-element-attributes.svg: Added.
+
2014-12-10 Dean Jackson <[email protected]>
InstancedArray crashes attempting to draw out of bounds
Added: trunk/LayoutTests/svg/animations/unsupported-animate-element-attributes-expected.svg (0 => 177166)
--- trunk/LayoutTests/svg/animations/unsupported-animate-element-attributes-expected.svg (rev 0)
+++ trunk/LayoutTests/svg/animations/unsupported-animate-element-attributes-expected.svg 2014-12-11 19:35:13 UTC (rev 177166)
@@ -0,0 +1,13 @@
+<svg width="400" height="400"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink">
+ <defs>
+ <path id="MyPath" d="M 20 20 L 150 20"/>
+ </defs>
+
+ <text>
+ <textPath xlink:href=""
+ PASS.
+ </textPath>
+ </text>
+</svg>
Property changes on: trunk/LayoutTests/svg/animations/unsupported-animate-element-attributes-expected.svg
___________________________________________________________________
Added: svn:mime-type
Added: svn:keywords
Added: svn:eol-style
Added: trunk/LayoutTests/svg/animations/unsupported-animate-element-attributes.svg (0 => 177166)
--- trunk/LayoutTests/svg/animations/unsupported-animate-element-attributes.svg (rev 0)
+++ trunk/LayoutTests/svg/animations/unsupported-animate-element-attributes.svg 2014-12-11 19:35:13 UTC (rev 177166)
@@ -0,0 +1,14 @@
+<svg width="400" height="400"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink">
+ <defs>
+ <path id="MyPath" d="M 20 20 L 150 20"/>
+ </defs>
+
+ <text>
+ <textPath xlink:href=""
+ <animate attributeName="x"/>
+ PASS.
+ </textPath>
+ </text>
+</svg>
Property changes on: trunk/LayoutTests/svg/animations/unsupported-animate-element-attributes.svg
___________________________________________________________________
Added: svn:mime-type
Added: svn:keywords
Added: svn:eol-style
Modified: trunk/Source/WebCore/ChangeLog (177165 => 177166)
--- trunk/Source/WebCore/ChangeLog 2014-12-11 19:29:18 UTC (rev 177165)
+++ trunk/Source/WebCore/ChangeLog 2014-12-11 19:35:13 UTC (rev 177166)
@@ -1,3 +1,33 @@
+2014-12-11 Said Abou-Hallawa <[email protected]>
+
+ ASSERTION FAILED: animatedTypes[0].properties.size() == 1 in WebCore::SVGAnimatedTypeAnimator::constructFromBaseValue.
+ https://bugs.webkit.org/show_bug.cgi?id=139046.
+
+ Reviewed by Dirk Schulze.
+
+ Test: svg/animations/unsupported-animate-element-attributes.svg.
+
+ The SVG base animator element should not animate an attribute if it is not
+ supported by the target SVG element. Besides the CSS presentation attributes,
+ every SVG element defines which attributes can be animated by including them
+ between BEGIN_DECLARE_ANIMATED_PROPERTIES and END_DECLARE_ANIMATED_PROPERTIES
+ in the definition of the class. This definition builds attribute-properties map.
+ When restarting the animation, the animator looks for all the attributes that
+ match the animated attribute name. If the supported attribute-properties map
+ does not include the animated attribute name, an empty element-properties list
+ should be returned. When getting an empty element-properties list, the animator
+ should not start any animation for the unsupported attribute.
+
+ Do not start the animation if the animated attribute is not supported by
+ the target SVG element.
+ * svg/SVGAnimateElementBase.cpp:
+ (WebCore::SVGAnimateElementBase::resetAnimatedType):
+
+ Return an empty element-properties list if the animated attribute is not
+ supported by the target SVG element.
+ * svg/SVGAnimatedTypeAnimator.cpp:
+ (WebCore::SVGAnimatedTypeAnimator::findAnimatedPropertiesForAttributeName):
+
2014-12-10 Dean Jackson <[email protected]>
InstancedArray crashes attempting to draw out of bounds
Modified: trunk/Source/WebCore/svg/SVGAnimateElementBase.cpp (177165 => 177166)
--- trunk/Source/WebCore/svg/SVGAnimateElementBase.cpp 2014-12-11 19:29:18 UTC (rev 177165)
+++ trunk/Source/WebCore/svg/SVGAnimateElementBase.cpp 2014-12-11 19:35:13 UTC (rev 177166)
@@ -205,7 +205,8 @@
if (shouldApply == ApplyXMLAnimation || shouldApply == ApplyXMLandCSSAnimation) {
// SVG DOM animVal animation code-path.
m_animatedProperties = animator->findAnimatedPropertiesForAttributeName(targetElement, attributeName);
- ASSERT(!m_animatedProperties.isEmpty());
+ if (m_animatedProperties.isEmpty())
+ return;
ASSERT(propertyTypesAreConsistent(m_animatedPropertyType, m_animatedProperties));
if (!m_animatedType)
Modified: trunk/Source/WebCore/svg/SVGAnimatedTypeAnimator.cpp (177165 => 177166)
--- trunk/Source/WebCore/svg/SVGAnimatedTypeAnimator.cpp 2014-12-11 19:29:18 UTC (rev 177165)
+++ trunk/Source/WebCore/svg/SVGAnimatedTypeAnimator.cpp 2014-12-11 19:35:13 UTC (rev 177166)
@@ -68,7 +68,7 @@
Vector<RefPtr<SVGAnimatedProperty>> targetProperties;
targetElement->localAttributeToPropertyMap().animatedPropertiesForAttribute(targetElement, attributeName, targetProperties);
- if (!SVGAnimatedType::supportsAnimVal(m_type))
+ if (!SVGAnimatedType::supportsAnimVal(m_type) || targetProperties.isEmpty())
return SVGElementAnimatedPropertyList();
SVGElementAnimatedProperties propertiesPair(targetElement, targetProperties);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes