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

Side by Side Diff: third_party/WebKit/Source/core/animation/KeyframeEffect.cpp

Issue 1944603003: Make AnimationEffectReadOnly.getComputedTiming() consistent with Web Animations spec (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 7 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
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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 if (!m_target || !m_model) 176 if (!m_target || !m_model)
177 return; 177 return;
178 178
179 if (hasIncompatibleStyle()) 179 if (hasIncompatibleStyle())
180 animation()->cancelAnimationOnCompositor(); 180 animation()->cancelAnimationOnCompositor();
181 181
182 double iteration = currentIteration(); 182 double iteration = currentIteration();
183 ASSERT(iteration >= 0); 183 ASSERT(iteration >= 0);
184 bool changed = false; 184 bool changed = false;
185 if (m_sampledEffect) { 185 if (m_sampledEffect) {
186 changed = m_model->sample(clampTo<int>(iteration, 0), timeFraction(), it erationDuration(), m_sampledEffect->mutableInterpolations()); 186 changed = m_model->sample(clampTo<int>(iteration, 0), progress(), iterat ionDuration(), m_sampledEffect->mutableInterpolations());
187 } else { 187 } else {
188 Vector<RefPtr<Interpolation>> interpolations; 188 Vector<RefPtr<Interpolation>> interpolations;
189 m_model->sample(clampTo<int>(iteration, 0), timeFraction(), iterationDur ation(), interpolations); 189 m_model->sample(clampTo<int>(iteration, 0), progress(), iterationDuratio n(), interpolations);
190 if (!interpolations.isEmpty()) { 190 if (!interpolations.isEmpty()) {
191 SampledEffect* sampledEffect = SampledEffect::create(this); 191 SampledEffect* sampledEffect = SampledEffect::create(this);
192 sampledEffect->mutableInterpolations().swap(interpolations); 192 sampledEffect->mutableInterpolations().swap(interpolations);
193 m_sampledEffect = sampledEffect; 193 m_sampledEffect = sampledEffect;
194 ensureAnimationStack(m_target).add(sampledEffect); 194 ensureAnimationStack(m_target).add(sampledEffect);
195 changed = true; 195 changed = true;
196 } else { 196 } else {
197 return; 197 return;
198 } 198 }
199 } 199 }
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 371
372 DEFINE_TRACE(KeyframeEffect) 372 DEFINE_TRACE(KeyframeEffect)
373 { 373 {
374 visitor->trace(m_target); 374 visitor->trace(m_target);
375 visitor->trace(m_model); 375 visitor->trace(m_model);
376 visitor->trace(m_sampledEffect); 376 visitor->trace(m_sampledEffect);
377 AnimationEffect::trace(visitor); 377 AnimationEffect::trace(visitor);
378 } 378 }
379 379
380 } // namespace blink 380 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698