Changeset 66339 in webkit


Ignore:
Timestamp:
Aug 29, 2010 4:16:21 PM (14 years ago)
Author:
Simon Fraser
Message:

2010-08-29 Simon Fraser <Simon Fraser>

Reviewed by Darin Adler.

When properties are missing from animation keyframes, interpolate between those keyframes that specify them
https://bugs.webkit.org/show_bug.cgi?id=40794

When a property does not appear in all keyframes of a keyframe animation, we currently use the
value of that property from the unanimated style. That forces the author to use additional
keyframes for properties that need to "skip a keyframe", which is laborious.

With this change, properties are interpolated between the keyframes in which they appear.
This is equivalent to splitting each property out into its own set of keyframes.

Tests: animations/missing-keyframe-properties-repeating.html

animations/missing-keyframe-properties-timing-function.html
animations/missing-keyframe-properties.html

  • css/CSSStyleSelector.h:
  • css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::styleForKeyframe): Pass a KeyframeValue in so that we can collect which properties are represented per keyframe. (WebCore::CSSStyleSelector::keyframeStylesForAnimation): Keyframes are inserted into a KeyframeList by object now, rather than by key and style.
  • page/animation/AnimationBase.cpp: (WebCore::AnimationBase::progress): Use AnimationDirectionAlternate for readability.
  • page/animation/KeyframeAnimation.cpp: (WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty): Renamed from getKeyframeAnimationInterval. Use fractionalTime etc to match AnimationBase::progress(), and do lookups per-property. Simplify the code that finds the relevant keyframe to do less work. (WebCore::KeyframeAnimation::animate): Call fetchIntervalEndpointsForProperty() for each property, rather than just once for the entire keyframe. (WebCore::KeyframeAnimation::getAnimatedStyle): Ditto. (WebCore::KeyframeAnimation::hasAnimationForProperty): FIXME comment.
  • page/animation/KeyframeAnimation.h: Rename getKeyframeAnimationInterval() to fetchIntervalEndpointsForProperty().
  • rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::startAnimation): For hardware animations, only insert values for keyframes which contain the property.

(WebCore::KeyframeList::KeyframeList): insert() takes a KeyframeValue now.

  • rendering/style/KeyframeList.cpp: (WebCore::KeyframeList::operator==): (WebCore::KeyframeList::insert): Fix insert/replace logic, and ensure we maintain the m_properties hash.
  • rendering/style/KeyframeList.h: (WebCore::KeyframeValue::KeyframeValue): Make members private, with accessors. Add a m_properties HashSet for the properties animated in this keyframe.
Location:
trunk
Files:
6 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r66327 r66339  
     12010-08-29  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        When properties are missing from animation keyframes, interpolate between those keyframes that specify them
     6        https://bugs.webkit.org/show_bug.cgi?id=40794
     7
     8        Testcases for keyframes with missing properties; repeating and non-repeating.
     9
     10        * animations/missing-from-to-transforms.html:
     11        * animations/missing-from-to.html:
     12        * animations/missing-keyframe-properties-expected.txt: Added.
     13        * animations/missing-keyframe-properties-repeating-expected.txt: Added.
     14        * animations/missing-keyframe-properties-repeating.html: Added.
     15        * animations/missing-keyframe-properties-timing-function-expected.txt: Added.
     16        * animations/missing-keyframe-properties-timing-function.html: Added.
     17        * animations/missing-keyframe-properties.html: Added.
     18
    1192010-08-28  Darin Adler  <darin@apple.com>
    220
  • trunk/LayoutTests/animations/missing-from-to-transforms.html

    r61933 r66339  
    9090
    9191    runAnimationTest(expectedValues, function() {
    92       if (layoutTestController) {
     92      if (window.layoutTestController) {
    9393          if (layoutTestController.pauseAnimationAtTimeOnElementWithId("anim5", 0.1, "box5"))
    9494              result += "FAIL - box5 animation was running<br>";
  • trunk/LayoutTests/animations/missing-from-to.html

    r61933 r66339  
    8989
    9090    runAnimationTest(expectedValues, function() {
    91       if (layoutTestController) {
     91      if (window.layoutTestController) {
    9292          if (layoutTestController.pauseAnimationAtTimeOnElementWithId("anim5", 0.1, "box5"))
    9393              result += "FAIL - box5 animation was running<br>";
  • trunk/WebCore/ChangeLog

    r66338 r66339  
     12010-08-29  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        When properties are missing from animation keyframes, interpolate between those keyframes that specify them
     6        https://bugs.webkit.org/show_bug.cgi?id=40794
     7       
     8        When a property does not appear in all keyframes of a keyframe animation, we currently use the
     9        value of that property from the unanimated style. That forces the author to use additional
     10        keyframes for properties that need to "skip a keyframe", which is laborious.
     11       
     12        With this change, properties are interpolated between the keyframes in which they appear.
     13        This is equivalent to splitting each property out into its own set of keyframes.
     14
     15        Tests: animations/missing-keyframe-properties-repeating.html
     16               animations/missing-keyframe-properties-timing-function.html
     17               animations/missing-keyframe-properties.html
     18
     19        * css/CSSStyleSelector.h:
     20        * css/CSSStyleSelector.cpp:
     21        (WebCore::CSSStyleSelector::styleForKeyframe): Pass a KeyframeValue in so that we can
     22        collect which properties are represented per keyframe.
     23        (WebCore::CSSStyleSelector::keyframeStylesForAnimation): Keyframes are inserted into a
     24        KeyframeList by object now, rather than by key and style.
     25
     26        * page/animation/AnimationBase.cpp:
     27        (WebCore::AnimationBase::progress): Use AnimationDirectionAlternate for readability.
     28
     29        * page/animation/KeyframeAnimation.cpp:
     30        (WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty): Renamed from getKeyframeAnimationInterval.
     31        Use fractionalTime etc to match AnimationBase::progress(), and do lookups per-property.
     32        Simplify the code that finds the relevant keyframe to do less work.
     33        (WebCore::KeyframeAnimation::animate): Call fetchIntervalEndpointsForProperty() for each property, rather than just once for the
     34        entire keyframe.
     35        (WebCore::KeyframeAnimation::getAnimatedStyle): Ditto.
     36        (WebCore::KeyframeAnimation::hasAnimationForProperty): FIXME comment.
     37
     38        * page/animation/KeyframeAnimation.h: Rename getKeyframeAnimationInterval() to fetchIntervalEndpointsForProperty().
     39
     40        * rendering/RenderLayerBacking.cpp:
     41        (WebCore::RenderLayerBacking::startAnimation): For hardware animations, only insert values
     42        for keyframes which contain the property.
     43
     44        (WebCore::KeyframeList::KeyframeList): insert() takes a KeyframeValue now.
     45        * rendering/style/KeyframeList.cpp:
     46        (WebCore::KeyframeList::operator==):
     47        (WebCore::KeyframeList::insert): Fix insert/replace logic, and ensure we maintain the
     48        m_properties hash.
     49
     50        * rendering/style/KeyframeList.h:
     51        (WebCore::KeyframeValue::KeyframeValue): Make members private, with accessors.
     52        Add a m_properties HashSet for the properties animated in this keyframe.
     53
     54
    1552010-08-29  Csaba Osztrogonác  <ossy@webkit.org>
    256
  • trunk/WebCore/css/CSSStyleSelector.cpp

    r66335 r66339  
    13741374}
    13751375
    1376 PassRefPtr<RenderStyle> CSSStyleSelector::styleForKeyframe(const RenderStyle* elementStyle, const WebKitCSSKeyframeRule* keyframeRule, KeyframeList& list)
     1376PassRefPtr<RenderStyle> CSSStyleSelector::styleForKeyframe(const RenderStyle* elementStyle, const WebKitCSSKeyframeRule* keyframeRule, KeyframeValue& keyframe)
    13771377{
    13781378    if (keyframeRule->style())
     
    14111411    loadPendingImages();
    14121412
    1413     // Add all the animating properties to the list
     1413    // Add all the animating properties to the keyframe.
    14141414    if (keyframeRule->style()) {
    14151415        CSSMutableStyleDeclaration::const_iterator end = keyframeRule->style()->end();
     
    14191419            // describes the timing function between this keyframe and the next.
    14201420            if (property != CSSPropertyWebkitAnimationTimingFunction)
    1421                 list.addProperty(property);
     1421                keyframe.addProperty(property);
    14221422        }
    14231423    }
     
    14401440       
    14411441    const WebKitCSSKeyframesRule* rule = m_keyframesRuleMap.find(list.animationName().impl()).get()->second.get();
    1442     RefPtr<RenderStyle> keyframeStyle;
    14431442   
    14441443    // Construct and populate the style for each keyframe
     
    14491448       
    14501449        const WebKitCSSKeyframeRule* keyframeRule = rule->item(i);
    1451        
    1452         keyframeStyle = styleForKeyframe(elementStyle, keyframeRule, list);
     1450
     1451        KeyframeValue keyframe(0, 0);
     1452        keyframe.setStyle(styleForKeyframe(elementStyle, keyframeRule, keyframe));
    14531453
    14541454        // Add this keyframe style to all the indicated key times
     
    14561456        keyframeRule->getKeys(keys);
    14571457        for (size_t keyIndex = 0; keyIndex < keys.size(); ++keyIndex) {
    1458             float key = keys[keyIndex];
    1459             list.insert(key, keyframeStyle.get());
    1460         }
    1461         keyframeStyle.release();
     1458            keyframe.setKey(keys[keyIndex]);
     1459            list.insert(keyframe);
     1460        }
    14621461    }
    14631462   
     
    14651464    int initialListSize = list.size();
    14661465    if (initialListSize > 0 && list[0].key() != 0) {
    1467         RefPtr<WebKitCSSKeyframeRule> keyframe = WebKitCSSKeyframeRule::create();
    1468         keyframe->setKeyText("0%");
    1469         keyframeStyle = styleForKeyframe(elementStyle, keyframe.get(), list);
    1470         list.insert(0, keyframeStyle.release());
     1466        RefPtr<WebKitCSSKeyframeRule> keyframeRule = WebKitCSSKeyframeRule::create();
     1467        keyframeRule->setKeyText("0%");
     1468        KeyframeValue keyframe(0, 0);
     1469        keyframe.setStyle(styleForKeyframe(elementStyle, keyframeRule.get(), keyframe));
     1470        list.insert(keyframe);
    14711471    }
    14721472
    14731473    // If the 100% keyframe is missing, create it (but only if there is at least one other keyframe)
    14741474    if (initialListSize > 0 && (list[list.size() - 1].key() != 1)) {
    1475         RefPtr<WebKitCSSKeyframeRule> keyframe = WebKitCSSKeyframeRule::create();
    1476         keyframe->setKeyText("100%");
    1477         keyframeStyle = styleForKeyframe(elementStyle, keyframe.get(), list);
    1478         list.insert(1, keyframeStyle.release());
     1475        RefPtr<WebKitCSSKeyframeRule> keyframeRule = WebKitCSSKeyframeRule::create();
     1476        keyframeRule->setKeyText("100%");
     1477        KeyframeValue keyframe(1, 0);
     1478        keyframe.setStyle(styleForKeyframe(elementStyle, keyframeRule.get(), keyframe));
     1479        list.insert(keyframe);
    14791480    }
    14801481}
  • trunk/WebCore/css/CSSStyleSelector.h

    r66334 r66339  
    6060class KURL;
    6161class KeyframeList;
     62class KeyframeValue;
    6263class MediaQueryEvaluator;
    6364class Node;
     
    115116        RenderStyle* style() const { return m_style.get(); }
    116117
    117         PassRefPtr<RenderStyle> styleForKeyframe(const RenderStyle*, const WebKitCSSKeyframeRule*, KeyframeList&);
     118        PassRefPtr<RenderStyle> styleForKeyframe(const RenderStyle*, const WebKitCSSKeyframeRule*, KeyframeValue&);
    118119
    119120    public:
  • trunk/WebCore/page/animation/AnimationBase.cpp

    r63862 r66339  
    12431243    fractionalTime -= integralTime;
    12441244
    1245     if (m_animation->direction() && (integralTime & 1))
     1245    if ((m_animation->direction() == Animation::AnimationDirectionAlternate) && (integralTime & 1))
    12461246        fractionalTime = 1 - fractionalTime;
    12471247
  • trunk/WebCore/page/animation/KeyframeAnimation.cpp

    r66310 r66339  
    6363}
    6464
    65 void KeyframeAnimation::getKeyframeAnimationInterval(const RenderStyle*& fromStyle, const RenderStyle*& toStyle, double& prog) const
     65void KeyframeAnimation::fetchIntervalEndpointsForProperty(int property, const RenderStyle*& fromStyle, const RenderStyle*& toStyle, double& prog) const
    6666{
    6767    // Find the first key
    6868    double elapsedTime = getElapsedTime();
    6969
    70     double t = m_animation->duration() ? (elapsedTime / m_animation->duration()) : 1;
    71 
    72     ASSERT(t >= 0);
    73     if (t < 0)
    74         t = 0;
    75 
    76     int i = static_cast<int>(t);
    77     t -= i;
    78     if (m_animation->direction() && (i & 1))
    79         t = 1 - t;
     70    double fractionalTime = m_animation->duration() ? (elapsedTime / m_animation->duration()) : 1;
     71
     72    ASSERT(fractionalTime >= 0);
     73    if (fractionalTime < 0)
     74        fractionalTime = 0;
     75
     76    // FIXME: share this code with AnimationBase::progress().
     77    int iteration = static_cast<int>(fractionalTime);
     78    fractionalTime -= iteration;
     79   
     80    bool reversing = (m_animation->direction() == Animation::AnimationDirectionAlternate) && (iteration & 1);
     81    if (reversing)
     82        fractionalTime = 1 - fractionalTime;
     83
     84    size_t numKeyframes = m_keyframes.size();
     85    if (!numKeyframes)
     86        return;
     87   
     88    ASSERT(!m_keyframes[0].key());
     89    ASSERT(m_keyframes[m_keyframes.size() - 1].key() == 1);
     90   
     91    int prevIndex = -1;
     92    int nextIndex = -1;
     93   
     94    // FIXME: with a lot of keys, this linear search will be slow. We could binary search.
     95    for (size_t i = 0; i < numKeyframes; ++i) {
     96        const KeyframeValue& currKeyFrame = m_keyframes[i];
     97
     98        if (!currKeyFrame.containsProperty(property))
     99            continue;
     100
     101        if (fractionalTime < currKeyFrame.key()) {
     102            nextIndex = i;
     103            break;
     104        }
     105       
     106        prevIndex = i;
     107    }
    80108
    81109    double scale = 1;
    82110    double offset = 0;
    83     size_t numKeyframes = m_keyframes.size();
    84     for (size_t i = 0; i < numKeyframes; ++i) {
    85         const KeyframeValue& currentKeyframe = m_keyframes[i];
    86         if (t < currentKeyframe.key()) {
    87             // The first key should always be 0, so we should never succeed on the first key
    88             if (!fromStyle)
    89                 break;
    90             scale = 1.0 / (currentKeyframe.key() - offset);
    91             toStyle = currentKeyframe.style();
    92             break;
    93         }
    94 
    95         offset = currentKeyframe.key();
    96         fromStyle = currentKeyframe.style();
    97     }
    98 
    99     if (!fromStyle || !toStyle)
    100         return;
     111
     112    if (prevIndex == -1)
     113        prevIndex = 0;
     114
     115    if (nextIndex == -1)
     116        nextIndex = m_keyframes.size() - 1;
     117
     118    const KeyframeValue& prevKeyframe = m_keyframes[prevIndex];
     119    const KeyframeValue& nextKeyframe = m_keyframes[nextIndex];
     120
     121    fromStyle = prevKeyframe.style();
     122    toStyle = nextKeyframe.style();
     123   
     124    offset = prevKeyframe.key();
     125    scale = 1.0 / (nextKeyframe.key() - prevKeyframe.key());
    101126
    102127    const TimingFunction* timingFunction = 0;
     
    133158    if (waitingToStart() && m_animation->delay() > 0 && !m_animation->fillsBackwards())
    134159        return;
    135 
    136     // FIXME: we need to be more efficient about determining which keyframes we are animating between.
    137     // We should cache the last pair or something.
    138    
    139     // Get the from/to styles and progress between
    140     const RenderStyle* fromStyle = 0;
    141     const RenderStyle* toStyle = 0;
    142     double progress;
    143     getKeyframeAnimationInterval(fromStyle, toStyle, progress);
    144 
    145     // If either style is 0 we have an invalid case, just stop the animation.
    146     if (!fromStyle || !toStyle) {
     160   
     161    // If we have no keyframes, don't animate.
     162    if (!m_keyframes.size()) {
    147163        updateStateMachine(AnimationStateInputEndAnimation, -1);
    148164        return;
     
    154170        animatedStyle = RenderStyle::clone(targetStyle);
    155171
     172    // FIXME: we need to be more efficient about determining which keyframes we are animating between.
     173    // We should cache the last pair or something.
    156174    HashSet<int>::const_iterator endProperties = m_keyframes.endProperties();
    157175    for (HashSet<int>::const_iterator it = m_keyframes.beginProperties(); it != endProperties; ++it) {
    158         bool needsAnim = blendProperties(this, *it, animatedStyle.get(), fromStyle, toStyle, progress);
     176        int property = *it;
     177
     178        // Get the from/to styles and progress between
     179        const RenderStyle* fromStyle = 0;
     180        const RenderStyle* toStyle = 0;
     181        double progress;
     182        fetchIntervalEndpointsForProperty(property, fromStyle, toStyle, progress);
     183   
     184        bool needsAnim = blendProperties(this, property, animatedStyle.get(), fromStyle, toStyle, progress);
    159185        if (needsAnim)
    160186            setAnimating();
     
    177203        return;
    178204
    179     // Get the from/to styles and progress between
    180     const RenderStyle* fromStyle = 0;
    181     const RenderStyle* toStyle = 0;
    182     double progress;
    183     getKeyframeAnimationInterval(fromStyle, toStyle, progress);
    184 
    185     // If either style is 0 we have an invalid case
    186     if (!fromStyle || !toStyle)
     205    if (!m_keyframes.size())
    187206        return;
    188207
     
    191210
    192211    HashSet<int>::const_iterator endProperties = m_keyframes.endProperties();
    193     for (HashSet<int>::const_iterator it = m_keyframes.beginProperties(); it != endProperties; ++it)
    194         blendProperties(this, *it, animatedStyle.get(), fromStyle, toStyle, progress);
     212    for (HashSet<int>::const_iterator it = m_keyframes.beginProperties(); it != endProperties; ++it) {
     213        int property = *it;
     214
     215        // Get the from/to styles and progress between
     216        const RenderStyle* fromStyle = 0;
     217        const RenderStyle* toStyle = 0;
     218        double progress;
     219        fetchIntervalEndpointsForProperty(property, fromStyle, toStyle, progress);
     220
     221        blendProperties(this, property, animatedStyle.get(), fromStyle, toStyle, progress);
     222    }
    195223}
    196224
    197225bool KeyframeAnimation::hasAnimationForProperty(int property) const
    198226{
     227    // FIXME: why not just m_keyframes.containsProperty()?
    199228    HashSet<int>::const_iterator end = m_keyframes.endProperties();
    200229    for (HashSet<int>::const_iterator it = m_keyframes.beginProperties(); it != end; ++it) {
  • trunk/WebCore/page/animation/KeyframeAnimation.h

    r52017 r66339  
    8383    virtual ~KeyframeAnimation();
    8484   
    85     // Get the styles surrounding the current animation time and the progress between them
    86     void getKeyframeAnimationInterval(const RenderStyle*& fromStyle, const RenderStyle*& toStyle, double& progress) const;
     85    // Get the styles for the given property surrounding the current animation time and the progress between them.
     86    void fetchIntervalEndpointsForProperty(int property, const RenderStyle*& fromStyle, const RenderStyle*& toStyle, double& progress) const;
    8787
    8888    // The keyframes that we are blending.
  • trunk/WebCore/rendering/RenderLayerBacking.cpp

    r66310 r66339  
    11271127        const TimingFunction* tf = keyframeStyle->hasAnimations() ? &((*keyframeStyle->animations()).animation(0)->timingFunction()) : 0;
    11281128       
    1129         if (hasTransform)
     1129        if (currentKeyframe.containsProperty(AnimatedPropertyWebkitTransform))
    11301130            transformVector.insert(new TransformAnimationValue(key, &(keyframeStyle->transform()), tf));
    11311131       
    1132         if (hasOpacity)
     1132        if (currentKeyframe.containsProperty(AnimatedPropertyOpacity))
    11331133            opacityVector.insert(new FloatAnimationValue(key, keyframeStyle->opacity(), tf));
    11341134    }
  • trunk/WebCore/rendering/style/KeyframeList.cpp

    r37637 r66339  
    4444    Vector<KeyframeValue>::const_iterator it2 = o.m_keyframes.begin();
    4545    for (Vector<KeyframeValue>::const_iterator it1 = m_keyframes.begin(); it1 != m_keyframes.end(); ++it1) {
    46         if (it1->m_key != it2->m_key)
     46        if (it1->key() != it2->key())
    4747            return false;
    48         const RenderStyle& style1 = *it1->m_style;
    49         const RenderStyle& style2 = *it2->m_style;
     48        const RenderStyle& style1 = *it1->style();
     49        const RenderStyle& style2 = *it2->style();
    5050        if (style1 != style2)
    5151            return false;
     
    5656}
    5757
    58 void KeyframeList::insert(float key, PassRefPtr<RenderStyle> style)
     58void KeyframeList::insert(const KeyframeValue& keyframe)
    5959{
    60     if (key < 0 || key > 1)
     60    if (keyframe.key() < 0 || keyframe.key() > 1)
    6161        return;
    6262
    63     int index = -1;
    64    
     63    bool inserted = false;
     64    bool replaced = false;
    6565    for (size_t i = 0; i < m_keyframes.size(); ++i) {
    66         if (m_keyframes[i].m_key == key) {
    67             index = (int) i;
     66        if (m_keyframes[i].key() == keyframe.key()) {
     67            m_keyframes[i] = keyframe;
     68            replaced = true;
    6869            break;
    6970        }
    70         if (m_keyframes[i].m_key > key) {
     71
     72        if (m_keyframes[i].key() > keyframe.key()) {
    7173            // insert before
    72             m_keyframes.insert(i, KeyframeValue());
    73             index = (int) i;
     74            m_keyframes.insert(i, keyframe);
     75            inserted = true;
    7476            break;
    7577        }
    7678    }
    7779   
    78     if (index < 0) {
    79         // append
    80         index = (int) m_keyframes.size();
    81         m_keyframes.append(KeyframeValue());
     80    if (!replaced && !inserted)
     81        m_keyframes.append(keyframe);
     82
     83    if (replaced) {
     84        // We have to rebuild the properties list from scratch.
     85        m_properties.clear();
     86        for (Vector<KeyframeValue>::const_iterator it = m_keyframes.begin(); it != m_keyframes.end(); ++it) {
     87            const KeyframeValue& currKeyframe = *it;
     88            for (HashSet<int>::const_iterator it = currKeyframe.properties().begin(); it != currKeyframe.properties().end(); ++it)
     89                m_properties.add(*it);
     90        }
     91    } else {
     92        for (HashSet<int>::const_iterator it = keyframe.properties().begin(); it != keyframe.properties().end(); ++it)
     93            m_properties.add(*it);
    8294    }
    83    
    84     m_keyframes[index].m_key = key;
    85     m_keyframes[index].m_style = style;
    8695}
    8796
  • trunk/WebCore/rendering/style/KeyframeList.h

    r66310 r66339  
    3838class KeyframeValue {
    3939public:
    40     KeyframeValue()
    41         : m_key(-1)
     40    KeyframeValue(float key, PassRefPtr<RenderStyle> style)
     41        : m_key(key)
     42        , m_style(style)
    4243    {
    4344    }
    4445
     46    void addProperty(int prop) { m_properties.add(prop); }
     47    bool containsProperty(int prop) const { return m_properties.contains(prop); }
     48    const HashSet<int>& properties() const { return m_properties; }
     49
    4550    float key() const { return m_key; }
     51    void setKey(float key) { m_key = key; }
     52
    4653    const RenderStyle* style() const { return m_style.get(); }
     54    void setStyle(PassRefPtr<RenderStyle> style) { m_style = style; }
    4755
     56private:
    4857    float m_key;
     58    HashSet<int> m_properties; // The properties specified in this keyframe.
    4959    RefPtr<RenderStyle> m_style;
    5060};
     
    5666        , m_renderer(renderer)
    5767    {
    58         insert(0, 0);
    59         insert(1, 0);
     68        insert(KeyframeValue(0, 0));
     69        insert(KeyframeValue(1, 0));
    6070    }
    6171    ~KeyframeList();
     
    6676    const AtomicString& animationName() const { return m_animationName; }
    6777   
    68     void insert(float key, PassRefPtr<RenderStyle> style);
     78    void insert(const KeyframeValue& keyframe);
    6979   
    7080    void addProperty(int prop) { m_properties.add(prop); }
     
    8090private:
    8191    AtomicString m_animationName;
    82     Vector<KeyframeValue> m_keyframes;
    83     HashSet<int> m_properties;       // the properties being animated
     92    Vector<KeyframeValue> m_keyframes; // kept sorted by key
     93    HashSet<int> m_properties; // the properties being animated
    8494    RenderObject* m_renderer;
    8595};
Note: See TracChangeset for help on using the changeset viewer.