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

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

Issue 331793004: Delete ASSERT_DISABLED (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add missing include Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/v8/ExceptionStatePlaceholder.h ('k') | Source/core/dom/ScriptForbiddenScope.h » ('j') | 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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 calculateAnimationActiveInterpolations(update.get(), element, parentElement. document().timeline().currentTimeInternal()); 228 calculateAnimationActiveInterpolations(update.get(), element, parentElement. document().timeline().currentTimeInternal());
229 calculateTransitionUpdate(update.get(), element, style); 229 calculateTransitionUpdate(update.get(), element, style);
230 calculateTransitionActiveInterpolations(update.get(), element, parentElement .document().timeline().currentTimeInternal()); 230 calculateTransitionActiveInterpolations(update.get(), element, parentElement .document().timeline().currentTimeInternal());
231 return update->isEmpty() ? nullptr : update.release(); 231 return update->isEmpty() ? nullptr : update.release();
232 } 232 }
233 233
234 void CSSAnimations::calculateAnimationUpdate(CSSAnimationUpdate* update, Element * element, const Element& parentElement, const RenderStyle& style, RenderStyle* parentStyle, StyleResolver* resolver) 234 void CSSAnimations::calculateAnimationUpdate(CSSAnimationUpdate* update, Element * element, const Element& parentElement, const RenderStyle& style, RenderStyle* parentStyle, StyleResolver* resolver)
235 { 235 {
236 const ActiveAnimations* activeAnimations = element ? element->activeAnimatio ns() : 0; 236 const ActiveAnimations* activeAnimations = element ? element->activeAnimatio ns() : 0;
237 237
238 #if ASSERT_DISABLED 238 #if !ASSERT_ENABLED
239 // If we're in an animation style change, no animations can have started, be en cancelled or changed play state. 239 // If we're in an animation style change, no animations can have started, be en cancelled or changed play state.
240 // When ASSERT is enabled, we verify this optimization. 240 // When ASSERT is enabled, we verify this optimization.
241 if (activeAnimations && activeAnimations->isAnimationStyleChange()) 241 if (activeAnimations && activeAnimations->isAnimationStyleChange())
242 return; 242 return;
243 #endif 243 #endif
244 244
245 const CSSAnimationData* animationData = style.animations(); 245 const CSSAnimationData* animationData = style.animations();
246 const CSSAnimations* cssAnimations = activeAnimations ? &activeAnimations->c ssAnimations() : 0; 246 const CSSAnimations* cssAnimations = activeAnimations ? &activeAnimations->c ssAnimations() : 0;
247 247
248 HashSet<AtomicString> inactive; 248 HashSet<AtomicString> inactive;
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 452
453 void CSSAnimations::calculateTransitionUpdate(CSSAnimationUpdate* update, const Element* element, const RenderStyle& style) 453 void CSSAnimations::calculateTransitionUpdate(CSSAnimationUpdate* update, const Element* element, const RenderStyle& style)
454 { 454 {
455 if (!element) 455 if (!element)
456 return; 456 return;
457 457
458 ActiveAnimations* activeAnimations = element->activeAnimations(); 458 ActiveAnimations* activeAnimations = element->activeAnimations();
459 const TransitionMap* activeTransitions = activeAnimations ? &activeAnimation s->cssAnimations().m_transitions : 0; 459 const TransitionMap* activeTransitions = activeAnimations ? &activeAnimation s->cssAnimations().m_transitions : 0;
460 const CSSTransitionData* transitionData = style.transitions(); 460 const CSSTransitionData* transitionData = style.transitions();
461 461
462 #if ASSERT_DISABLED 462 #if ASSERT_ENABLED
463 // In debug builds we verify that it would have been safe to avoid populatin g and testing listedProperties if the style recalc is due to animation.
464 const bool animationStyleRecalc = false;
465 #else
463 // In release builds we avoid the cost of checking for new and interrupted t ransitions if the style recalc is due to animation. 466 // In release builds we avoid the cost of checking for new and interrupted t ransitions if the style recalc is due to animation.
464 const bool animationStyleRecalc = activeAnimations && activeAnimations->isAn imationStyleChange(); 467 const bool animationStyleRecalc = activeAnimations && activeAnimations->isAn imationStyleChange();
465 #else
466 // In debug builds we verify that it would have been safe to avoid populatin g and testing listedProperties if the style recalc is due to animation.
467 const bool animationStyleRecalc = false;
468 #endif 468 #endif
469 469
470 BitArray<numCSSProperties> listedProperties; 470 BitArray<numCSSProperties> listedProperties;
471 bool anyTransitionHadTransitionAll = false; 471 bool anyTransitionHadTransitionAll = false;
472 const RenderObject* renderer = element->renderer(); 472 const RenderObject* renderer = element->renderer();
473 if (!animationStyleRecalc && style.display() != NONE && renderer && renderer ->style() && transitionData) { 473 if (!animationStyleRecalc && style.display() != NONE && renderer && renderer ->style() && transitionData) {
474 const RenderStyle& oldStyle = *renderer->style(); 474 const RenderStyle& oldStyle = *renderer->style();
475 475
476 for (size_t i = 0; i < transitionData->propertyList().size(); ++i) { 476 for (size_t i = 0; i < transitionData->propertyList().size(); ++i) {
477 const CSSTransitionData::TransitionProperty& transitionProperty = tr ansitionData->propertyList()[i]; 477 const CSSTransitionData::TransitionProperty& transitionProperty = tr ansitionData->propertyList()[i];
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 void CSSAnimationUpdate::trace(Visitor* visitor) 836 void CSSAnimationUpdate::trace(Visitor* visitor)
837 { 837 {
838 visitor->trace(m_newTransitions); 838 visitor->trace(m_newTransitions);
839 visitor->trace(m_activeInterpolationsForAnimations); 839 visitor->trace(m_activeInterpolationsForAnimations);
840 visitor->trace(m_activeInterpolationsForTransitions); 840 visitor->trace(m_activeInterpolationsForTransitions);
841 visitor->trace(m_newAnimations); 841 visitor->trace(m_newAnimations);
842 visitor->trace(m_cancelledAnimationPlayers); 842 visitor->trace(m_cancelledAnimationPlayers);
843 } 843 }
844 844
845 } // namespace WebCore 845 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/ExceptionStatePlaceholder.h ('k') | Source/core/dom/ScriptForbiddenScope.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698