Diff
Deleted: branches/chromium/1271/LayoutTests/svg/animations/animate-css-xml-attributeType-expected.txt (131773 => 131774)
--- branches/chromium/1271/LayoutTests/svg/animations/animate-css-xml-attributeType-expected.txt 2012-10-18 17:31:07 UTC (rev 131773)
+++ branches/chromium/1271/LayoutTests/svg/animations/animate-css-xml-attributeType-expected.txt 2012-10-18 17:42:54 UTC (rev 131774)
@@ -1,20 +0,0 @@
-SVG 1.1 dynamic animation tests
-
-Tests that XML and CSS attributeTypes can be switched between.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS rect.x.animVal.value is 100
-PASS rect.x.baseVal.value is 100
-PASS rect.x.animVal.value is 300
-PASS rect.x.animVal.value is 100
-PASS getComputedStyle(rect).getPropertyCSSValue('opacity').getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0.8
-PASS rect.x.animVal.value is 100
-PASS getComputedStyle(rect).getPropertyCSSValue('opacity').getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 1.0
-PASS rect.x.animVal.value is 200
-PASS rect.x.baseVal.value is 100
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
Deleted: branches/chromium/1271/LayoutTests/svg/animations/animate-css-xml-attributeType.html (131773 => 131774)
--- branches/chromium/1271/LayoutTests/svg/animations/animate-css-xml-attributeType.html 2012-10-18 17:31:07 UTC (rev 131773)
+++ branches/chromium/1271/LayoutTests/svg/animations/animate-css-xml-attributeType.html 2012-10-18 17:42:54 UTC (rev 131774)
@@ -1,14 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src=""
-<script src=""
-<script src=""
-</head>
-<body _onload_="runSMILTest()">
-<h1>SVG 1.1 dynamic animation tests</h1>
-<p id="description"></p>
-<div id="console"></div>
-<script src=""
-</body>
-</html>
Deleted: branches/chromium/1271/LayoutTests/svg/animations/invalid-css-attribute-crash-expected.svg (131773 => 131774)
--- branches/chromium/1271/LayoutTests/svg/animations/invalid-css-attribute-crash-expected.svg 2012-10-18 17:31:07 UTC (rev 131773)
+++ branches/chromium/1271/LayoutTests/svg/animations/invalid-css-attribute-crash-expected.svg 2012-10-18 17:42:54 UTC (rev 131774)
@@ -1,3 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg">
-<text x="5" y="20">This test passes if it does not CRASH.</text>
-</svg>
Deleted: branches/chromium/1271/LayoutTests/svg/animations/invalid-css-attribute-crash.svg (131773 => 131774)
--- branches/chromium/1271/LayoutTests/svg/animations/invalid-css-attribute-crash.svg 2012-10-18 17:31:07 UTC (rev 131773)
+++ branches/chromium/1271/LayoutTests/svg/animations/invalid-css-attribute-crash.svg 2012-10-18 17:42:54 UTC (rev 131774)
@@ -1,7 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg">
-<!-- Test for WK94569: Passes if there is no crash in animating non-CSS animations with attributeType=CSS. -->
-<text x="5" y="20">This test passes if it does not CRASH.</text>
-<feConvolveMatrix>
-<set attributeName="result" attributeType="CSS" to="inherit"></set>
-</feConvolveMatrix>
-</svg>
Deleted: branches/chromium/1271/LayoutTests/svg/animations/script-tests/animate-css-xml-attributeType.js (131773 => 131774)
--- branches/chromium/1271/LayoutTests/svg/animations/script-tests/animate-css-xml-attributeType.js 2012-10-18 17:31:07 UTC (rev 131773)
+++ branches/chromium/1271/LayoutTests/svg/animations/script-tests/animate-css-xml-attributeType.js 2012-10-18 17:42:54 UTC (rev 131774)
@@ -1,77 +0,0 @@
-description("Tests that XML and CSS attributeTypes can be switched between.");
-createSVGTestCase();
-
-// Setup test document
-var rect = createSVGElement("rect");
-rect.setAttribute("id", "rect");
-rect.setAttribute("x", "100");
-rect.setAttribute("width", "100");
-rect.setAttribute("height", "100");
-rect.setAttribute("fill", "green");
-rect.setAttribute("onclick", "executeTest()");
-
-var set = createSVGElement("set");
-set.setAttribute("id", "set");
-set.setAttribute("attributeName", "x");
-set.setAttribute("attributeType", "XML");
-set.setAttribute("to", "300");
-set.setAttribute("begin", "click");
-rect.appendChild(set);
-rootSVGElement.appendChild(rect);
-
-// Setup animation test
-function sample1() {
- shouldBeCloseEnough("rect.x.animVal.value", "100");
- shouldBe("rect.x.baseVal.value", "100");
-}
-
-function sample2() {
- shouldBeCloseEnough("rect.x.animVal.value", "300");
- // change the animationType to CSS which is invalid.
- set.setAttribute("attributeType", "CSS");
-}
-
-function sample3() {
- // verify that the animation resets.
- shouldBeCloseEnough("rect.x.animVal.value", "100");
- // change the animation to a CSS animatable value.
- set.setAttribute("attributeName", "opacity");
- set.setAttribute("to", "0.8");
-}
-
-function sample4() {
- shouldBeCloseEnough("getComputedStyle(rect).getPropertyCSSValue('opacity').getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0.8");
- // change the animation to a non-CSS animatable value.
- set.setAttribute("attributeName", "x");
- set.setAttribute("to", "200");
-}
-
-function sample5() {
- // verify that the animation does not run.
- shouldBeCloseEnough("rect.x.animVal.value", "100");
- shouldBeCloseEnough("getComputedStyle(rect).getPropertyCSSValue('opacity').getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "1.0");
- // change the animationType to XML which is valid.
- set.setAttribute("attributeType", "XML");
-}
-
-function sample6() {
- shouldBeCloseEnough("rect.x.animVal.value", "200");
- shouldBe("rect.x.baseVal.value", "100");
-}
-
-function executeTest() {
- const expectedValues = [
- // [animationId, time, sampleCallback]
- ["set", 0.0, sample1],
- ["set", 0.5, sample2],
- ["set", 1.0, sample3],
- ["set", 1.5, sample4],
- ["set", 2.0, sample5],
- ["set", 2.5, sample6]
- ];
-
- runAnimationTest(expectedValues);
-}
-
-window.clickX = 150;
-var successfullyParsed = true;
Modified: branches/chromium/1271/Source/WebCore/svg/SVGAnimateElement.cpp (131773 => 131774)
--- branches/chromium/1271/Source/WebCore/svg/SVGAnimateElement.cpp 2012-10-18 17:31:07 UTC (rev 131773)
+++ branches/chromium/1271/Source/WebCore/svg/SVGAnimateElement.cpp 2012-10-18 17:42:54 UTC (rev 131774)
@@ -56,8 +56,8 @@
SVGElement* targetElement = this->targetElement();
if (!targetElement)
return false;
-
- return m_animatedPropertyType != AnimatedUnknown && !hasInvalidCSSAttributeType();
+
+ return m_animatedPropertyType != AnimatedUnknown;
}
AnimatedPropertyType SVGAnimateElement::determineAnimatedPropertyType(SVGElement* targetElement) const
@@ -398,7 +398,7 @@
void SVGAnimateElement::targetElementWillChange(SVGElement* currentTarget, SVGElement* newTarget)
{
- SVGAnimationElement::targetElementWillChange(currentTarget, newTarget);
+ SVGSMILElement::targetElementWillChange(currentTarget, newTarget);
ASSERT(!m_animatedType);
m_fromType.clear();
Modified: branches/chromium/1271/Source/WebCore/svg/SVGAnimationElement.cpp (131773 => 131774)
--- branches/chromium/1271/Source/WebCore/svg/SVGAnimationElement.cpp 2012-10-18 17:31:07 UTC (rev 131773)
+++ branches/chromium/1271/Source/WebCore/svg/SVGAnimationElement.cpp 2012-10-18 17:42:54 UTC (rev 131774)
@@ -55,8 +55,6 @@
, m_fromPropertyValueType(RegularPropertyValue)
, m_toPropertyValueType(RegularPropertyValue)
, m_animationValid(false)
- , m_attributeType(AttributeTypeAuto)
- , m_hasInvalidCSSAttributeType(false)
{
registerAnimatedPropertiesForSVGAnimationElement();
}
@@ -147,7 +145,6 @@
supportedAttributes.add(SVGNames::keyTimesAttr);
supportedAttributes.add(SVGNames::keyPointsAttr);
supportedAttributes.add(SVGNames::keySplinesAttr);
- supportedAttributes.add(SVGNames::attributeTypeAttr);
}
return supportedAttributes.contains<QualifiedName, SVGAttributeHashTranslator>(attrName);
}
@@ -188,11 +185,6 @@
return;
}
- if (attribute.name() == SVGNames::attributeTypeAttr) {
- setAttributeType(attribute.value());
- return;
- }
-
if (SVGTests::parseAttribute(attribute))
return;
if (SVGExternalResourcesRequired::parseAttribute(attribute))
@@ -289,17 +281,16 @@
return hasTagName(SVGNames::animateMotionTag) ? CalcModePaced : CalcModeLinear;
}
-void SVGAnimationElement::setAttributeType(const AtomicString& attributeType)
-{
+SVGAnimationElement::AttributeType SVGAnimationElement::attributeType() const
+{
DEFINE_STATIC_LOCAL(const AtomicString, css, ("CSS"));
DEFINE_STATIC_LOCAL(const AtomicString, xml, ("XML"));
- if (attributeType == css)
- m_attributeType = AttributeTypeCSS;
- else if (attributeType == xml)
- m_attributeType = AttributeTypeXML;
- else
- m_attributeType = AttributeTypeAuto;
- checkInvalidCSSAttributeType(targetElement(DoNotResolveNewTarget));
+ const AtomicString& value = fastGetAttribute(SVGNames::attributeTypeAttr);
+ if (value == css)
+ return AttributeTypeCSS;
+ if (value == xml)
+ return AttributeTypeXML;
+ return AttributeTypeAuto;
}
String SVGAnimationElement::toValue() const
@@ -657,25 +648,6 @@
m_toPropertyValueType = InheritValue;
}
-void SVGAnimationElement::targetElementWillChange(SVGElement* currentTarget, SVGElement* newTarget)
-{
- SVGSMILElement::targetElementWillChange(currentTarget, newTarget);
-
- checkInvalidCSSAttributeType(newTarget);
}
-void SVGAnimationElement::setAttributeName(const QualifiedName& attributeName)
-{
- SVGSMILElement::setAttributeName(attributeName);
-
- checkInvalidCSSAttributeType(targetElement(DoNotResolveNewTarget));
-}
-
-void SVGAnimationElement::checkInvalidCSSAttributeType(SVGElement* target)
-{
- m_hasInvalidCSSAttributeType = target && hasValidAttributeName() && attributeType() == AttributeTypeCSS && !isTargetAttributeCSSProperty(target, attributeName());
-}
-
-}
-
#endif // ENABLE(SVG)
Modified: branches/chromium/1271/Source/WebCore/svg/SVGAnimationElement.h (131773 => 131774)
--- branches/chromium/1271/Source/WebCore/svg/SVGAnimationElement.h 2012-10-18 17:31:07 UTC (rev 131773)
+++ branches/chromium/1271/Source/WebCore/svg/SVGAnimationElement.h 2012-10-18 17:42:54 UTC (rev 131774)
@@ -183,7 +183,7 @@
AttributeTypeXML,
AttributeTypeAuto
};
- AttributeType attributeType() const { return m_attributeType; }
+ AttributeType attributeType() const;
String toValue() const;
String byValue() const;
@@ -198,16 +198,9 @@
AnimatedPropertyValueType m_fromPropertyValueType;
AnimatedPropertyValueType m_toPropertyValueType;
- virtual void targetElementWillChange(SVGElement* currentTarget, SVGElement* oldTarget) OVERRIDE;
- bool hasInvalidCSSAttributeType() const { return m_hasInvalidCSSAttributeType; }
-
private:
virtual void animationAttributeChanged() OVERRIDE;
- virtual void setAttributeName(const QualifiedName&) OVERRIDE;
- void setAttributeType(const AtomicString&);
- void checkInvalidCSSAttributeType(SVGElement*);
-
virtual bool calculateToAtEndOfDurationValue(const String& toAtEndOfDurationString) = 0;
virtual bool calculateFromAndToValues(const String& fromString, const String& toString) = 0;
virtual bool calculateFromAndByValues(const String& fromString, const String& byString) = 0;
@@ -237,14 +230,12 @@
bool m_animationValid;
- AttributeType m_attributeType;
Vector<String> m_values;
Vector<float> m_keyTimes;
Vector<float> m_keyPoints;
Vector<UnitBezier> m_keySplines;
String m_lastValuesAnimationFrom;
String m_lastValuesAnimationTo;
- bool m_hasInvalidCSSAttributeType;
};
} // namespace WebCore
Modified: branches/chromium/1271/Source/WebCore/svg/animation/SVGSMILElement.cpp (131773 => 131774)
--- branches/chromium/1271/Source/WebCore/svg/animation/SVGSMILElement.cpp 2012-10-18 17:31:07 UTC (rev 131773)
+++ branches/chromium/1271/Source/WebCore/svg/animation/SVGSMILElement.cpp 2012-10-18 17:42:54 UTC (rev 131774)
@@ -549,12 +549,12 @@
m_timeContainer->schedule(this);
}
-SVGElement* SVGSMILElement::targetElement(ResolveTarget resolveTarget)
+SVGElement* SVGSMILElement::targetElement()
{
if (m_targetElement)
return m_targetElement;
- if (!inDocument() || resolveTarget == DoNotResolveNewTarget)
+ if (!inDocument())
return 0;
String href = ""
Modified: branches/chromium/1271/Source/WebCore/svg/animation/SVGSMILElement.h (131773 => 131774)
--- branches/chromium/1271/Source/WebCore/svg/animation/SVGSMILElement.h 2012-10-18 17:31:07 UTC (rev 131773)
+++ branches/chromium/1271/Source/WebCore/svg/animation/SVGSMILElement.h 2012-10-18 17:42:54 UTC (rev 131774)
@@ -55,7 +55,7 @@
SMILTimeContainer* timeContainer() const { return m_timeContainer.get(); }
- SVGElement* targetElement(ResolveTarget = ResolveNewTarget);
+ SVGElement* targetElement();
void resetTargetElement();
const QualifiedName& attributeName() const { return m_attributeName; }
@@ -118,7 +118,6 @@
// Sub-classes may need to take action when the target is changed.
virtual void targetElementWillChange(SVGElement* currentTarget, SVGElement* newTarget);
- virtual void setAttributeName(const QualifiedName&);
private:
virtual void startedActiveInterval() = 0;