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

Side by Side Diff: third_party/WebKit/Source/core/animation/KeyframeEffect.cpp

Issue 1965693002: Fix null crash when creating KeyframeEffects with null targets (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/LayoutTests/animations/keyframe-effect-null-target-crash.html ('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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 return nullptr; 63 return nullptr;
64 return create(element, EffectInput::convert(element, effectInput, executionC ontext, exceptionState), timing); 64 return create(element, EffectInput::convert(element, effectInput, executionC ontext, exceptionState), timing);
65 } 65 }
66 66
67 KeyframeEffect* KeyframeEffect::create(ExecutionContext* executionContext, Eleme nt* element, const EffectModelOrDictionarySequenceOrDictionary& effectInput, con st KeyframeEffectOptions& timingInput, ExceptionState& exceptionState) 67 KeyframeEffect* KeyframeEffect::create(ExecutionContext* executionContext, Eleme nt* element, const EffectModelOrDictionarySequenceOrDictionary& effectInput, con st KeyframeEffectOptions& timingInput, ExceptionState& exceptionState)
68 { 68 {
69 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); 69 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
70 if (element) 70 if (element)
71 UseCounter::count(element->document(), UseCounter::AnimationConstructorK eyframeListEffectObjectTiming); 71 UseCounter::count(element->document(), UseCounter::AnimationConstructorK eyframeListEffectObjectTiming);
72 Timing timing; 72 Timing timing;
73 if (!TimingInput::convert(timingInput, timing, &element->document(), excepti onState)) 73 Document* document = element ? &element->document() : nullptr;
74 if (!TimingInput::convert(timingInput, timing, document, exceptionState))
74 return nullptr; 75 return nullptr;
75 return create(element, EffectInput::convert(element, effectInput, executionC ontext, exceptionState), timing); 76 return create(element, EffectInput::convert(element, effectInput, executionC ontext, exceptionState), timing);
76 } 77 }
77 78
78 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)
79 { 80 {
80 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); 81 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled());
81 if (element) 82 if (element)
82 UseCounter::count(element->document(), UseCounter::AnimationConstructorK eyframeListEffectNoTiming); 83 UseCounter::count(element->document(), UseCounter::AnimationConstructorK eyframeListEffectNoTiming);
83 return create(element, EffectInput::convert(element, effectInput, executionC ontext, exceptionState), Timing()); 84 return create(element, EffectInput::convert(element, effectInput, executionC ontext, exceptionState), Timing());
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 372
372 DEFINE_TRACE(KeyframeEffect) 373 DEFINE_TRACE(KeyframeEffect)
373 { 374 {
374 visitor->trace(m_target); 375 visitor->trace(m_target);
375 visitor->trace(m_model); 376 visitor->trace(m_model);
376 visitor->trace(m_sampledEffect); 377 visitor->trace(m_sampledEffect);
377 AnimationEffect::trace(visitor); 378 AnimationEffect::trace(visitor);
378 } 379 }
379 380
380 } // namespace blink 381 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/animations/keyframe-effect-null-target-crash.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698