Changeset 112223 in webkit


Ignore:
Timestamp:
Mar 27, 2012 1:22:37 AM (12 years ago)
Author:
Nikolas Zimmermann
Message:

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

Reviewed by Rob Buis.

Source/WebCore:

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

Extended existing tests to cover this.

  • svg/SVGAnimatedAngle.cpp:

(WebCore::sharedSVGAngle):
(WebCore::SVGAnimatedAngleAnimator::constructFromString):
(WebCore::SVGAnimatedAngleAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedAngleAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedAngleAnimator::resetAnimValToBaseVal):
(WebCore::SVGAnimatedAngleAnimator::animValWillChange):
(WebCore::SVGAnimatedAngleAnimator::animValDidChange):
(WebCore::SVGAnimatedAngleAnimator::calculateDistance):

  • svg/SVGAnimatedAngle.h:

(SVGAnimatedAngleAnimator):

  • svg/SVGAnimatedType.cpp:

(WebCore::SVGAnimatedType::supportsAnimVal):

LayoutTests:

Update tests after enabling animVal support for SVGAnimatedAngle.

  • svg/animations/script-tests/svgangle-animation-deg-to-grad.js:

(sample2):
(sample3):

  • svg/animations/script-tests/svgangle-animation-deg-to-rad.js:

(sample2):
(sample3):

  • svg/animations/script-tests/svgangle-animation-grad-to-deg.js:

(sample2):
(sample3):

  • svg/animations/script-tests/svgangle-animation-grad-to-rad.js:

(sample2):
(sample3):

  • svg/animations/script-tests/svgangle-animation-rad-to-deg.js:

(sample2):
(sample3):

  • svg/animations/script-tests/svgangle-animation-rad-to-grad.js:

(sample2):
(sample3):

  • svg/animations/svgangle-animation-deg-to-grad-expected.txt:
  • svg/animations/svgangle-animation-deg-to-rad-expected.txt:
  • svg/animations/svgangle-animation-grad-to-deg-expected.txt:
  • svg/animations/svgangle-animation-grad-to-rad-expected.txt:
  • svg/animations/svgangle-animation-rad-to-deg-expected.txt:
  • svg/animations/svgangle-animation-rad-to-grad-expected.txt:
Location:
trunk
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r112222 r112223  
     12012-03-25  Nikolas Zimmermann  <nzimmermann@rim.com>
     2
     3        Enable animVal support for SVGAngle
     4        https://bugs.webkit.org/show_bug.cgi?id=82144
     5
     6        Reviewed by Rob Buis.
     7
     8        Update tests after enabling animVal support for SVGAnimatedAngle.
     9
     10        * svg/animations/script-tests/svgangle-animation-deg-to-grad.js:
     11        (sample2):
     12        (sample3):
     13        * svg/animations/script-tests/svgangle-animation-deg-to-rad.js:
     14        (sample2):
     15        (sample3):
     16        * svg/animations/script-tests/svgangle-animation-grad-to-deg.js:
     17        (sample2):
     18        (sample3):
     19        * svg/animations/script-tests/svgangle-animation-grad-to-rad.js:
     20        (sample2):
     21        (sample3):
     22        * svg/animations/script-tests/svgangle-animation-rad-to-deg.js:
     23        (sample2):
     24        (sample3):
     25        * svg/animations/script-tests/svgangle-animation-rad-to-grad.js:
     26        (sample2):
     27        (sample3):
     28        * svg/animations/svgangle-animation-deg-to-grad-expected.txt:
     29        * svg/animations/svgangle-animation-deg-to-rad-expected.txt:
     30        * svg/animations/svgangle-animation-grad-to-deg-expected.txt:
     31        * svg/animations/svgangle-animation-grad-to-rad-expected.txt:
     32        * svg/animations/svgangle-animation-rad-to-deg-expected.txt:
     33        * svg/animations/svgangle-animation-rad-to-grad-expected.txt:
     34
    1352012-03-27  Yury Semikhatsky  <yurys@chromium.org>
    236
  • trunk/LayoutTests/svg/animations/script-tests/svgangle-animation-deg-to-grad.js

    r110574 r112223  
    5050function sample2() {
    5151    shouldBeCloseEnough("marker.orientAngle.animVal.value", "90");
    52     shouldBeCloseEnough("marker.orientAngle.baseVal.value", "90");
     52    shouldBeCloseEnough("marker.orientAngle.baseVal.value", "0");
    5353}
    5454
    5555function sample3() {
    5656    shouldBeCloseEnough("marker.orientAngle.animVal.value", "180");
    57     shouldBeCloseEnough("marker.orientAngle.baseVal.value", "180");
     57    shouldBeCloseEnough("marker.orientAngle.baseVal.value", "0");
    5858}
    5959
  • trunk/LayoutTests/svg/animations/script-tests/svgangle-animation-deg-to-rad.js

    r110574 r112223  
    5050function sample2() {
    5151    shouldBeCloseEnough("marker.orientAngle.animVal.value", "90");
    52     shouldBeCloseEnough("marker.orientAngle.baseVal.value", "90");
     52    shouldBeCloseEnough("marker.orientAngle.baseVal.value", "0");
    5353}
    5454
    5555function sample3() {
    5656    shouldBeCloseEnough("marker.orientAngle.animVal.value", "180");
    57     shouldBeCloseEnough("marker.orientAngle.baseVal.value", "180");
     57    shouldBeCloseEnough("marker.orientAngle.baseVal.value", "0");
    5858}
    5959
  • trunk/LayoutTests/svg/animations/script-tests/svgangle-animation-grad-to-deg.js

    r110574 r112223  
    5050function sample2() {
    5151    shouldBeCloseEnough("marker.orientAngle.animVal.value", "90");
    52     shouldBeCloseEnough("marker.orientAngle.baseVal.value", "90");
     52    shouldBeCloseEnough("marker.orientAngle.baseVal.value", "0");
    5353}
    5454
    5555function sample3() {
    5656    shouldBeCloseEnough("marker.orientAngle.animVal.value", "180");
    57     shouldBeCloseEnough("marker.orientAngle.baseVal.value", "180");
     57    shouldBeCloseEnough("marker.orientAngle.baseVal.value", "0");
    5858}
    5959
  • trunk/LayoutTests/svg/animations/script-tests/svgangle-animation-grad-to-rad.js

    r110574 r112223  
    5050function sample2() {
    5151    shouldBeCloseEnough("marker.orientAngle.animVal.value", "90");
    52     shouldBeCloseEnough("marker.orientAngle.baseVal.value", "90");
     52    shouldBeCloseEnough("marker.orientAngle.baseVal.value", "0");
    5353}
    5454
    5555function sample3() {
    5656    shouldBeCloseEnough("marker.orientAngle.animVal.value", "180");
    57     shouldBeCloseEnough("marker.orientAngle.baseVal.value", "180");
     57    shouldBeCloseEnough("marker.orientAngle.baseVal.value", "0");
    5858}
    5959
  • trunk/LayoutTests/svg/animations/script-tests/svgangle-animation-rad-to-deg.js

    r110574 r112223  
    5050function sample2() {
    5151    shouldBeCloseEnough("marker.orientAngle.animVal.value", "90");
    52     shouldBeCloseEnough("marker.orientAngle.baseVal.value", "90");
     52    shouldBeCloseEnough("marker.orientAngle.baseVal.value", "0");
    5353}
    5454
    5555function sample3() {
    5656    shouldBeCloseEnough("marker.orientAngle.animVal.value", "180");
    57     shouldBeCloseEnough("marker.orientAngle.baseVal.value", "180");
     57    shouldBeCloseEnough("marker.orientAngle.baseVal.value", "0");
    5858}
    5959
  • trunk/LayoutTests/svg/animations/script-tests/svgangle-animation-rad-to-grad.js

    r110574 r112223  
    5050function sample2() {
    5151    shouldBeCloseEnough("marker.orientAngle.animVal.value", "90");
    52     shouldBeCloseEnough("marker.orientAngle.baseVal.value", "90");
     52    shouldBeCloseEnough("marker.orientAngle.baseVal.value", "0");
    5353}
    5454
    5555function sample3() {
    5656    shouldBeCloseEnough("marker.orientAngle.animVal.value", "180");
    57     shouldBeCloseEnough("marker.orientAngle.baseVal.value", "180");
     57    shouldBeCloseEnough("marker.orientAngle.baseVal.value", "0");
    5858}
    5959
  • trunk/LayoutTests/svg/animations/svgangle-animation-deg-to-grad-expected.txt

    r107791 r112223  
    99PASS marker.orientAngle.baseVal.value is 0
    1010PASS marker.orientAngle.animVal.value is 90
    11 PASS marker.orientAngle.baseVal.value is 90
     11PASS marker.orientAngle.baseVal.value is 0
    1212PASS marker.orientAngle.animVal.value is 180
    13 PASS marker.orientAngle.baseVal.value is 180
     13PASS marker.orientAngle.baseVal.value is 0
    1414PASS marker.orientAngle.animVal.value is 0
    1515PASS marker.orientAngle.baseVal.value is 0
  • trunk/LayoutTests/svg/animations/svgangle-animation-deg-to-rad-expected.txt

    r107791 r112223  
    99PASS marker.orientAngle.baseVal.value is 0
    1010PASS marker.orientAngle.animVal.value is 90
    11 PASS marker.orientAngle.baseVal.value is 90
     11PASS marker.orientAngle.baseVal.value is 0
    1212PASS marker.orientAngle.animVal.value is 180
    13 PASS marker.orientAngle.baseVal.value is 180
     13PASS marker.orientAngle.baseVal.value is 0
    1414PASS marker.orientAngle.animVal.value is 0
    1515PASS marker.orientAngle.baseVal.value is 0
  • trunk/LayoutTests/svg/animations/svgangle-animation-grad-to-deg-expected.txt

    r107791 r112223  
    99PASS marker.orientAngle.baseVal.value is 0
    1010PASS marker.orientAngle.animVal.value is 90
    11 PASS marker.orientAngle.baseVal.value is 90
     11PASS marker.orientAngle.baseVal.value is 0
    1212PASS marker.orientAngle.animVal.value is 180
    13 PASS marker.orientAngle.baseVal.value is 180
     13PASS marker.orientAngle.baseVal.value is 0
    1414PASS marker.orientAngle.animVal.value is 0
    1515PASS marker.orientAngle.baseVal.value is 0
  • trunk/LayoutTests/svg/animations/svgangle-animation-grad-to-rad-expected.txt

    r107791 r112223  
    99PASS marker.orientAngle.baseVal.value is 0
    1010PASS marker.orientAngle.animVal.value is 90
    11 PASS marker.orientAngle.baseVal.value is 90
     11PASS marker.orientAngle.baseVal.value is 0
    1212PASS marker.orientAngle.animVal.value is 180
    13 PASS marker.orientAngle.baseVal.value is 180
     13PASS marker.orientAngle.baseVal.value is 0
    1414PASS marker.orientAngle.animVal.value is 0
    1515PASS marker.orientAngle.baseVal.value is 0
  • trunk/LayoutTests/svg/animations/svgangle-animation-rad-to-deg-expected.txt

    r107791 r112223  
    99PASS marker.orientAngle.baseVal.value is 0
    1010PASS marker.orientAngle.animVal.value is 90
    11 PASS marker.orientAngle.baseVal.value is 90
     11PASS marker.orientAngle.baseVal.value is 0
    1212PASS marker.orientAngle.animVal.value is 180
    13 PASS marker.orientAngle.baseVal.value is 180
     13PASS marker.orientAngle.baseVal.value is 0
    1414PASS marker.orientAngle.animVal.value is 0
    1515PASS marker.orientAngle.baseVal.value is 0
  • trunk/LayoutTests/svg/animations/svgangle-animation-rad-to-grad-expected.txt

    r107791 r112223  
    99PASS marker.orientAngle.baseVal.value is 0
    1010PASS marker.orientAngle.animVal.value is 90
    11 PASS marker.orientAngle.baseVal.value is 90
     11PASS marker.orientAngle.baseVal.value is 0
    1212PASS marker.orientAngle.animVal.value is 180
    13 PASS marker.orientAngle.baseVal.value is 180
     13PASS marker.orientAngle.baseVal.value is 0
    1414PASS marker.orientAngle.animVal.value is 0
    1515PASS marker.orientAngle.baseVal.value is 0
  • trunk/Source/WebCore/ChangeLog

    r112222 r112223  
     12012-03-25  Nikolas Zimmermann  <nzimmermann@rim.com>
     2
     3        Enable animVal support for SVGAngle
     4        https://bugs.webkit.org/show_bug.cgi?id=82144
     5
     6        Reviewed by Rob Buis.
     7
     8        Enable animVal support for SVGAnimatedAngle. Very simple now that everything is prepared.
     9        All we have to do is add startAnimValAnimation/etc. methods to SVGAnimatedAngleAnimator.
     10
     11        Extended existing tests to cover this.
     12
     13        * svg/SVGAnimatedAngle.cpp:
     14        (WebCore::sharedSVGAngle):
     15        (WebCore::SVGAnimatedAngleAnimator::constructFromString):
     16        (WebCore::SVGAnimatedAngleAnimator::startAnimValAnimation):
     17        (WebCore::SVGAnimatedAngleAnimator::stopAnimValAnimation):
     18        (WebCore::SVGAnimatedAngleAnimator::resetAnimValToBaseVal):
     19        (WebCore::SVGAnimatedAngleAnimator::animValWillChange):
     20        (WebCore::SVGAnimatedAngleAnimator::animValDidChange):
     21        (WebCore::SVGAnimatedAngleAnimator::calculateDistance):
     22        * svg/SVGAnimatedAngle.h:
     23        (SVGAnimatedAngleAnimator):
     24        * svg/SVGAnimatedType.cpp:
     25        (WebCore::SVGAnimatedType::supportsAnimVal):
     26
    1272012-03-27  Yury Semikhatsky  <yurys@chromium.org>
    228
  • trunk/Source/WebCore/svg/SVGAnimatedAngle.cpp

    r95901 r112223  
    3535{
    3636    DEFINE_STATIC_LOCAL(SVGAngle, sharedAngle, ());
    37     ExceptionCode ec = 0;
    38     sharedAngle.setValueAsString(valueAsString, ec);
    39     ASSERT(!ec);
     37    sharedAngle.setValueAsString(valueAsString, ASSERT_NO_EXCEPTION);
    4038    return sharedAngle;
    4139}
     
    4442{
    4543    OwnPtr<SVGAnimatedType> animatedType = SVGAnimatedType::createAngle(new SVGAngle);
    46     ExceptionCode ec = 0;
    47     animatedType->angle().setValueAsString(string, ec);
    48     ASSERT(!ec);
     44    animatedType->angle().setValueAsString(string, ASSERT_NO_EXCEPTION);
    4945    return animatedType.release();
     46}
     47
     48PassOwnPtr<SVGAnimatedType> SVGAnimatedAngleAnimator::startAnimValAnimation(const Vector<SVGAnimatedProperty*>& properties)
     49{
     50    return SVGAnimatedType::createAngle(constructFromOneBaseValue<SVGAngle, SVGAnimatedAngle>(properties));
     51}
     52
     53void SVGAnimatedAngleAnimator::stopAnimValAnimation(const Vector<SVGAnimatedProperty*>& properties)
     54{
     55    SVGAnimatedTypeAnimator::stopAnimValAnimationForType<SVGAnimatedAngle>(properties);
     56}
     57
     58void SVGAnimatedAngleAnimator::resetAnimValToBaseVal(const Vector<SVGAnimatedProperty*>& properties, SVGAnimatedType* type)
     59{
     60    resetFromOneBaseValue<SVGAngle, SVGAnimatedAngle>(properties, type, &SVGAnimatedType::angle);
     61}
     62
     63void SVGAnimatedAngleAnimator::animValWillChange(const Vector<SVGAnimatedProperty*>& properties)
     64{
     65    animValWillChangeForType<SVGAnimatedAngle>(properties);
     66}
     67
     68void SVGAnimatedAngleAnimator::animValDidChange(const Vector<SVGAnimatedProperty*>& properties)
     69{
     70    animValDidChangeForType<SVGAnimatedAngle>(properties);
    5071}
    5172
     
    124145float SVGAnimatedAngleAnimator::calculateDistance(const String& fromString, const String& toString)
    125146{
    126     ExceptionCode ec = 0;
    127147    SVGAngle from = SVGAngle();
    128     from.setValueAsString(fromString, ec);
    129     ASSERT(!ec);
     148    from.setValueAsString(fromString, ASSERT_NO_EXCEPTION);
    130149    SVGAngle to = SVGAngle();
    131     to.setValueAsString(toString, ec);
    132     ASSERT(!ec);
     150    to.setValueAsString(toString, ASSERT_NO_EXCEPTION);
    133151    return fabsf(to.value() - from.value());
    134152}
  • trunk/Source/WebCore/svg/SVGAnimatedAngle.h

    r95901 r112223  
    4040
    4141class SVGAnimatedAngleAnimator : public SVGAnimatedTypeAnimator {
    42 
    4342public:
    4443    SVGAnimatedAngleAnimator(SVGAnimationElement*, SVGElement*);
     
    4645
    4746    virtual PassOwnPtr<SVGAnimatedType> constructFromString(const String&);
     47    virtual PassOwnPtr<SVGAnimatedType> startAnimValAnimation(const Vector<SVGAnimatedProperty*>&);
     48    virtual void stopAnimValAnimation(const Vector<SVGAnimatedProperty*>&);
     49    virtual void resetAnimValToBaseVal(const Vector<SVGAnimatedProperty*>&, SVGAnimatedType*);
     50    virtual void animValWillChange(const Vector<SVGAnimatedProperty*>&);
     51    virtual void animValDidChange(const Vector<SVGAnimatedProperty*>&);
    4852
    4953    virtual void calculateFromAndToValues(OwnPtr<SVGAnimatedType>& fromValue, OwnPtr<SVGAnimatedType>& toValue, const String& fromString, const String& toString);
  • trunk/Source/WebCore/svg/SVGAnimatedType.cpp

    r111120 r112223  
    454454    // FIXME: This lists the current state of our animVal support.
    455455    switch (type) {
     456    case AnimatedAngle:
    456457    case AnimatedLength:
    457458    case AnimatedLengthList:
     
    461462    case AnimatedTransformList:
    462463        return true;
    463     case AnimatedAngle:
    464464    case AnimatedBoolean:
    465465    case AnimatedColor:
Note: See TracChangeset for help on using the changeset viewer.