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

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

Issue 2370673002: Changed EDisplay to an enum class and renamed its members to be keywords (Closed)
Patch Set: Comment 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 #endif 277 #endif
278 278
279 const CSSAnimationData* animationData = style.animations(); 279 const CSSAnimationData* animationData = style.animations();
280 const CSSAnimations* cssAnimations = elementAnimations ? &elementAnimations- >cssAnimations() : nullptr; 280 const CSSAnimations* cssAnimations = elementAnimations ? &elementAnimations- >cssAnimations() : nullptr;
281 const Element* elementForScoping = animatingElement ? animatingElement : &el ement; 281 const Element* elementForScoping = animatingElement ? animatingElement : &el ement;
282 282
283 Vector<bool> cancelRunningAnimationFlags(cssAnimations ? cssAnimations->m_ru nningAnimations.size() : 0); 283 Vector<bool> cancelRunningAnimationFlags(cssAnimations ? cssAnimations->m_ru nningAnimations.size() : 0);
284 for (bool& flag : cancelRunningAnimationFlags) 284 for (bool& flag : cancelRunningAnimationFlags)
285 flag = true; 285 flag = true;
286 286
287 if (animationData && style.display() != NONE) { 287 if (animationData && style.display() != EDisplay::None) {
288 const Vector<AtomicString>& nameList = animationData->nameList(); 288 const Vector<AtomicString>& nameList = animationData->nameList();
289 for (size_t i = 0; i < nameList.size(); ++i) { 289 for (size_t i = 0; i < nameList.size(); ++i) {
290 AtomicString name = nameList[i]; 290 AtomicString name = nameList[i];
291 if (name == CSSAnimationData::initialName()) 291 if (name == CSSAnimationData::initialName())
292 continue; 292 continue;
293 293
294 // Find n where this is the nth occurence of this animation name. 294 // Find n where this is the nth occurence of this animation name.
295 size_t nameIndex = 0; 295 size_t nameIndex = 0;
296 for (size_t j = 0; j < i; j++) { 296 for (size_t j = 0; j < i; j++) {
297 if (nameList[j] == name) 297 if (nameList[j] == name)
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 // 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. 631 // 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.
632 const bool animationStyleRecalc = false; 632 const bool animationStyleRecalc = false;
633 #else 633 #else
634 // In release builds we avoid the cost of checking for new and interrupted t ransitions if the style recalc is due to animation. 634 // In release builds we avoid the cost of checking for new and interrupted t ransitions if the style recalc is due to animation.
635 const bool animationStyleRecalc = elementAnimations && elementAnimations->is AnimationStyleChange(); 635 const bool animationStyleRecalc = elementAnimations && elementAnimations->is AnimationStyleChange();
636 #endif 636 #endif
637 637
638 std::bitset<numCSSProperties> listedProperties; 638 std::bitset<numCSSProperties> listedProperties;
639 bool anyTransitionHadTransitionAll = false; 639 bool anyTransitionHadTransitionAll = false;
640 const LayoutObject* layoutObject = animatingElement->layoutObject(); 640 const LayoutObject* layoutObject = animatingElement->layoutObject();
641 if (!animationStyleRecalc && style.display() != NONE && layoutObject && layo utObject->style() && transitionData) { 641 if (!animationStyleRecalc && style.display() != EDisplay::None && layoutObje ct && layoutObject->style() && transitionData) {
642 const ComputedStyle& oldStyle = *layoutObject->style(); 642 const ComputedStyle& oldStyle = *layoutObject->style();
643 643
644 for (size_t i = 0; i < transitionData->propertyList().size(); ++i) { 644 for (size_t i = 0; i < transitionData->propertyList().size(); ++i) {
645 const CSSTransitionData::TransitionProperty& transitionProperty = tr ansitionData->propertyList()[i]; 645 const CSSTransitionData::TransitionProperty& transitionProperty = tr ansitionData->propertyList()[i];
646 if (transitionProperty.propertyType != CSSTransitionData::Transition KnownProperty) 646 if (transitionProperty.propertyType != CSSTransitionData::Transition KnownProperty)
647 continue; 647 continue;
648 648
649 CSSPropertyID property = resolveCSSPropertyID(transitionProperty.unr esolvedProperty); 649 CSSPropertyID property = resolveCSSPropertyID(transitionProperty.unr esolvedProperty);
650 bool animateAll = property == CSSPropertyAll; 650 bool animateAll = property == CSSPropertyAll;
651 if (animateAll) 651 if (animateAll)
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 } 897 }
898 898
899 DEFINE_TRACE(CSSAnimations) 899 DEFINE_TRACE(CSSAnimations)
900 { 900 {
901 visitor->trace(m_transitions); 901 visitor->trace(m_transitions);
902 visitor->trace(m_pendingUpdate); 902 visitor->trace(m_pendingUpdate);
903 visitor->trace(m_runningAnimations); 903 visitor->trace(m_runningAnimations);
904 } 904 }
905 905
906 } // namespace blink 906 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/CSSPrimitiveValueMappings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698