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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); | 78 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); |
79 | 79 |
80 // FIXME: This test will not be neccessary once resolution of keyframe value
s occurs at | 80 // FIXME: This test will not be neccessary once resolution of keyframe value
s occurs at |
81 // animation application time. | 81 // animation application time. |
82 if (!checkDocumentAndRenderer(element)) | 82 if (!checkDocumentAndRenderer(element)) |
83 return nullptr; | 83 return nullptr; |
84 | 84 |
85 return createUnsafe(element, keyframeDictionaryVector, timingInput); | 85 return createUnsafe(element, keyframeDictionaryVector, timingInput); |
86 } | 86 } |
87 | 87 |
88 PassRefPtr<Animation> Animation::create(Element* element, Vector<Dictionary> key
frameDictionaryVector) | |
89 { | |
90 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); | |
91 | |
92 // FIXME: This test will not be neccessary once resolution of keyframe value
s occurs at | |
93 // animation application time. | |
94 if (!checkDocumentAndRenderer(element)) | |
95 return nullptr; | |
96 | |
97 return createUnsafe(element, keyframeDictionaryVector); | |
98 } | |
99 | |
100 void Animation::setStartDelay(Timing& timing, double startDelay) | 88 void Animation::setStartDelay(Timing& timing, double startDelay) |
101 { | 89 { |
102 if (std::isfinite(startDelay)) | 90 if (std::isfinite(startDelay)) |
103 timing.startDelay = startDelay; | 91 timing.startDelay = startDelay; |
104 else | 92 else |
105 timing.startDelay = 0; | 93 timing.startDelay = 0; |
106 } | 94 } |
107 | 95 |
108 void Animation::setEndDelay(Timing& timing, double endDelay) | 96 void Animation::setEndDelay(Timing& timing, double endDelay) |
109 { | 97 { |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 { | 290 { |
303 RefPtrWillBeRawPtr<KeyframeEffectModel> effect = createKeyframeEffectModel(e
lement, keyframeDictionaryVector); | 291 RefPtrWillBeRawPtr<KeyframeEffectModel> effect = createKeyframeEffectModel(e
lement, keyframeDictionaryVector); |
304 | 292 |
305 Timing timing; | 293 Timing timing; |
306 if (!std::isnan(timingInput)) | 294 if (!std::isnan(timingInput)) |
307 timing.iterationDuration = std::max<double>(timingInput, 0); | 295 timing.iterationDuration = std::max<double>(timingInput, 0); |
308 | 296 |
309 return create(element, effect, timing); | 297 return create(element, effect, timing); |
310 } | 298 } |
311 | 299 |
312 PassRefPtr<Animation> Animation::createUnsafe(Element* element, Vector<Dictionar
y> keyframeDictionaryVector) | |
313 { | |
314 RefPtrWillBeRawPtr<KeyframeEffectModel> effect = createKeyframeEffectModel(e
lement, keyframeDictionaryVector); | |
315 Timing timing; | |
316 | |
317 return create(element, effect, timing); | |
318 } | |
319 | |
320 Animation::Animation(PassRefPtr<Element> target, PassRefPtrWillBeRawPtr<Animatio
nEffect> effect, const Timing& timing, Priority priority, PassOwnPtr<EventDelega
te> eventDelegate) | 300 Animation::Animation(PassRefPtr<Element> target, PassRefPtrWillBeRawPtr<Animatio
nEffect> effect, const Timing& timing, Priority priority, PassOwnPtr<EventDelega
te> eventDelegate) |
321 : TimedItem(timing, eventDelegate) | 301 : TimedItem(timing, eventDelegate) |
322 , m_target(target) | 302 , m_target(target) |
323 , m_effect(effect) | 303 , m_effect(effect) |
324 , m_activeInAnimationStack(false) | 304 , m_activeInAnimationStack(false) |
325 , m_priority(priority) | 305 , m_priority(priority) |
326 { | 306 { |
327 } | 307 } |
328 | 308 |
329 void Animation::didAttach() | 309 void Animation::didAttach() |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 void Animation::pauseAnimationForTestingOnCompositor(double pauseTime) | 458 void Animation::pauseAnimationForTestingOnCompositor(double pauseTime) |
479 { | 459 { |
480 ASSERT(hasActiveAnimationsOnCompositor()); | 460 ASSERT(hasActiveAnimationsOnCompositor()); |
481 if (!m_target || !m_target->renderer()) | 461 if (!m_target || !m_target->renderer()) |
482 return; | 462 return; |
483 for (size_t i = 0; i < m_compositorAnimationIds.size(); ++i) | 463 for (size_t i = 0; i < m_compositorAnimationIds.size(); ++i) |
484 CompositorAnimations::instance()->pauseAnimationForTestingOnCompositor(*
m_target.get(), m_compositorAnimationIds[i], pauseTime); | 464 CompositorAnimations::instance()->pauseAnimationForTestingOnCompositor(*
m_target.get(), m_compositorAnimationIds[i], pauseTime); |
485 } | 465 } |
486 | 466 |
487 } // namespace WebCore | 467 } // namespace WebCore |
OLD | NEW |