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

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

Issue 2044023005: Make PropertyReference value() return a const CSSValue& (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_remove_style_property_set_mutable_overload
Patch Set: Rebase 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 RefPtr<StringKeyframe> keyframe = StringKeyframe::create(); 84 RefPtr<StringKeyframe> keyframe = StringKeyframe::create();
85 const Vector<double>& offsets = styleKeyframe->keys(); 85 const Vector<double>& offsets = styleKeyframe->keys();
86 ASSERT(!offsets.isEmpty()); 86 ASSERT(!offsets.isEmpty());
87 keyframe->setOffset(offsets[0]); 87 keyframe->setOffset(offsets[0]);
88 keyframe->setEasing(defaultTimingFunction); 88 keyframe->setEasing(defaultTimingFunction);
89 const StylePropertySet& properties = styleKeyframe->properties(); 89 const StylePropertySet& properties = styleKeyframe->properties();
90 for (unsigned j = 0; j < properties.propertyCount(); j++) { 90 for (unsigned j = 0; j < properties.propertyCount(); j++) {
91 CSSPropertyID property = properties.propertyAt(j).id(); 91 CSSPropertyID property = properties.propertyAt(j).id();
92 specifiedPropertiesForUseCounter.add(property); 92 specifiedPropertiesForUseCounter.add(property);
93 if (property == CSSPropertyAnimationTimingFunction) { 93 if (property == CSSPropertyAnimationTimingFunction) {
94 const CSSValue* value = properties.propertyAt(j).value(); 94 const CSSValue& value = properties.propertyAt(j).value();
95 RefPtr<TimingFunction> timingFunction; 95 RefPtr<TimingFunction> timingFunction;
96 if (value->isInheritedValue() && parentStyle->animations()) { 96 if (value.isInheritedValue() && parentStyle->animations()) {
97 timingFunction = parentStyle->animations()->timingFunctionLi st()[0]; 97 timingFunction = parentStyle->animations()->timingFunctionLi st()[0];
98 } else if (value->isValueList()) { 98 } else if (value.isValueList()) {
99 timingFunction = CSSToStyleMap::mapAnimationTimingFunction(t oCSSValueList(value)->item(0)); 99 timingFunction = CSSToStyleMap::mapAnimationTimingFunction(t oCSSValueList(value).item(0));
100 } else { 100 } else {
101 ASSERT(value->isCSSWideKeyword()); 101 DCHECK(value.isCSSWideKeyword());
102 timingFunction = CSSTimingData::initialTimingFunction(); 102 timingFunction = CSSTimingData::initialTimingFunction();
103 } 103 }
104 keyframe->setEasing(timingFunction.release()); 104 keyframe->setEasing(timingFunction.release());
105 } else if (CSSAnimations::isAnimatableProperty(property)) { 105 } else if (CSSAnimations::isAnimatableProperty(property)) {
106 keyframe->setCSSPropertyValue(property, properties.propertyAt(j) .value()); 106 keyframe->setCSSPropertyValue(property, properties.propertyAt(j) .value());
107 } 107 }
108 } 108 }
109 keyframes.append(keyframe); 109 keyframes.append(keyframe);
110 // The last keyframe specified at a given offset is used. 110 // The last keyframe specified at a given offset is used.
111 for (size_t j = 1; j < offsets.size(); ++j) { 111 for (size_t j = 1; j < offsets.size(); ++j) {
(...skipping 785 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

Powered by Google App Engine
This is Rietveld 408576698