Changeset 112247 in webkit


Ignore:
Timestamp:
Mar 27, 2012 3:47:05 AM (12 years ago)
Author:
Nikolas Zimmermann
Message:

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

Reviewed by Zoltan Herczeg.

Source/WebCore:

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

Extended existing tests to cover this.

  • svg/SVGAnimatedRect.cpp:

(WebCore::SVGAnimatedRectAnimator::startAnimValAnimation):
(WebCore::SVGAnimatedRectAnimator::stopAnimValAnimation):
(WebCore::SVGAnimatedRectAnimator::resetAnimValToBaseVal):
(WebCore::SVGAnimatedRectAnimator::animValWillChange):
(WebCore::SVGAnimatedRectAnimator::animValDidChange):

  • svg/SVGAnimatedRect.h:

(SVGAnimatedRectAnimator):

  • svg/SVGAnimatedType.cpp:

(WebCore::SVGAnimatedType::supportsAnimVal):

LayoutTests:

Extend SVGAnimatedRect tests to cover animVal support.

  • svg/animations/script-tests/svgrect-animation-1.js:

(sample1):
(sample2):
(sample3):

  • svg/animations/script-tests/svgrect-animation-2.js:

(sample1):
(sample2):
(sample3):

  • svg/animations/svgrect-animation-1-expected.txt:
  • svg/animations/svgrect-animation-2-expected.txt:
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r112246 r112247  
     12012-03-27  Nikolas Zimmermann  <nzimmermann@rim.com>
     2
     3        Enable animVal support for SVGAnimatedRect
     4        https://bugs.webkit.org/show_bug.cgi?id=82317
     5
     6        Reviewed by Zoltan Herczeg.
     7
     8        Extend SVGAnimatedRect tests to cover animVal support.
     9
     10        * svg/animations/script-tests/svgrect-animation-1.js:
     11        (sample1):
     12        (sample2):
     13        (sample3):
     14        * svg/animations/script-tests/svgrect-animation-2.js:
     15        (sample1):
     16        (sample2):
     17        (sample3):
     18        * svg/animations/svgrect-animation-1-expected.txt:
     19        * svg/animations/svgrect-animation-2-expected.txt:
     20
    1212012-03-27  Nikolas Zimmermann  <nzimmermann@rim.com>
    222
  • trunk/LayoutTests/svg/animations/script-tests/svgrect-animation-1.js

    r110574 r112247  
    3030    shouldBeCloseEnough("rootSVGElement.viewBox.animVal.height", "100");
    3131
    32     shouldBeCloseEnough("rootSVGElement.viewBox.baseVal.x", "0");
    33     shouldBeCloseEnough("rootSVGElement.viewBox.baseVal.y", "0");
    34     shouldBeCloseEnough("rootSVGElement.viewBox.baseVal.width", "100");
    35     shouldBeCloseEnough("rootSVGElement.viewBox.baseVal.height", "100");
     32    shouldBe("rootSVGElement.viewBox.baseVal.x", "0");
     33    shouldBe("rootSVGElement.viewBox.baseVal.y", "0");
     34    shouldBe("rootSVGElement.viewBox.baseVal.width", "100");
     35    shouldBe("rootSVGElement.viewBox.baseVal.height", "100");
    3636}
    3737
     
    4242    shouldBeCloseEnough("rootSVGElement.viewBox.animVal.height", "75");
    4343
    44     shouldBeCloseEnough("rootSVGElement.viewBox.baseVal.x", "25");
    45     shouldBeCloseEnough("rootSVGElement.viewBox.baseVal.y", "25");
    46     shouldBeCloseEnough("rootSVGElement.viewBox.baseVal.width", "75");
    47     shouldBeCloseEnough("rootSVGElement.viewBox.baseVal.height", "75");
     44    shouldBe("rootSVGElement.viewBox.baseVal.x", "0");
     45    shouldBe("rootSVGElement.viewBox.baseVal.y", "0");
     46    shouldBe("rootSVGElement.viewBox.baseVal.width", "100");
     47    shouldBe("rootSVGElement.viewBox.baseVal.height", "100");
    4848}
    4949
     
    5454    shouldBeCloseEnough("rootSVGElement.viewBox.animVal.height", "50");
    5555
    56     shouldBeCloseEnough("rootSVGElement.viewBox.baseVal.x", "50");
    57     shouldBeCloseEnough("rootSVGElement.viewBox.baseVal.y", "50");
    58     shouldBeCloseEnough("rootSVGElement.viewBox.baseVal.width", "50");
    59     shouldBeCloseEnough("rootSVGElement.viewBox.baseVal.height", "50");
     56    shouldBe("rootSVGElement.viewBox.baseVal.x", "0");
     57    shouldBe("rootSVGElement.viewBox.baseVal.y", "0");
     58    shouldBe("rootSVGElement.viewBox.baseVal.width", "100");
     59    shouldBe("rootSVGElement.viewBox.baseVal.height", "100");
    6060}
    6161
  • trunk/LayoutTests/svg/animations/script-tests/svgrect-animation-2.js

    r110574 r112247  
    3030    shouldBeCloseEnough("rootSVGElement.viewBox.animVal.height", "100");
    3131
    32     shouldBeCloseEnough("rootSVGElement.viewBox.baseVal.x", "0");
    33     shouldBeCloseEnough("rootSVGElement.viewBox.baseVal.y", "0");
    34     shouldBeCloseEnough("rootSVGElement.viewBox.baseVal.width", "100");
    35     shouldBeCloseEnough("rootSVGElement.viewBox.baseVal.height", "100");
     32    shouldBe("rootSVGElement.viewBox.baseVal.x", "0");
     33    shouldBe("rootSVGElement.viewBox.baseVal.y", "0");
     34    shouldBe("rootSVGElement.viewBox.baseVal.width", "100");
     35    shouldBe("rootSVGElement.viewBox.baseVal.height", "100");
    3636}
    3737
     
    4242    shouldBeCloseEnough("rootSVGElement.viewBox.animVal.height", "125");
    4343
    44     shouldBeCloseEnough("rootSVGElement.viewBox.baseVal.x", "25");
    45     shouldBeCloseEnough("rootSVGElement.viewBox.baseVal.y", "25");
    46     shouldBeCloseEnough("rootSVGElement.viewBox.baseVal.width", "125");
    47     shouldBeCloseEnough("rootSVGElement.viewBox.baseVal.height", "125");
     44    shouldBe("rootSVGElement.viewBox.baseVal.x", "0");
     45    shouldBe("rootSVGElement.viewBox.baseVal.y", "0");
     46    shouldBe("rootSVGElement.viewBox.baseVal.width", "100");
     47    shouldBe("rootSVGElement.viewBox.baseVal.height", "100");
    4848}
    4949
     
    5454    shouldBeCloseEnough("rootSVGElement.viewBox.animVal.height", "150");
    5555
    56     shouldBeCloseEnough("rootSVGElement.viewBox.baseVal.x", "50");
    57     shouldBeCloseEnough("rootSVGElement.viewBox.baseVal.y", "50");
    58     shouldBeCloseEnough("rootSVGElement.viewBox.baseVal.width", "150");
    59     shouldBeCloseEnough("rootSVGElement.viewBox.baseVal.height", "150");
     56    shouldBe("rootSVGElement.viewBox.baseVal.x", "0");
     57    shouldBe("rootSVGElement.viewBox.baseVal.y", "0");
     58    shouldBe("rootSVGElement.viewBox.baseVal.width", "100");
     59    shouldBe("rootSVGElement.viewBox.baseVal.height", "100");
    6060}
    6161
  • trunk/LayoutTests/svg/animations/svgrect-animation-1-expected.txt

    r107791 r112247  
    1818PASS rootSVGElement.viewBox.animVal.width is 75
    1919PASS rootSVGElement.viewBox.animVal.height is 75
    20 PASS rootSVGElement.viewBox.baseVal.x is 25
    21 PASS rootSVGElement.viewBox.baseVal.y is 25
    22 PASS rootSVGElement.viewBox.baseVal.width is 75
    23 PASS rootSVGElement.viewBox.baseVal.height is 75
     20PASS rootSVGElement.viewBox.baseVal.x is 0
     21PASS rootSVGElement.viewBox.baseVal.y is 0
     22PASS rootSVGElement.viewBox.baseVal.width is 100
     23PASS rootSVGElement.viewBox.baseVal.height is 100
    2424PASS rootSVGElement.viewBox.animVal.x is 50
    2525PASS rootSVGElement.viewBox.animVal.y is 50
    2626PASS rootSVGElement.viewBox.animVal.width is 50
    2727PASS rootSVGElement.viewBox.animVal.height is 50
    28 PASS rootSVGElement.viewBox.baseVal.x is 50
    29 PASS rootSVGElement.viewBox.baseVal.y is 50
    30 PASS rootSVGElement.viewBox.baseVal.width is 50
    31 PASS rootSVGElement.viewBox.baseVal.height is 50
     28PASS rootSVGElement.viewBox.baseVal.x is 0
     29PASS rootSVGElement.viewBox.baseVal.y is 0
     30PASS rootSVGElement.viewBox.baseVal.width is 100
     31PASS rootSVGElement.viewBox.baseVal.height is 100
    3232PASS rootSVGElement.viewBox.animVal.x is 0
    3333PASS rootSVGElement.viewBox.animVal.y is 0
  • trunk/LayoutTests/svg/animations/svgrect-animation-2-expected.txt

    r107791 r112247  
    1818PASS rootSVGElement.viewBox.animVal.width is 125
    1919PASS rootSVGElement.viewBox.animVal.height is 125
    20 PASS rootSVGElement.viewBox.baseVal.x is 25
    21 PASS rootSVGElement.viewBox.baseVal.y is 25
    22 PASS rootSVGElement.viewBox.baseVal.width is 125
    23 PASS rootSVGElement.viewBox.baseVal.height is 125
     20PASS rootSVGElement.viewBox.baseVal.x is 0
     21PASS rootSVGElement.viewBox.baseVal.y is 0
     22PASS rootSVGElement.viewBox.baseVal.width is 100
     23PASS rootSVGElement.viewBox.baseVal.height is 100
    2424PASS rootSVGElement.viewBox.animVal.x is 50
    2525PASS rootSVGElement.viewBox.animVal.y is 50
    2626PASS rootSVGElement.viewBox.animVal.width is 150
    2727PASS rootSVGElement.viewBox.animVal.height is 150
    28 PASS rootSVGElement.viewBox.baseVal.x is 50
    29 PASS rootSVGElement.viewBox.baseVal.y is 50
    30 PASS rootSVGElement.viewBox.baseVal.width is 150
    31 PASS rootSVGElement.viewBox.baseVal.height is 150
     28PASS rootSVGElement.viewBox.baseVal.x is 0
     29PASS rootSVGElement.viewBox.baseVal.y is 0
     30PASS rootSVGElement.viewBox.baseVal.width is 100
     31PASS rootSVGElement.viewBox.baseVal.height is 100
    3232PASS rootSVGElement.viewBox.animVal.x is 0
    3333PASS rootSVGElement.viewBox.animVal.y is 0
  • trunk/Source/WebCore/ChangeLog

    r112245 r112247  
     12012-03-27  Nikolas Zimmermann  <nzimmermann@rim.com>
     2
     3        Enable animVal support for SVGAnimatedRect
     4        https://bugs.webkit.org/show_bug.cgi?id=82317
     5
     6        Reviewed by Zoltan Herczeg.
     7
     8        Enable animVal support for SVGAnimatedRect. Very simple now that everything is prepared.
     9        All we have to do is add startAnimValAnimation/etc. methods to SVGAnimatedRectAnimator.
     10
     11        Extended existing tests to cover this.
     12
     13        * svg/SVGAnimatedRect.cpp:
     14        (WebCore::SVGAnimatedRectAnimator::startAnimValAnimation):
     15        (WebCore::SVGAnimatedRectAnimator::stopAnimValAnimation):
     16        (WebCore::SVGAnimatedRectAnimator::resetAnimValToBaseVal):
     17        (WebCore::SVGAnimatedRectAnimator::animValWillChange):
     18        (WebCore::SVGAnimatedRectAnimator::animValDidChange):
     19        * svg/SVGAnimatedRect.h:
     20        (SVGAnimatedRectAnimator):
     21        * svg/SVGAnimatedType.cpp:
     22        (WebCore::SVGAnimatedType::supportsAnimVal):
     23
    1242012-03-27  Sheriff Bot  <webkit.review.bot@gmail.com>
    225
  • trunk/Source/WebCore/svg/SVGAnimatedRect.cpp

    r95901 r112247  
    3838    parseRect(string, animatedType->rect());
    3939    return animatedType.release();
     40}
     41
     42PassOwnPtr<SVGAnimatedType> SVGAnimatedRectAnimator::startAnimValAnimation(const Vector<SVGAnimatedProperty*>& properties)
     43{
     44    return SVGAnimatedType::createRect(constructFromOneBaseValue<FloatRect, SVGAnimatedRect>(properties));
     45}
     46
     47void SVGAnimatedRectAnimator::stopAnimValAnimation(const Vector<SVGAnimatedProperty*>& properties)
     48{
     49    SVGAnimatedTypeAnimator::stopAnimValAnimationForType<SVGAnimatedRect>(properties);
     50}
     51
     52void SVGAnimatedRectAnimator::resetAnimValToBaseVal(const Vector<SVGAnimatedProperty*>& properties, SVGAnimatedType* type)
     53{
     54    resetFromOneBaseValue<FloatRect, SVGAnimatedRect>(properties, type, &SVGAnimatedType::rect);
     55}
     56
     57void SVGAnimatedRectAnimator::animValWillChange(const Vector<SVGAnimatedProperty*>& properties)
     58{
     59    animValWillChangeForType<SVGAnimatedRect>(properties);
     60}
     61
     62void SVGAnimatedRectAnimator::animValDidChange(const Vector<SVGAnimatedProperty*>& properties)
     63{
     64    animValDidChangeForType<SVGAnimatedRect>(properties);
    4065}
    4166
  • trunk/Source/WebCore/svg/SVGAnimatedRect.h

    r95901 r112247  
    4141
    4242class SVGAnimatedRectAnimator : public SVGAnimatedTypeAnimator {
    43 
    4443public:
    4544    SVGAnimatedRectAnimator(SVGAnimationElement*, SVGElement*);
     
    4746
    4847    virtual PassOwnPtr<SVGAnimatedType> constructFromString(const String&);
     48    virtual PassOwnPtr<SVGAnimatedType> startAnimValAnimation(const Vector<SVGAnimatedProperty*>&);
     49    virtual void stopAnimValAnimation(const Vector<SVGAnimatedProperty*>&);
     50    virtual void resetAnimValToBaseVal(const Vector<SVGAnimatedProperty*>&, SVGAnimatedType*);
     51    virtual void animValWillChange(const Vector<SVGAnimatedProperty*>&);
     52    virtual void animValDidChange(const Vector<SVGAnimatedProperty*>&);
    4953
    5054    virtual void calculateFromAndToValues(OwnPtr<SVGAnimatedType>& fromValue, OwnPtr<SVGAnimatedType>& toValue, const String& fromString, const String& toString);
  • trunk/Source/WebCore/svg/SVGAnimatedType.cpp

    r112240 r112247  
    480480    case AnimatedNumberList:
    481481    case AnimatedNumberOptionalNumber:
     482    case AnimatedRect:
    482483    case AnimatedString:
    483484    case AnimatedTransformList:
     
    488489    case AnimatedPoints:
    489490    case AnimatedPreserveAspectRatio:
    490     case AnimatedRect:
    491491    case AnimatedUnknown:
    492492        return false;
Note: See TracChangeset for help on using the changeset viewer.