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

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

Issue 293113007: Simplify animation/transition parsing slightly (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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 | « Source/core/animation/TimingInput.cpp ('k') | Source/core/css/parser/BisonCSSParser-in.cpp » ('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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 for (unsigned j = 0; j < properties.propertyCount(); j++) { 110 for (unsigned j = 0; j < properties.propertyCount(); j++) {
111 specifiedPropertiesForUseCounter.add(properties.propertyAt(j).id()); 111 specifiedPropertiesForUseCounter.add(properties.propertyAt(j).id());
112 CSSPropertyID property = propertyForAnimation(properties.propertyAt( j).id()); 112 CSSPropertyID property = propertyForAnimation(properties.propertyAt( j).id());
113 if (property == CSSPropertyWebkitAnimationTimingFunction || property == CSSPropertyAnimationTimingFunction) { 113 if (property == CSSPropertyWebkitAnimationTimingFunction || property == CSSPropertyAnimationTimingFunction) {
114 CSSValue* value = properties.propertyAt(j).value(); 114 CSSValue* value = properties.propertyAt(j).value();
115 RefPtr<TimingFunction> timingFunction; 115 RefPtr<TimingFunction> timingFunction;
116 if (value->isInheritedValue() && parentStyle->animations()) 116 if (value->isInheritedValue() && parentStyle->animations())
117 timingFunction = parentStyle->animations()->timingFunctionLi st()[0]; 117 timingFunction = parentStyle->animations()->timingFunctionLi st()[0];
118 else if (value->isInheritedValue() || value->isInitialValue()) 118 else if (value->isInheritedValue() || value->isInitialValue())
119 timingFunction = CSSTimingData::initialTimingFunction(); 119 timingFunction = CSSTimingData::initialTimingFunction();
120 else if (value->isValueList()) 120 else
121 timingFunction = CSSToStyleMap::mapAnimationTimingFunction(t oCSSValueList(value)->item(0)); 121 timingFunction = CSSToStyleMap::mapAnimationTimingFunction(t oCSSValueList(value)->item(0));
122 else
123 timingFunction = CSSToStyleMap::mapAnimationTimingFunction(v alue);
124 keyframe->setEasing(timingFunction.release()); 122 keyframe->setEasing(timingFunction.release());
125 } else if (CSSAnimations::isAnimatableProperty(property)) { 123 } else if (CSSAnimations::isAnimatableProperty(property)) {
126 keyframe->setPropertyValue(property, CSSAnimatableValueFactory:: create(property, *keyframeStyle).get()); 124 keyframe->setPropertyValue(property, CSSAnimatableValueFactory:: create(property, *keyframeStyle).get());
127 } 125 }
128 } 126 }
129 keyframes.append(keyframe); 127 keyframes.append(keyframe);
130 // The last keyframe specified at a given offset is used. 128 // The last keyframe specified at a given offset is used.
131 for (size_t j = 1; j < offsets.size(); ++j) { 129 for (size_t j = 1; j < offsets.size(); ++j) {
132 keyframes.append(toAnimatableValueKeyframe(keyframe->cloneWithOffset (offsets[j]).get())); 130 keyframes.append(toAnimatableValueKeyframe(keyframe->cloneWithOffset (offsets[j]).get()));
133 } 131 }
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 void CSSAnimationUpdate::trace(Visitor* visitor) 836 void CSSAnimationUpdate::trace(Visitor* visitor)
839 { 837 {
840 visitor->trace(m_newTransitions); 838 visitor->trace(m_newTransitions);
841 visitor->trace(m_activeInterpolationsForAnimations); 839 visitor->trace(m_activeInterpolationsForAnimations);
842 visitor->trace(m_activeInterpolationsForTransitions); 840 visitor->trace(m_activeInterpolationsForTransitions);
843 visitor->trace(m_newAnimations); 841 visitor->trace(m_newAnimations);
844 visitor->trace(m_cancelledAnimationPlayers); 842 visitor->trace(m_cancelledAnimationPlayers);
845 } 843 }
846 844
847 } // namespace WebCore 845 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/animation/TimingInput.cpp ('k') | Source/core/css/parser/BisonCSSParser-in.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698