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

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

Issue 2361733004: Adding @keyframes rules only affects TreeScope plus host. (Closed)
Patch Set: Moved scope check to CSSAnimations Created 4 years, 2 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
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 15 matching lines...) Expand all
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "core/animation/Animation.h" 31 #include "core/animation/Animation.h"
32 32
33 #include "core/animation/AnimationTimeline.h" 33 #include "core/animation/AnimationTimeline.h"
34 #include "core/animation/CompositorPendingAnimations.h" 34 #include "core/animation/CompositorPendingAnimations.h"
35 #include "core/animation/KeyframeEffect.h" 35 #include "core/animation/KeyframeEffect.h"
36 #include "core/animation/css/CSSAnimations.h"
36 #include "core/dom/Document.h" 37 #include "core/dom/Document.h"
37 #include "core/dom/ExceptionCode.h" 38 #include "core/dom/ExceptionCode.h"
38 #include "core/dom/StyleChangeReason.h" 39 #include "core/dom/StyleChangeReason.h"
39 #include "core/events/AnimationPlaybackEvent.h" 40 #include "core/events/AnimationPlaybackEvent.h"
40 #include "core/frame/UseCounter.h" 41 #include "core/frame/UseCounter.h"
41 #include "core/inspector/InspectorInstrumentation.h" 42 #include "core/inspector/InspectorInstrumentation.h"
42 #include "core/inspector/InspectorTraceEvents.h" 43 #include "core/inspector/InspectorTraceEvents.h"
43 #include "platform/RuntimeEnabledFeatures.h" 44 #include "platform/RuntimeEnabledFeatures.h"
44 #include "platform/TraceEvent.h" 45 #include "platform/TraceEvent.h"
45 #include "platform/animation/CompositorAnimationPlayer.h" 46 #include "platform/animation/CompositorAnimationPlayer.h"
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after
1079 if (suppressed) 1080 if (suppressed)
1080 cancelAnimationOnCompositor(); 1081 cancelAnimationOnCompositor();
1081 } 1082 }
1082 1083
1083 void Animation::disableCompositedAnimationForTesting() 1084 void Animation::disableCompositedAnimationForTesting()
1084 { 1085 {
1085 m_isCompositedAnimationDisabledForTesting = true; 1086 m_isCompositedAnimationDisabledForTesting = true;
1086 cancelAnimationOnCompositor(); 1087 cancelAnimationOnCompositor();
1087 } 1088 }
1088 1089
1089 void Animation::invalidateKeyframeEffect() 1090 void Animation::invalidateKeyframeEffect(const TreeScope& treeScope)
1090 { 1091 {
1091 if (!m_content || !m_content->isKeyframeEffect()) 1092 if (!m_content || !m_content->isKeyframeEffect())
1092 return; 1093 return;
1093 1094
1094 toKeyframeEffect(m_content.get())->target()->setNeedsStyleRecalc(LocalStyleC hange, StyleChangeReasonForTracing::create(StyleChangeReason::StyleSheetChange)) ; 1095 Element& target = *toKeyframeEffect(m_content.get())->target();
1096
1097 if (CSSAnimations::isAffectedByKeyframesFromScope(target, treeScope))
1098 target.setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing ::create(StyleChangeReason::StyleSheetChange));
1095 } 1099 }
1096 1100
1097 DEFINE_TRACE(Animation) 1101 DEFINE_TRACE(Animation)
1098 { 1102 {
1099 visitor->trace(m_content); 1103 visitor->trace(m_content);
1100 visitor->trace(m_timeline); 1104 visitor->trace(m_timeline);
1101 visitor->trace(m_pendingFinishedEvent); 1105 visitor->trace(m_pendingFinishedEvent);
1102 visitor->trace(m_pendingCancelledEvent); 1106 visitor->trace(m_pendingCancelledEvent);
1103 visitor->trace(m_finishedPromise); 1107 visitor->trace(m_finishedPromise);
1104 visitor->trace(m_readyPromise); 1108 visitor->trace(m_readyPromise);
1105 EventTargetWithInlineData::trace(visitor); 1109 EventTargetWithInlineData::trace(visitor);
1106 ActiveDOMObject::trace(visitor); 1110 ActiveDOMObject::trace(visitor);
1107 } 1111 }
1108 1112
1109 } // namespace blink 1113 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/animation/Animation.h ('k') | third_party/WebKit/Source/core/animation/AnimationTimeline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698