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

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

Issue 190763007: [WIP] Web Animations API: Constructing an Animation from partial keyframes throws a JS exception (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Replace manual checks with check for dependsOnUnderlyingValue Created 6 years, 9 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
« no previous file with comments | « Source/core/animation/KeyframeEffectModel.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 } 261 }
262 } 262 }
263 263
264 // Add synthetic keyframes. 264 // Add synthetic keyframes.
265 for (KeyframeGroupMap::iterator iter = m_keyframeGroups->begin(); iter != m_ keyframeGroups->end(); ++iter) { 265 for (KeyframeGroupMap::iterator iter = m_keyframeGroups->begin(); iter != m_ keyframeGroups->end(); ++iter) {
266 iter->value->addSyntheticKeyframeIfRequired(); 266 iter->value->addSyntheticKeyframeIfRequired();
267 iter->value->removeRedundantKeyframes(); 267 iter->value->removeRedundantKeyframes();
268 } 268 }
269 } 269 }
270 270
271 bool KeyframeEffectModel::isReplaceOnly()
272 {
273 ensureKeyframeGroups();
274 for (KeyframeGroupMap::iterator iter = m_keyframeGroups->begin(); iter != m_ keyframeGroups->end(); ++iter) {
275 const PropertySpecificKeyframeVector& keyframeVector = iter->value->keyf rames();
276 for (size_t i = 0; i < keyframeVector.size(); ++i) {
277 if (keyframeVector[i]->value()->dependsOnUnderlyingValue()) {
278 return false;
279 }
280 }
281 }
282 return true;
283 }
271 284
272 KeyframeEffectModel::PropertySpecificKeyframe::PropertySpecificKeyframe(double o ffset, PassRefPtr<TimingFunction> easing, const AnimatableValue* value, Composit eOperation composite) 285 KeyframeEffectModel::PropertySpecificKeyframe::PropertySpecificKeyframe(double o ffset, PassRefPtr<TimingFunction> easing, const AnimatableValue* value, Composit eOperation composite)
273 : m_offset(offset) 286 : m_offset(offset)
274 , m_easing(easing) 287 , m_easing(easing)
275 , m_value(composite == AnimationEffect::CompositeReplace ? 288 , m_value(composite == AnimationEffect::CompositeReplace ?
276 AnimatableValue::takeConstRef(value) : 289 AnimatableValue::takeConstRef(value) :
277 static_cast<PassRefPtr<CompositableValue> >(AddCompositableValue::create (value))) 290 static_cast<PassRefPtr<CompositableValue> >(AddCompositableValue::create (value)))
278 { 291 {
279 } 292 }
280 293
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 fraction = timingFunction->evaluate(fraction, accuracyForKeyframeEasing) ; 401 fraction = timingFunction->evaluate(fraction, accuracyForKeyframeEasing) ;
389 return BlendedCompositableValue::create((*before)->value(), (*after)->value( ), fraction); 402 return BlendedCompositableValue::create((*before)->value(), (*after)->value( ), fraction);
390 } 403 }
391 404
392 void KeyframeEffectModel::trace(Visitor* visitor) 405 void KeyframeEffectModel::trace(Visitor* visitor)
393 { 406 {
394 visitor->trace(m_keyframes); 407 visitor->trace(m_keyframes);
395 } 408 }
396 409
397 } // namespace 410 } // namespace
OLDNEW
« no previous file with comments | « Source/core/animation/KeyframeEffectModel.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698