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

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

Issue 2105743002: Optimize style recalc when adding @keyframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test review issues 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 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 } 288 }
289 289
290 const bool isPaused = CSSTimingData::getRepeated(animationData->play StateList(), i) == AnimPlayStatePaused; 290 const bool isPaused = CSSTimingData::getRepeated(animationData->play StateList(), i) == AnimPlayStatePaused;
291 291
292 Timing timing = animationData->convertToTiming(i); 292 Timing timing = animationData->convertToTiming(i);
293 Timing specifiedTiming = timing; 293 Timing specifiedTiming = timing;
294 RefPtr<TimingFunction> keyframeTimingFunction = timing.timingFunctio n; 294 RefPtr<TimingFunction> keyframeTimingFunction = timing.timingFunctio n;
295 timing.timingFunction = Timing::defaults().timingFunction; 295 timing.timingFunction = Timing::defaults().timingFunction;
296 296
297 StyleRuleKeyframes* keyframesRule = resolver->findKeyframesRule(elem entForScoping, name); 297 StyleRuleKeyframes* keyframesRule = resolver->findKeyframesRule(elem entForScoping, name);
298 if (!keyframesRule) 298 if (!keyframesRule) {
299 element.document().styleEngine().setHasUnresolvedKeyframesRule() ;
299 continue; // Cancel the animation if there's no style rule for i t. 300 continue; // Cancel the animation if there's no style rule for i t.
301 }
300 302
301 const RunningAnimation* existingAnimation = nullptr; 303 const RunningAnimation* existingAnimation = nullptr;
302 size_t existingAnimationIndex = 0; 304 size_t existingAnimationIndex = 0;
303 305
304 if (cssAnimations) { 306 if (cssAnimations) {
305 for (size_t i = 0; i < cssAnimations->m_runningAnimations.size() ; i++) { 307 for (size_t i = 0; i < cssAnimations->m_runningAnimations.size() ; i++) {
306 const RunningAnimation& runningAnimation = *cssAnimations->m _runningAnimations[i]; 308 const RunningAnimation& runningAnimation = *cssAnimations->m _runningAnimations[i];
307 if (runningAnimation.name == name && runningAnimation.nameIn dex == nameIndex) { 309 if (runningAnimation.name == name && runningAnimation.nameIn dex == nameIndex) {
308 existingAnimation = &runningAnimation; 310 existingAnimation = &runningAnimation;
309 existingAnimationIndex = i; 311 existingAnimationIndex = i;
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 } 861 }
860 862
861 DEFINE_TRACE(CSSAnimations) 863 DEFINE_TRACE(CSSAnimations)
862 { 864 {
863 visitor->trace(m_transitions); 865 visitor->trace(m_transitions);
864 visitor->trace(m_pendingUpdate); 866 visitor->trace(m_pendingUpdate);
865 visitor->trace(m_runningAnimations); 867 visitor->trace(m_runningAnimations);
866 } 868 }
867 869
868 } // namespace blink 870 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698