Changeset 93517 in webkit


Ignore:
Timestamp:
Aug 22, 2011 11:00:59 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

Patch by Young Han Lee <joybro@company100.net> on 2011-08-22
Reviewed by Dirk Schulze.

SVG animation fill="freeze" doesn't set baseVal to current animVal if animation stops before reaching the end
https://bugs.webkit.org/show_bug.cgi?id=63553

calculateAnimationPercentAndRepeat() is returning 1, which means 100%, whenever
elapsed >= m_intervalEnd, but this is wrong because m_intervalEnd can be in the middle
of the animation duration. (e.g. begin="0s" end="2s" dur="3s")

This change makes the function return the animations's true progress instead of 100%
when the animation ends.

Source/WebCore:

Test: svg/animations/animate-end-attribute.html

  • svg/animation/SVGSMILElement.cpp:

(WebCore::SVGSMILElement::calculateAnimationPercentAndRepeat):

LayoutTests:

  • svg/animations/animate-end-attribute-expected.txt: Added.
  • svg/animations/animate-end-attribute.html: Added.
  • svg/animations/script-tests/animate-end-attribute.js: Added.

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

Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r93514 r93517  
     12011-08-22  Young Han Lee  <joybro@company100.net>
     2
     3        Reviewed by Dirk Schulze.
     4
     5        SVG animation fill="freeze" doesn't set baseVal to current animVal if animation stops before reaching the end
     6        https://bugs.webkit.org/show_bug.cgi?id=63553
     7
     8        calculateAnimationPercentAndRepeat() is returning 1, which means 100%, whenever
     9        elapsed >= m_intervalEnd, but this is wrong because m_intervalEnd can be in the middle
     10        of the animation duration. (e.g. begin="0s" end="2s" dur="3s")
     11
     12        This change makes the function return the animations's true progress instead of 100%
     13        when the animation ends.
     14
     15        * svg/animations/animate-end-attribute-expected.txt: Added.
     16        * svg/animations/animate-end-attribute.html: Added.
     17        * svg/animations/script-tests/animate-end-attribute.js: Added.
     18        (sample1):
     19        (sample2):
     20        (sample3):
     21        (executeTest):
     22
    1232011-08-22  Abhishek Arya  <inferno@chromium.org>
    224
  • trunk/Source/WebCore/ChangeLog

    r93516 r93517  
     12011-08-22  Young Han Lee  <joybro@company100.net>
     2
     3        Reviewed by Dirk Schulze.
     4
     5        SVG animation fill="freeze" doesn't set baseVal to current animVal if animation stops before reaching the end
     6        https://bugs.webkit.org/show_bug.cgi?id=63553
     7
     8        calculateAnimationPercentAndRepeat() is returning 1, which means 100%, whenever
     9        elapsed >= m_intervalEnd, but this is wrong because m_intervalEnd can be in the middle
     10        of the animation duration. (e.g. begin="0s" end="2s" dur="3s")
     11
     12        This change makes the function return the animations's true progress instead of 100%
     13        when the animation ends.
     14
     15        Test: svg/animations/animate-end-attribute.html
     16
     17        * svg/animation/SVGSMILElement.cpp:
     18        (WebCore::SVGSMILElement::calculateAnimationPercentAndRepeat):
     19
    1202011-08-22  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
    221
  • trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp

    r93039 r93517  
    857857        if (fmod(repeatingDuration.value(), !simpleDuration.value()))
    858858            repeat--;
     859
     860        SMILTime simpleEndTime = fmod(m_intervalEnd.value() - m_intervalBegin.value(), simpleDuration.value());
     861        if (simpleEndTime.value())
     862            return narrowPrecisionToFloat(simpleEndTime.value() / simpleDuration.value());
     863
    859864        return 1.f;
    860865    }
Note: See TracChangeset for help on using the changeset viewer.