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

Side by Side Diff: third_party/WebKit/Source/core/animation/TimingCalculations.h

Issue 1933113002: Web Animations: Clip animation active intervals if endDelay is negative (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « third_party/WebKit/Source/core/animation/KeyframeEffect.cpp ('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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 ASSERT(!isNull(x)); 43 ASSERT(!isNull(x));
44 ASSERT(!isNull(y)); 44 ASSERT(!isNull(y));
45 return x && y ? x * y : 0; 45 return x && y ? x * y : 0;
46 } 46 }
47 47
48 static inline AnimationEffect::Phase calculatePhase(double activeDuration, doubl e localTime, const Timing& specified) 48 static inline AnimationEffect::Phase calculatePhase(double activeDuration, doubl e localTime, const Timing& specified)
49 { 49 {
50 ASSERT(activeDuration >= 0); 50 ASSERT(activeDuration >= 0);
51 if (isNull(localTime)) 51 if (isNull(localTime))
52 return AnimationEffect::PhaseNone; 52 return AnimationEffect::PhaseNone;
53 if (localTime < specified.startDelay) 53 double endTime = specified.startDelay + activeDuration + specified.endDelay;
54 if (localTime < std::min(specified.startDelay, endTime))
54 return AnimationEffect::PhaseBefore; 55 return AnimationEffect::PhaseBefore;
55 if (localTime >= specified.startDelay + activeDuration) 56 if (localTime >= std::min(specified.startDelay + activeDuration, endTime))
56 return AnimationEffect::PhaseAfter; 57 return AnimationEffect::PhaseAfter;
57 return AnimationEffect::PhaseActive; 58 return AnimationEffect::PhaseActive;
58 } 59 }
59 60
60 static inline bool isActiveInParentPhase(AnimationEffect::Phase parentPhase, Tim ing::FillMode fillMode) 61 static inline bool isActiveInParentPhase(AnimationEffect::Phase parentPhase, Tim ing::FillMode fillMode)
61 { 62 {
62 switch (parentPhase) { 63 switch (parentPhase) {
63 case AnimationEffect::PhaseBefore: 64 case AnimationEffect::PhaseBefore:
64 return fillMode == Timing::FillModeBackwards || fillMode == Timing::Fill ModeBoth; 65 return fillMode == Timing::FillModeBackwards || fillMode == Timing::Fill ModeBoth;
65 case AnimationEffect::PhaseActive: 66 case AnimationEffect::PhaseActive:
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 if (!std::isfinite(iterationDuration)) 197 if (!std::isfinite(iterationDuration))
197 return directedTime; 198 return directedTime;
198 double timeFraction = directedTime / iterationDuration; 199 double timeFraction = directedTime / iterationDuration;
199 ASSERT(timeFraction >= 0 && timeFraction <= 1); 200 ASSERT(timeFraction >= 0 && timeFraction <= 1);
200 return multiplyZeroAlwaysGivesZero(iterationDuration, specified.timingFuncti on->evaluate(timeFraction, accuracyForDuration(iterationDuration))); 201 return multiplyZeroAlwaysGivesZero(iterationDuration, specified.timingFuncti on->evaluate(timeFraction, accuracyForDuration(iterationDuration)));
201 } 202 }
202 203
203 } // namespace blink 204 } // namespace blink
204 205
205 #endif 206 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/animation/KeyframeEffect.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698