Chromium Code Reviews| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 51 KeyframeEffect* KeyframeEffect::create(Element* target, EffectModel* model, cons t Timing& timing, Priority priority, EventDelegate* eventDelegate) | 51 KeyframeEffect* KeyframeEffect::create(Element* target, EffectModel* model, cons t Timing& timing, Priority priority, EventDelegate* eventDelegate) |
| 52 { | 52 { |
| 53 return new KeyframeEffect(target, model, timing, priority, eventDelegate); | 53 return new KeyframeEffect(target, model, timing, priority, eventDelegate); |
| 54 } | 54 } |
| 55 | 55 |
| 56 KeyframeEffect* KeyframeEffect::create(ExecutionContext* executionContext, Eleme nt* element, const EffectModelOrDictionarySequenceOrDictionary& effectInput, dou ble duration, ExceptionState& exceptionState) | 56 KeyframeEffect* KeyframeEffect::create(ExecutionContext* executionContext, Eleme nt* element, const EffectModelOrDictionarySequenceOrDictionary& effectInput, dou ble duration, ExceptionState& exceptionState) |
| 57 { | 57 { |
| 58 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); | 58 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); |
| 59 if (element) | 59 if (element) |
| 60 UseCounter::count(element->document(), UseCounter::AnimationConstructorK eyframeListEffectObjectTiming); | 60 UseCounter::count(element->document(), UseCounter::AnimationConstructorK eyframeListEffectObjectTiming); |
| 61 return create(element, EffectInput::convert(element, effectInput, executionC ontext, exceptionState), TimingInput::convert(duration)); | 61 Timing timing; |
| 62 ASSERT(TimingInput::convert(duration, timing)); | |
|
alancutter (OOO until 2018)
2016/04/05 04:50:06
ASSERTs don't get compiled into official builds, y
suzyh_UTC10 (ex-contributor)
2016/04/12 08:04:23
Fixed.
| |
| 63 return create(element, EffectInput::convert(element, effectInput, executionC ontext, exceptionState), timing); | |
| 62 } | 64 } |
| 65 | |
| 63 KeyframeEffect* KeyframeEffect::create(ExecutionContext* executionContext, Eleme nt* element, const EffectModelOrDictionarySequenceOrDictionary& effectInput, con st KeyframeEffectOptions& timingInput, ExceptionState& exceptionState) | 66 KeyframeEffect* KeyframeEffect::create(ExecutionContext* executionContext, Eleme nt* element, const EffectModelOrDictionarySequenceOrDictionary& effectInput, con st KeyframeEffectOptions& timingInput, ExceptionState& exceptionState) |
| 64 { | 67 { |
| 65 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); | 68 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); |
| 66 if (element) | 69 if (element) |
| 67 UseCounter::count(element->document(), UseCounter::AnimationConstructorK eyframeListEffectObjectTiming); | 70 UseCounter::count(element->document(), UseCounter::AnimationConstructorK eyframeListEffectObjectTiming); |
| 68 return create(element, EffectInput::convert(element, effectInput, executionC ontext, exceptionState), TimingInput::convert(timingInput)); | 71 Timing timing; |
| 72 bool success = TimingInput::convert(timingInput, timing, exceptionState); | |
| 73 if (!success || exceptionState.hadException()) | |
| 74 return nullptr; | |
| 75 | |
| 76 return create(element, EffectInput::convert(element, effectInput, executionC ontext, exceptionState), timing); | |
| 69 } | 77 } |
| 78 | |
| 70 KeyframeEffect* KeyframeEffect::create(ExecutionContext* executionContext, Eleme nt* element, const EffectModelOrDictionarySequenceOrDictionary& effectInput, Exc eptionState& exceptionState) | 79 KeyframeEffect* KeyframeEffect::create(ExecutionContext* executionContext, Eleme nt* element, const EffectModelOrDictionarySequenceOrDictionary& effectInput, Exc eptionState& exceptionState) |
| 71 { | 80 { |
| 72 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); | 81 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); |
| 73 if (element) | 82 if (element) |
| 74 UseCounter::count(element->document(), UseCounter::AnimationConstructorK eyframeListEffectNoTiming); | 83 UseCounter::count(element->document(), UseCounter::AnimationConstructorK eyframeListEffectNoTiming); |
| 75 return create(element, EffectInput::convert(element, effectInput, executionC ontext, exceptionState), Timing()); | 84 return create(element, EffectInput::convert(element, effectInput, executionC ontext, exceptionState), Timing()); |
| 76 } | 85 } |
| 77 | 86 |
| 78 KeyframeEffect::KeyframeEffect(Element* target, EffectModel* model, const Timing & timing, Priority priority, EventDelegate* eventDelegate) | 87 KeyframeEffect::KeyframeEffect(Element* target, EffectModel* model, const Timing & timing, Priority priority, EventDelegate* eventDelegate) |
| 79 : AnimationEffect(timing, eventDelegate) | 88 : AnimationEffect(timing, eventDelegate) |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 379 | 388 |
| 380 DEFINE_TRACE(KeyframeEffect) | 389 DEFINE_TRACE(KeyframeEffect) |
| 381 { | 390 { |
| 382 visitor->trace(m_target); | 391 visitor->trace(m_target); |
| 383 visitor->trace(m_model); | 392 visitor->trace(m_model); |
| 384 visitor->trace(m_sampledEffect); | 393 visitor->trace(m_sampledEffect); |
| 385 AnimationEffect::trace(visitor); | 394 AnimationEffect::trace(visitor); |
| 386 } | 395 } |
| 387 | 396 |
| 388 } // namespace blink | 397 } // namespace blink |
| OLD | NEW |