| OLD | NEW |
| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 PlaybackDirectionAlternate, | 52 PlaybackDirectionAlternate, |
| 53 PlaybackDirectionAlternateReverse | 53 PlaybackDirectionAlternateReverse |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 Timing() | 56 Timing() |
| 57 : startDelay(0) | 57 : startDelay(0) |
| 58 , endDelay(0) | 58 , endDelay(0) |
| 59 , fillMode(FillModeAuto) | 59 , fillMode(FillModeAuto) |
| 60 , iterationStart(0) | 60 , iterationStart(0) |
| 61 , iterationCount(1) | 61 , iterationCount(1) |
| 62 , iterationDuration(std::numeric_limits<double>::quiet_NaN()) | 62 , iterationDuration(initialIterationDuration()) |
| 63 , playbackRate(1) | 63 , playbackRate(1) |
| 64 , direction(PlaybackDirectionNormal) | 64 , direction(PlaybackDirectionNormal) |
| 65 , timingFunction(LinearTimingFunction::create()) | 65 , timingFunction(LinearTimingFunction::create()) |
| 66 { | 66 { |
| 67 } | 67 } |
| 68 | 68 |
| 69 static double initialIterationDuration() { return std::numeric_limits<double
>::quiet_NaN(); } |
| 70 |
| 69 void assertValid() const | 71 void assertValid() const |
| 70 { | 72 { |
| 71 ASSERT(std::isfinite(startDelay)); | 73 ASSERT(std::isfinite(startDelay)); |
| 72 ASSERT(std::isfinite(endDelay)); | 74 ASSERT(std::isfinite(endDelay)); |
| 73 ASSERT(std::isfinite(iterationStart)); | 75 ASSERT(std::isfinite(iterationStart)); |
| 74 ASSERT(iterationStart >= 0); | 76 ASSERT(iterationStart >= 0); |
| 75 ASSERT(iterationCount >= 0); | 77 ASSERT(iterationCount >= 0); |
| 76 ASSERT(std::isnan(iterationDuration) || iterationDuration >= 0); | 78 ASSERT(std::isnan(iterationDuration) || iterationDuration >= 0); |
| 77 ASSERT(std::isfinite(playbackRate)); | 79 ASSERT(std::isfinite(playbackRate)); |
| 78 ASSERT(timingFunction); | 80 ASSERT(timingFunction); |
| 79 } | 81 } |
| 80 | 82 |
| 81 double startDelay; | 83 double startDelay; |
| 82 double endDelay; | 84 double endDelay; |
| 83 FillMode fillMode; | 85 FillMode fillMode; |
| 84 double iterationStart; | 86 double iterationStart; |
| 85 double iterationCount; | 87 double iterationCount; |
| 86 double iterationDuration; | 88 double iterationDuration; |
| 87 // FIXME: Add activeDuration. | 89 // FIXME: Add activeDuration. |
| 88 double playbackRate; | 90 double playbackRate; |
| 89 PlaybackDirection direction; | 91 PlaybackDirection direction; |
| 90 RefPtr<TimingFunction> timingFunction; | 92 RefPtr<TimingFunction> timingFunction; |
| 91 }; | 93 }; |
| 92 | 94 |
| 93 } // namespace WebCore | 95 } // namespace WebCore |
| 94 | 96 |
| 95 #endif | 97 #endif |
| OLD | NEW |