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

Side by Side Diff: third_party/WebKit/Source/core/animation/css/CSSAnimations.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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 if (AnimatableValue::usesDefaultInterpolation(to.get(), from.get())) 532 if (AnimatableValue::usesDefaultInterpolation(to.get(), from.get()))
533 return; 533 return;
534 534
535 Timing timing = transitionData.convertToTiming(transitionIndex); 535 Timing timing = transitionData.convertToTiming(transitionIndex);
536 if (timing.startDelay + timing.iterationDuration <= 0) 536 if (timing.startDelay + timing.iterationDuration <= 0)
537 return; 537 return;
538 538
539 AnimatableValue* reversingAdjustedStartValue = from.get(); 539 AnimatableValue* reversingAdjustedStartValue = from.get();
540 double reversingShorteningFactor = 1; 540 double reversingShorteningFactor = 1;
541 if (interruptedTransition) { 541 if (interruptedTransition) {
542 const double interruptedTimeFraction = interruptedTransition->animation- >effect()->timeFraction(); 542 const double interruptedProgress = interruptedTransition->animation->eff ect()->progress();
543 if (!std::isnan(interruptedTimeFraction)) { 543 if (!std::isnan(interruptedProgress)) {
544 // const_cast because we need to take a ref later when passing to st artTransition. 544 // const_cast because we need to take a ref later when passing to st artTransition.
545 reversingAdjustedStartValue = const_cast<AnimatableValue*>(interrupt edTransition->to); 545 reversingAdjustedStartValue = const_cast<AnimatableValue*>(interrupt edTransition->to);
546 reversingShorteningFactor = clampTo( 546 reversingShorteningFactor = clampTo(
547 (interruptedTimeFraction * interruptedTransition->reversingShort eningFactor) + 547 (interruptedProgress * interruptedTransition->reversingShortenin gFactor) +
548 (1 - interruptedTransition->reversingShorteningFactor), 0.0, 1.0 ); 548 (1 - interruptedTransition->reversingShorteningFactor), 0.0, 1.0 );
549 timing.iterationDuration *= reversingShorteningFactor; 549 timing.iterationDuration *= reversingShorteningFactor;
550 if (timing.startDelay < 0) { 550 if (timing.startDelay < 0) {
551 timing.startDelay *= reversingShorteningFactor; 551 timing.startDelay *= reversingShorteningFactor;
552 } 552 }
553 } 553 }
554 } 554 }
555 555
556 AnimatableValueKeyframeVector keyframes; 556 AnimatableValueKeyframeVector keyframes;
557 double startKeyframeOffset = 0; 557 double startKeyframeOffset = 0;
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 } 868 }
869 869
870 DEFINE_TRACE(CSSAnimations) 870 DEFINE_TRACE(CSSAnimations)
871 { 871 {
872 visitor->trace(m_transitions); 872 visitor->trace(m_transitions);
873 visitor->trace(m_pendingUpdate); 873 visitor->trace(m_pendingUpdate);
874 visitor->trace(m_runningAnimations); 874 visitor->trace(m_runningAnimations);
875 } 875 }
876 876
877 } // namespace blink 877 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698