Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: Source/core/animation/KeyframeAnimationEffect.cpp

Issue 23875044: Web Animations: Correctly handle incomplete keyframes in CSS animations (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Handle end keyframes first Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 Keyframe::Keyframe() 117 Keyframe::Keyframe()
118 : m_offset(std::numeric_limits<double>::quiet_NaN()) 118 : m_offset(std::numeric_limits<double>::quiet_NaN())
119 , m_composite(AnimationEffect::CompositeReplace) 119 , m_composite(AnimationEffect::CompositeReplace)
120 { } 120 { }
121 121
122 void Keyframe::setPropertyValue(CSSPropertyID property, const AnimatableValue* v alue) 122 void Keyframe::setPropertyValue(CSSPropertyID property, const AnimatableValue* v alue)
123 { 123 {
124 m_propertyValues.add(property, const_cast<AnimatableValue*>(value)); 124 m_propertyValues.add(property, const_cast<AnimatableValue*>(value));
125 } 125 }
126 126
127 void Keyframe::clearPropertyValue(CSSPropertyID property)
128 {
129 m_propertyValues.remove(property);
130 }
131
127 const AnimatableValue* Keyframe::propertyValue(CSSPropertyID property) const 132 const AnimatableValue* Keyframe::propertyValue(CSSPropertyID property) const
128 { 133 {
129 ASSERT(m_propertyValues.contains(property)); 134 ASSERT(m_propertyValues.contains(property));
130 return m_propertyValues.get(property); 135 return m_propertyValues.get(property);
131 } 136 }
132 137
133 PropertySet Keyframe::properties() const 138 PropertySet Keyframe::properties() const
134 { 139 {
135 // This is only used when setting up the keyframe groups, so there's no 140 // This is only used when setting up the keyframe groups, so there's no
136 // need to cache the result. 141 // need to cache the result.
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 330
326 if ((*before)->offset() == offset) 331 if ((*before)->offset() == offset)
327 return const_cast<CompositableValue*>((*before)->value()); 332 return const_cast<CompositableValue*>((*before)->value());
328 if ((*after)->offset() == offset) 333 if ((*after)->offset() == offset)
329 return const_cast<CompositableValue*>((*after)->value()); 334 return const_cast<CompositableValue*>((*after)->value());
330 return BlendedCompositableValue::create((*before)->value(), (*after)->value( ), 335 return BlendedCompositableValue::create((*before)->value(), (*after)->value( ),
331 (offset - (*before)->offset()) / ((*after)->offset() - (*before)->offset ())); 336 (offset - (*before)->offset()) / ((*after)->offset() - (*before)->offset ()));
332 } 337 }
333 338
334 } // namespace 339 } // namespace
OLDNEW
« no previous file with comments | « Source/core/animation/KeyframeAnimationEffect.h ('k') | Source/core/animation/css/CSSAnimations.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698