Title: [112231] trunk
Revision
112231
Author
zimmerm...@webkit.org
Date
2012-03-27 02:29:18 -0700 (Tue, 27 Mar 2012)

Log Message

Enable animVal support for SVGAnimatedBoolean
https://bugs.webkit.org/show_bug.cgi?id=82311

Reviewed by Antti Koivisto.

Source/WebCore:

Enable animVal support for SVGAnimatedBoolean. Very simple now that everything is prepared.
All we have to do is add startAnimValAnimation/etc. methods to SVGAnimatedBooleanAnimator.

Extended existing tests to cover this.

* svg/SVGAnimatedBoolean.cpp:
(WebCore::SVGAnimatedBooleanAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedBooleanAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedBooleanAnimator::resetAnimValToBaseVal):
(WebCore::SVGAnimatedBooleanAnimator::animValWillChange):
(WebCore::SVGAnimatedBooleanAnimator::animValDidChange):
* svg/SVGAnimatedBoolean.h:
(SVGAnimatedBooleanAnimator):
* svg/SVGAnimatedType.cpp:
(WebCore::SVGAnimatedType::setValueAsString):
(WebCore::SVGAnimatedType::supportsAnimVal):

LayoutTests:

Extend SVGAnimatedBoolean tests to cover animVal support.

* svg/animations/script-tests/svgboolean-animation-1.js:
(sample1):
(sample2):
(sample3):
* svg/animations/svgboolean-animation-1-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (112230 => 112231)


--- trunk/LayoutTests/ChangeLog	2012-03-27 09:27:44 UTC (rev 112230)
+++ trunk/LayoutTests/ChangeLog	2012-03-27 09:29:18 UTC (rev 112231)
@@ -1,3 +1,18 @@
+2012-03-27  Nikolas Zimmermann  <nzimmerm...@rim.com>
+
+        Enable animVal support for SVGAnimatedBoolean
+        https://bugs.webkit.org/show_bug.cgi?id=82311
+
+        Reviewed by Antti Koivisto.
+
+        Extend SVGAnimatedBoolean tests to cover animVal support.
+
+        * svg/animations/script-tests/svgboolean-animation-1.js:
+        (sample1):
+        (sample2):
+        (sample3):
+        * svg/animations/svgboolean-animation-1-expected.txt:
+
 2012-03-27  Philippe Normand  <pnorm...@igalia.com>
 
         Unreviewed, skip an inspector test failing on 64-bit Debug GTK bot.

Modified: trunk/LayoutTests/svg/animations/script-tests/svgboolean-animation-1.js (112230 => 112231)


--- trunk/LayoutTests/svg/animations/script-tests/svgboolean-animation-1.js	2012-03-27 09:27:44 UTC (rev 112230)
+++ trunk/LayoutTests/svg/animations/script-tests/svgboolean-animation-1.js	2012-03-27 09:29:18 UTC (rev 112231)
@@ -36,14 +36,17 @@
 // Setup animation test
 function sample1() {
     shouldBe("feConvolveMatrix.preserveAlpha.animVal", "false");
+    shouldBe("feConvolveMatrix.preserveAlpha.baseVal", "false");
 }
 
 function sample2() {
     shouldBe("feConvolveMatrix.preserveAlpha.animVal", "false");
+    shouldBe("feConvolveMatrix.preserveAlpha.baseVal", "false");
 }
 
 function sample3() {
     shouldBe("feConvolveMatrix.preserveAlpha.animVal", "true");
+    shouldBe("feConvolveMatrix.preserveAlpha.baseVal", "false");
 }
 
 function executeTest() {

Modified: trunk/LayoutTests/svg/animations/svgboolean-animation-1-expected.txt (112230 => 112231)


--- trunk/LayoutTests/svg/animations/svgboolean-animation-1-expected.txt	2012-03-27 09:27:44 UTC (rev 112230)
+++ trunk/LayoutTests/svg/animations/svgboolean-animation-1-expected.txt	2012-03-27 09:29:18 UTC (rev 112231)
@@ -6,9 +6,13 @@
 
 
 PASS feConvolveMatrix.preserveAlpha.animVal is false
+PASS feConvolveMatrix.preserveAlpha.baseVal is false
 PASS feConvolveMatrix.preserveAlpha.animVal is false
+PASS feConvolveMatrix.preserveAlpha.baseVal is false
 PASS feConvolveMatrix.preserveAlpha.animVal is true
+PASS feConvolveMatrix.preserveAlpha.baseVal is false
 PASS feConvolveMatrix.preserveAlpha.animVal is false
+PASS feConvolveMatrix.preserveAlpha.baseVal is false
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/Source/WebCore/ChangeLog (112230 => 112231)


--- trunk/Source/WebCore/ChangeLog	2012-03-27 09:27:44 UTC (rev 112230)
+++ trunk/Source/WebCore/ChangeLog	2012-03-27 09:29:18 UTC (rev 112231)
@@ -1,5 +1,29 @@
 2012-03-27  Nikolas Zimmermann  <nzimmerm...@rim.com>
 
+        Enable animVal support for SVGAnimatedBoolean
+        https://bugs.webkit.org/show_bug.cgi?id=82311
+
+        Reviewed by Antti Koivisto.
+
+        Enable animVal support for SVGAnimatedBoolean. Very simple now that everything is prepared.
+        All we have to do is add startAnimValAnimation/etc. methods to SVGAnimatedBooleanAnimator.
+
+        Extended existing tests to cover this.
+
+        * svg/SVGAnimatedBoolean.cpp:
+        (WebCore::SVGAnimatedBooleanAnimator::startAnimValAnimation):
+        (WebCore::SVGAnimatedBooleanAnimator::stopAnimValAnimation):
+        (WebCore::SVGAnimatedBooleanAnimator::resetAnimValToBaseVal):
+        (WebCore::SVGAnimatedBooleanAnimator::animValWillChange):
+        (WebCore::SVGAnimatedBooleanAnimator::animValDidChange):
+        * svg/SVGAnimatedBoolean.h:
+        (SVGAnimatedBooleanAnimator):
+        * svg/SVGAnimatedType.cpp:
+        (WebCore::SVGAnimatedType::setValueAsString):
+        (WebCore::SVGAnimatedType::supportsAnimVal):
+
+2012-03-27  Nikolas Zimmermann  <nzimmerm...@rim.com>
+
         <img style='width: 100%' src=''> gets pixellated when stretched
         https://bugs.webkit.org/show_bug.cgi?id=81631
 

Modified: trunk/Source/WebCore/svg/SVGAnimatedBoolean.cpp (112230 => 112231)


--- trunk/Source/WebCore/svg/SVGAnimatedBoolean.cpp	2012-03-27 09:27:44 UTC (rev 112230)
+++ trunk/Source/WebCore/svg/SVGAnimatedBoolean.cpp	2012-03-27 09:29:18 UTC (rev 112231)
@@ -39,6 +39,31 @@
     return animtedType.release();
 }
 
+PassOwnPtr<SVGAnimatedType> SVGAnimatedBooleanAnimator::startAnimValAnimation(const Vector<SVGAnimatedProperty*>& properties)
+{
+    return SVGAnimatedType::createBoolean(constructFromOneBaseValue<bool, SVGAnimatedBoolean>(properties));
+}
+
+void SVGAnimatedBooleanAnimator::stopAnimValAnimation(const Vector<SVGAnimatedProperty*>& properties)
+{
+    SVGAnimatedTypeAnimator::stopAnimValAnimationForType<SVGAnimatedBoolean>(properties);
+}
+
+void SVGAnimatedBooleanAnimator::resetAnimValToBaseVal(const Vector<SVGAnimatedProperty*>& properties, SVGAnimatedType* type)
+{
+    resetFromOneBaseValue<bool, SVGAnimatedBoolean>(properties, type, &SVGAnimatedType::boolean);
+}
+
+void SVGAnimatedBooleanAnimator::animValWillChange(const Vector<SVGAnimatedProperty*>& properties)
+{
+    animValWillChangeForType<SVGAnimatedBoolean>(properties);
+}
+
+void SVGAnimatedBooleanAnimator::animValDidChange(const Vector<SVGAnimatedProperty*>& properties)
+{
+    animValDidChangeForType<SVGAnimatedBoolean>(properties);
+}
+
 void SVGAnimatedBooleanAnimator::calculateFromAndToValues(OwnPtr<SVGAnimatedType>& from, OwnPtr<SVGAnimatedType>& to, const String& fromString, const String& toString)
 {
     ASSERT(m_contextElement);

Modified: trunk/Source/WebCore/svg/SVGAnimatedBoolean.h (112230 => 112231)


--- trunk/Source/WebCore/svg/SVGAnimatedBoolean.h	2012-03-27 09:27:44 UTC (rev 112230)
+++ trunk/Source/WebCore/svg/SVGAnimatedBoolean.h	2012-03-27 09:29:18 UTC (rev 112231)
@@ -38,13 +38,17 @@
 class SVGAnimationElement;
 
 class SVGAnimatedBooleanAnimator : public SVGAnimatedTypeAnimator {
-    
 public:
     SVGAnimatedBooleanAnimator(SVGAnimationElement*, SVGElement*);
     virtual ~SVGAnimatedBooleanAnimator() { }
     
     virtual PassOwnPtr<SVGAnimatedType> constructFromString(const String&);
-    
+    virtual PassOwnPtr<SVGAnimatedType> startAnimValAnimation(const Vector<SVGAnimatedProperty*>&);
+    virtual void stopAnimValAnimation(const Vector<SVGAnimatedProperty*>&);
+    virtual void resetAnimValToBaseVal(const Vector<SVGAnimatedProperty*>&, SVGAnimatedType*);
+    virtual void animValWillChange(const Vector<SVGAnimatedProperty*>&);
+    virtual void animValDidChange(const Vector<SVGAnimatedProperty*>&);
+
     virtual void calculateFromAndToValues(OwnPtr<SVGAnimatedType>& fromValue, OwnPtr<SVGAnimatedType>& toValue, const String& fromString, const String& toString);
     virtual void calculateFromAndByValues(OwnPtr<SVGAnimatedType>& fromValue, OwnPtr<SVGAnimatedType>& toValue, const String& fromString, const String& byString);
     virtual void calculateAnimatedValue(float percentage, unsigned repeatCount,

Modified: trunk/Source/WebCore/svg/SVGAnimatedType.cpp (112230 => 112231)


--- trunk/Source/WebCore/svg/SVGAnimatedType.cpp	2012-03-27 09:27:44 UTC (rev 112230)
+++ trunk/Source/WebCore/svg/SVGAnimatedType.cpp	2012-03-27 09:29:18 UTC (rev 112231)
@@ -398,14 +398,6 @@
 {
     ExceptionCode ec = 0;
     switch (m_type) {
-    case AnimatedAngle:
-        ASSERT(m_data.angle);
-        m_data.angle->setValueAsString(value, ec);
-        break;
-    case AnimatedBoolean:
-        ASSERT(m_data.boolean);
-        *m_data.boolean = value == "true" ? true : false;
-        break;
     case AnimatedColor:
         ASSERT(m_data.color);
         *m_data.color = value.isEmpty() ? Color() : SVGColor::colorFromRGBColorString(value);
@@ -453,6 +445,8 @@
         break;
 
     // These types don't appear in the table in SVGStyledElement::cssPropertyToTypeMap() and thus don't need setValueAsString() support. 
+    case AnimatedAngle:
+    case AnimatedBoolean:
     case AnimatedNumberList:
     case AnimatedNumberOptionalNumber:
     case AnimatedInteger:
@@ -477,6 +471,7 @@
     // FIXME: This lists the current state of our animVal support.
     switch (type) {
     case AnimatedAngle:
+    case AnimatedBoolean:
     case AnimatedInteger:
     case AnimatedIntegerOptionalInteger:
     case AnimatedLength:
@@ -486,7 +481,6 @@
     case AnimatedNumberOptionalNumber:
     case AnimatedTransformList:
         return true;
-    case AnimatedBoolean:
     case AnimatedColor:
     case AnimatedEnumeration:
     case AnimatedPath:
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to