Changeset 179772 in webkit
- Timestamp:
- Feb 6, 2015, 5:24:48 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/svg/animations/animate-montion-invalid-attribute-expected.svg (added)
-
LayoutTests/svg/animations/animate-montion-invalid-attribute.svg (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/svg/SVGAnimateElementBase.cpp (modified) (1 diff)
-
Source/WebCore/svg/SVGAnimationElement.cpp (modified) (1 diff)
-
Source/WebCore/svg/SVGAnimationElement.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r179771 r179772 1 2015-02-06 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 Invalid cast in WebCore::SVGAnimateElement::calculateAnimatedValue. 4 https://bugs.webkit.org/show_bug.cgi?id=135171. 5 6 Reviewed by Dean Jackson. 7 8 * svg/animations/animate-montion-invalid-attribute-expected.svg: Added. 9 * svg/animations/animate-montion-invalid-attribute.svg: Added. 10 Make sure that adding the same attribute to <animateMotion> and <animate>, which both 11 animate the same target element, will be ignored and we won't crash. 12 1 13 2015-02-06 Simon Fraser <simon.fraser@apple.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r179771 r179772 1 2015-02-06 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 Invalid cast in WebCore::SVGAnimateElement::calculateAnimatedValue. 4 https://bugs.webkit.org/show_bug.cgi?id=135171. 5 6 Reviewed by Dean Jackson. 7 8 The bug happens when an SVG element is animated by <animateMotion> followed by an 9 <animateColor> or an <animate> and the values of the "attributeName" in both elements 10 are the same. The problem is <animateMotion> should not have an attribute to animate. 11 If it does by fuzz or by mistake, then we assume the <animateMotion> and the <animate> 12 animate the same attribute for the same element target. Therefore we schedule them in 13 the same AnimationVector in SMILTimeContainer::schedule(). When we call 14 SVGAnimateElementBase::calculateAnimatedValue() for an SVGAnimateColorElement and the 15 resultElement is SVGAnimateMotionElement, we fail to cast it to SVGAnimateElementBase 16 because SVGAnimateMotionElement is derived from SVGAnimationElement which is the base 17 class of all animate elements including SVGAnimateElementBase. 18 19 The fix is to nullify setting "attributeName" of an SVGAnimationElement. By doing so, 20 "attributeName" and its value will be ignored from the <animateMotion> which is correct. 21 22 Tests: svg/animations/animate-montion-invalid-attribute.svg. 23 24 * svg/SVGAnimateElementBase.cpp: 25 (WebCore::SVGAnimateElementBase::setAttributeName): 26 Do not call SVGAnimationElement::setAttributeName() since SVGAnimationElement should 27 not have an attribute to animate. We prevent this by bypassing the parent in the class 28 hierarchy: SVGAnimationElement and calling SVGSMILElement::setAttributeName() directly. 29 30 * svg/SVGAnimationElement.cpp: 31 (WebCore::SVGAnimationElement::setAttributeName): Deleted. 32 * svg/SVGAnimationElement.h: 33 SVGAnimationElement should not have an attribute to animate. So implement its 34 setAttributeName() as a null function. 35 1 36 2015-02-06 Simon Fraser <simon.fraser@apple.com> 2 37 -
trunk/Source/WebCore/svg/SVGAnimateElementBase.cpp
r179695 r179772 425 425 void SVGAnimateElementBase::setAttributeName(const QualifiedName& attributeName) 426 426 { 427 SVGAnimationElement::setAttributeName(attributeName); 427 SVGSMILElement::setAttributeName(attributeName); 428 checkInvalidCSSAttributeType(targetElement()); 428 429 resetAnimatedPropertyType(); 429 430 } -
trunk/Source/WebCore/svg/SVGAnimationElement.cpp
r179260 r179772 692 692 } 693 693 694 void SVGAnimationElement::setAttributeName(const QualifiedName& attributeName)695 {696 SVGSMILElement::setAttributeName(attributeName);697 checkInvalidCSSAttributeType(targetElement());698 }699 700 694 void SVGAnimationElement::checkInvalidCSSAttributeType(SVGElement* target) 701 695 { -
trunk/Source/WebCore/svg/SVGAnimationElement.h
r171341 r179772 195 195 196 196 virtual void setTargetElement(SVGElement*) override; 197 virtual void setAttributeName(const QualifiedName&) override ;197 virtual void setAttributeName(const QualifiedName&) override { } 198 198 bool hasInvalidCSSAttributeType() const { return m_hasInvalidCSSAttributeType; } 199 void checkInvalidCSSAttributeType(SVGElement*); 199 200 200 201 virtual void updateAnimationMode(); … … 205 206 virtual void animationAttributeChanged() override; 206 207 void setAttributeType(const AtomicString&); 207 208 void checkInvalidCSSAttributeType(SVGElement*);209 208 210 209 virtual bool calculateToAtEndOfDurationValue(const String& toAtEndOfDurationString) = 0;
Note:
See TracChangeset
for help on using the changeset viewer.