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

Unified Diff: third_party/WebKit/Source/core/animation/KeyframeEffect.cpp

Issue 2047293002: Code cleanup: Replace Element with Document in element.animate() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_killForceConversionsToAnimatableValues
Patch Set: Fix unit test crash. Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/animation/KeyframeEffect.cpp
diff --git a/third_party/WebKit/Source/core/animation/KeyframeEffect.cpp b/third_party/WebKit/Source/core/animation/KeyframeEffect.cpp
index 5d480edfc656d7ccdf24d6886d5609b8ca6e5a16..488143acad3322fafab3882d91f406c778d53ac4 100644
--- a/third_party/WebKit/Source/core/animation/KeyframeEffect.cpp
+++ b/third_party/WebKit/Source/core/animation/KeyframeEffect.cpp
@@ -56,32 +56,31 @@ KeyframeEffect* KeyframeEffect::create(Element* target, EffectModel* model, cons
KeyframeEffect* KeyframeEffect::create(ExecutionContext* executionContext, Element* element, const EffectModelOrDictionarySequenceOrDictionary& effectInput, double duration, ExceptionState& exceptionState)
{
ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
- if (element)
- UseCounter::count(element->document(), UseCounter::AnimationConstructorKeyframeListEffectObjectTiming);
+ Document& document = toDocument(*executionContext);
+ UseCounter::count(document, UseCounter::AnimationConstructorKeyframeListEffectObjectTiming);
Timing timing;
if (!TimingInput::convert(duration, timing, exceptionState))
return nullptr;
- return create(element, EffectInput::convert(element, effectInput, executionContext, exceptionState), timing);
+ return create(element, EffectInput::convert(document, effectInput, executionContext, exceptionState), timing);
}
KeyframeEffect* KeyframeEffect::create(ExecutionContext* executionContext, Element* element, const EffectModelOrDictionarySequenceOrDictionary& effectInput, const KeyframeEffectOptions& timingInput, ExceptionState& exceptionState)
{
ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
- if (element)
- UseCounter::count(element->document(), UseCounter::AnimationConstructorKeyframeListEffectObjectTiming);
+ Document& document = toDocument(*executionContext);
+ UseCounter::count(document, UseCounter::AnimationConstructorKeyframeListEffectObjectTiming);
Timing timing;
- Document* document = element ? &element->document() : nullptr;
if (!TimingInput::convert(timingInput, timing, document, exceptionState))
return nullptr;
- return create(element, EffectInput::convert(element, effectInput, executionContext, exceptionState), timing);
+ return create(element, EffectInput::convert(document, effectInput, executionContext, exceptionState), timing);
}
KeyframeEffect* KeyframeEffect::create(ExecutionContext* executionContext, Element* element, const EffectModelOrDictionarySequenceOrDictionary& effectInput, ExceptionState& exceptionState)
{
ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
- if (element)
- UseCounter::count(element->document(), UseCounter::AnimationConstructorKeyframeListEffectNoTiming);
- return create(element, EffectInput::convert(element, effectInput, executionContext, exceptionState), Timing());
+ Document& document = toDocument(*executionContext);
+ UseCounter::count(document, UseCounter::AnimationConstructorKeyframeListEffectNoTiming);
+ return create(element, EffectInput::convert(document, effectInput, executionContext, exceptionState), Timing());
}
KeyframeEffect::KeyframeEffect(Element* target, EffectModel* model, const Timing& timing, Priority priority, EventDelegate* eventDelegate)

Powered by Google App Engine
This is Rietveld 408576698