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

Side by Side Diff: Source/core/css/resolver/StyleResolver.cpp

Issue 1329843002: Support per property CSS Animation stacks (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Lint Created 5 years, 3 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/core/css/resolver/StyleResolver.h ('k') | Source/platform/RuntimeEnabledFeatures.in » ('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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 17 matching lines...) Expand all
28 28
29 #include "config.h" 29 #include "config.h"
30 #include "core/css/resolver/StyleResolver.h" 30 #include "core/css/resolver/StyleResolver.h"
31 31
32 #include "core/CSSPropertyNames.h" 32 #include "core/CSSPropertyNames.h"
33 #include "core/HTMLNames.h" 33 #include "core/HTMLNames.h"
34 #include "core/MediaTypeNames.h" 34 #include "core/MediaTypeNames.h"
35 #include "core/StylePropertyShorthand.h" 35 #include "core/StylePropertyShorthand.h"
36 #include "core/animation/AnimationTimeline.h" 36 #include "core/animation/AnimationTimeline.h"
37 #include "core/animation/ElementAnimations.h" 37 #include "core/animation/ElementAnimations.h"
38 #include "core/animation/InvalidatableStyleInterpolation.h"
38 #include "core/animation/KeyframeEffect.h" 39 #include "core/animation/KeyframeEffect.h"
39 #include "core/animation/StyleInterpolation.h" 40 #include "core/animation/StyleInterpolation.h"
40 #include "core/animation/animatable/AnimatableValue.h" 41 #include "core/animation/animatable/AnimatableValue.h"
41 #include "core/animation/css/CSSAnimatableValueFactory.h" 42 #include "core/animation/css/CSSAnimatableValueFactory.h"
42 #include "core/animation/css/CSSAnimations.h" 43 #include "core/animation/css/CSSAnimations.h"
43 #include "core/css/CSSCalculationValue.h" 44 #include "core/css/CSSCalculationValue.h"
44 #include "core/css/CSSDefaultStyleSheets.h" 45 #include "core/css/CSSDefaultStyleSheets.h"
45 #include "core/css/CSSFontSelector.h" 46 #include "core/css/CSSFontSelector.h"
46 #include "core/css/CSSKeyframeRule.h" 47 #include "core/css/CSSKeyframeRule.h"
47 #include "core/css/CSSKeyframesRule.h" 48 #include "core/css/CSSKeyframesRule.h"
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 956
956 CSSAnimations::calculateUpdate(animatingElement, *element, *state.style(), s tate.parentStyle(), state.animationUpdate(), this); 957 CSSAnimations::calculateUpdate(animatingElement, *element, *state.style(), s tate.parentStyle(), state.animationUpdate(), this);
957 if (state.animationUpdate().isEmpty()) 958 if (state.animationUpdate().isEmpty())
958 return false; 959 return false;
959 960
960 if (state.style()->insideLink() != NotInsideLink) { 961 if (state.style()->insideLink() != NotInsideLink) {
961 ASSERT(state.applyPropertyToRegularStyle()); 962 ASSERT(state.applyPropertyToRegularStyle());
962 state.setApplyPropertyToVisitedLinkStyle(true); 963 state.setApplyPropertyToVisitedLinkStyle(true);
963 } 964 }
964 965
965 const ActiveInterpolationMap& activeInterpolationsForAnimations = state.anim ationUpdate().activeInterpolationsForAnimations(); 966 const ActiveInterpolationsMap& activeInterpolationsMapForAnimations = state. animationUpdate().activeInterpolationsForAnimations();
966 const ActiveInterpolationMap& activeInterpolationsForTransitions = state.ani mationUpdate().activeInterpolationsForTransitions(); 967 const ActiveInterpolationsMap& activeInterpolationsMapForTransitions = state .animationUpdate().activeInterpolationsForTransitions();
967 applyAnimatedProperties<HighPropertyPriority>(state, activeInterpolationsFor Animations); 968 applyAnimatedProperties<HighPropertyPriority>(state, activeInterpolationsMap ForAnimations);
968 applyAnimatedProperties<HighPropertyPriority>(state, activeInterpolationsFor Transitions); 969 applyAnimatedProperties<HighPropertyPriority>(state, activeInterpolationsMap ForTransitions);
969 970
970 updateFont(state); 971 updateFont(state);
971 972
972 applyAnimatedProperties<LowPropertyPriority>(state, activeInterpolationsForA nimations); 973 applyAnimatedProperties<LowPropertyPriority>(state, activeInterpolationsMapF orAnimations);
973 applyAnimatedProperties<LowPropertyPriority>(state, activeInterpolationsForT ransitions); 974 applyAnimatedProperties<LowPropertyPriority>(state, activeInterpolationsMapF orTransitions);
974 975
975 // Start loading resources used by animations. 976 // Start loading resources used by animations.
976 loadPendingResources(state); 977 loadPendingResources(state);
977 978
978 ASSERT(!state.fontBuilder().fontDirty()); 979 ASSERT(!state.fontBuilder().fontDirty());
979 980
980 state.setApplyPropertyToVisitedLinkStyle(false); 981 state.setApplyPropertyToVisitedLinkStyle(false);
981 982
982 return true; 983 return true;
983 } 984 }
(...skipping 21 matching lines...) Expand all
1005 resolvers.append(scopedResolver); 1006 resolvers.append(scopedResolver);
1006 1007
1007 for (size_t i = 0; i < resolvers.size(); ++i) { 1008 for (size_t i = 0; i < resolvers.size(); ++i) {
1008 if (StyleRuleKeyframes* keyframesRule = resolvers[i]->keyframeStylesForA nimation(animationName.impl())) 1009 if (StyleRuleKeyframes* keyframesRule = resolvers[i]->keyframeStylesForA nimation(animationName.impl()))
1009 return keyframesRule; 1010 return keyframesRule;
1010 } 1011 }
1011 return nullptr; 1012 return nullptr;
1012 } 1013 }
1013 1014
1014 template <CSSPropertyPriority priority> 1015 template <CSSPropertyPriority priority>
1015 void StyleResolver::applyAnimatedProperties(StyleResolverState& state, const Has hMap<PropertyHandle, RefPtr<Interpolation>>& activeInterpolations) 1016 void StyleResolver::applyAnimatedProperties(StyleResolverState& state, const Act iveInterpolationsMap& activeInterpolationsMap)
1016 { 1017 {
1017 for (const auto& interpolationEntry : activeInterpolations) { 1018 for (const auto& interpolationsVectorEntry : activeInterpolationsMap) {
1018 if (!interpolationEntry.key.isCSSProperty()) 1019 if (!interpolationsVectorEntry.key.isCSSProperty())
1019 continue; 1020 continue;
1020 CSSPropertyID property = interpolationEntry.key.cssProperty(); 1021 CSSPropertyID property = interpolationsVectorEntry.key.cssProperty();
1021 if (!CSSPropertyPriorityData<priority>::propertyHasPriority(property)) 1022 if (!CSSPropertyPriorityData<priority>::propertyHasPriority(property))
1022 continue; 1023 continue;
1023 const StyleInterpolation* interpolation = toStyleInterpolation(interpola tionEntry.value.get()); 1024 const Interpolation& interpolation = *interpolationsVectorEntry.value.fi rst();
1024 interpolation->apply(state); 1025 if (interpolation.isInvalidatableStyleInterpolation()) {
1026 InvalidatableStyleInterpolation::applyStack(interpolationsVectorEntr y.value, state);
1027 } else {
1028 // TODO(alancutter): Remove this old code path once animations have completely migrated to InterpolationTypes.
1029 toStyleInterpolation(interpolation).apply(state);
1030 }
1025 } 1031 }
1026 } 1032 }
1027 1033
1028 static inline bool isValidCueStyleProperty(CSSPropertyID id) 1034 static inline bool isValidCueStyleProperty(CSSPropertyID id)
1029 { 1035 {
1030 switch (id) { 1036 switch (id) {
1031 case CSSPropertyBackground: 1037 case CSSPropertyBackground:
1032 case CSSPropertyBackgroundAttachment: 1038 case CSSPropertyBackgroundAttachment:
1033 case CSSPropertyBackgroundClip: 1039 case CSSPropertyBackgroundClip:
1034 case CSSPropertyBackgroundColor: 1040 case CSSPropertyBackgroundColor:
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
1539 visitor->trace(m_watchedSelectorsRules); 1545 visitor->trace(m_watchedSelectorsRules);
1540 visitor->trace(m_treeBoundaryCrossingScopes); 1546 visitor->trace(m_treeBoundaryCrossingScopes);
1541 visitor->trace(m_styleResourceLoader); 1547 visitor->trace(m_styleResourceLoader);
1542 visitor->trace(m_styleSharingLists); 1548 visitor->trace(m_styleSharingLists);
1543 visitor->trace(m_pendingStyleSheets); 1549 visitor->trace(m_pendingStyleSheets);
1544 visitor->trace(m_document); 1550 visitor->trace(m_document);
1545 #endif 1551 #endif
1546 } 1552 }
1547 1553
1548 } // namespace blink 1554 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleResolver.h ('k') | Source/platform/RuntimeEnabledFeatures.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698