Changeset 117711 in webkit


Ignore:
Timestamp:
May 20, 2012 1:58:04 PM (12 years ago)
Author:
pdr@google.com
Message:

Accumulate SVG animations into first contributing element
https://bugs.webkit.org/show_bug.cgi?id=86385

Reviewed by Nikolas Zimmermann.

Source/WebCore:

Previously we were accumulating animations into the first animation element when
there were multiple animations for a single element. This crashed if the first
animation ended first because the first animation was prematurely cleaned up.
This change accumulates animations into the first _contributing_ animation element.

Tests: svg/animations/multiple-animations-ending.html

svg/animations/svg-two-animate-elements-crash-expected.svg
svg/animations/svg-two-animate-elements-crash.svg

  • svg/animation/SMILTimeContainer.cpp:

(WebCore::SMILTimeContainer::updateAnimations):

  • svg/animation/SVGSMILElement.cpp:

(WebCore::SVGSMILElement::progress):

LayoutTests:

  • svg/animations/multiple-animations-ending-expected.txt: Added.
  • svg/animations/multiple-animations-ending.html: Added.
  • svg/animations/resources/multiple-animations-ending.svg: Added.
  • svg/animations/script-tests/multiple-animations-ending.js: Added.

(sample1):
(sample2):
(sample3):
(sample4):
(sample5):
(sample6):
(sample7):
(sample8):
(sample9):
(sample10):
(sample11):
(sample12):
(sample13):
(sample14):
(sample15):
(sample16):
(sample17):
(sample18):
(sample19):
(sample20):
(sample21):
(sample22):
(sample23):
(executeTest):

  • svg/animations/svg-two-animate-elements-crash-expected.svg: Added.
  • svg/animations/svg-two-animate-elements-crash.svg: Added.
Location:
trunk
Files:
6 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r117709 r117711  
     12012-05-20  Philip Rogers  <pdr@google.com>
     2
     3        Accumulate SVG animations into first contributing element
     4        https://bugs.webkit.org/show_bug.cgi?id=86385
     5
     6        Reviewed by Nikolas Zimmermann.
     7
     8        * svg/animations/multiple-animations-ending-expected.txt: Added.
     9        * svg/animations/multiple-animations-ending.html: Added.
     10        * svg/animations/resources/multiple-animations-ending.svg: Added.
     11        * svg/animations/script-tests/multiple-animations-ending.js: Added.
     12        (sample1):
     13        (sample2):
     14        (sample3):
     15        (sample4):
     16        (sample5):
     17        (sample6):
     18        (sample7):
     19        (sample8):
     20        (sample9):
     21        (sample10):
     22        (sample11):
     23        (sample12):
     24        (sample13):
     25        (sample14):
     26        (sample15):
     27        (sample16):
     28        (sample17):
     29        (sample18):
     30        (sample19):
     31        (sample20):
     32        (sample21):
     33        (sample22):
     34        (sample23):
     35        (executeTest):
     36        * svg/animations/svg-two-animate-elements-crash-expected.svg: Added.
     37        * svg/animations/svg-two-animate-elements-crash.svg: Added.
     38
    1392012-05-20  Philip Rogers  <pdr@google.com>
    240
  • trunk/Source/WebCore/ChangeLog

    r117709 r117711  
     12012-05-20  Philip Rogers  <pdr@google.com>
     2
     3        Accumulate SVG animations into first contributing element
     4        https://bugs.webkit.org/show_bug.cgi?id=86385
     5
     6        Reviewed by Nikolas Zimmermann.
     7
     8        Previously we were accumulating animations into the first animation element when
     9        there were multiple animations for a single element. This crashed if the first
     10        animation ended first because the first animation was prematurely cleaned up.
     11        This change accumulates animations into the first _contributing_ animation element.
     12
     13        Tests: svg/animations/multiple-animations-ending.html
     14               svg/animations/svg-two-animate-elements-crash-expected.svg
     15               svg/animations/svg-two-animate-elements-crash.svg
     16
     17        * svg/animation/SMILTimeContainer.cpp:
     18        (WebCore::SMILTimeContainer::updateAnimations):
     19        * svg/animation/SVGSMILElement.cpp:
     20        (WebCore::SVGSMILElement::progress):
     21
    1222012-05-20  Philip Rogers  <pdr@google.com>
    223
  • trunk/Source/WebCore/svg/animation/SMILTimeContainer.cpp

    r116451 r117711  
    242242        }
    243243       
    244         // Results are accumulated to the first animation that animates a particular element/attribute pair.
     244        // Results are accumulated to the first animation that animates and contributes to a particular element/attribute pair.
    245245        ElementAttributePair key(targetElement, attributeName);
    246246        SVGSMILElement* resultElement = resultsElements.get(key).get();
     247        bool accumulatedResultElement = false;
    247248        if (!resultElement) {
    248249            if (!animation->hasValidAttributeType())
     
    250251            resultElement = animation;
    251252            resultsElements.add(key, resultElement);
     253            accumulatedResultElement = true;
    252254        }
    253255
     
    255257        if (animation->progress(elapsed, resultElement, seekToTime))
    256258            contributingElements.add(resultElement);
     259        else if (accumulatedResultElement)
     260            resultsElements.remove(key);
    257261
    258262        SMILTime nextFireTime = animation->nextProgressTime();
  • trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp

    r117195 r117711  
    10561056    bool animationIsContributing = isContributing(elapsed);
    10571057
    1058     // Only reset the animated type to the base value once for the lowest priority animation that animates a particular element/attribute pair.
    1059     if (this == resultElement)
     1058    // Only reset the animated type to the base value once for the lowest priority animation that animates and contributes to a particular element/attribute pair.
     1059    if (this == resultElement && animationIsContributing)
    10601060        resetAnimatedType();
    10611061
Note: See TracChangeset for help on using the changeset viewer.