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

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

Issue 1164573002: CSSValue Immediates: Change CSSValue to an object instead of a pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 4 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 return LengthSize( 142 return LengthSize(
143 animatableValueToLength(animatableLengthSize->width(), state, range), 143 animatableValueToLength(animatableLengthSize->width(), state, range),
144 animatableValueToLength(animatableLengthSize->height(), state, range)); 144 animatableValueToLength(animatableLengthSize->height(), state, range));
145 } 145 }
146 146
147 void setFillSize(FillLayer* fillLayer, const AnimatableValue* value, StyleResolv erState& state) 147 void setFillSize(FillLayer* fillLayer, const AnimatableValue* value, StyleResolv erState& state)
148 { 148 {
149 if (value->isLengthSize()) 149 if (value->isLengthSize())
150 fillLayer->setSize(FillSize(SizeLength, animatableValueToLengthSize(valu e, state, ValueRangeNonNegative))); 150 fillLayer->setSize(FillSize(SizeLength, animatableValueToLengthSize(valu e, state, ValueRangeNonNegative)));
151 else 151 else
152 CSSToStyleMap::mapFillSize(state, fillLayer, toAnimatableUnknown(value)- >toCSSValue().get()); 152 CSSToStyleMap::mapFillSize(state, fillLayer, toAnimatableUnknown(value)- >toCSSValue());
153 } 153 }
154 154
155 template <CSSPropertyID property> 155 template <CSSPropertyID property>
156 void setOnFillLayers(FillLayer& fillLayers, const AnimatableValue* value, StyleR esolverState& state) 156 void setOnFillLayers(FillLayer& fillLayers, const AnimatableValue* value, StyleR esolverState& state)
157 { 157 {
158 const WillBeHeapVector<RefPtrWillBeMember<AnimatableValue>>& values = toAnim atableRepeatable(value)->values(); 158 const WillBeHeapVector<RefPtrWillBeMember<AnimatableValue>>& values = toAnim atableRepeatable(value)->values();
159 ASSERT(!values.isEmpty()); 159 ASSERT(!values.isEmpty());
160 FillLayer* fillLayer = &fillLayers; 160 FillLayer* fillLayer = &fillLayers;
161 FillLayer* prev = 0; 161 FillLayer* prev = 0;
162 for (size_t i = 0; i < values.size(); ++i) { 162 for (size_t i = 0; i < values.size(); ++i) {
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 return transformList.operations()[0].get(); 271 return transformList.operations()[0].get();
272 } 272 }
273 273
274 } // namespace 274 } // namespace
275 275
276 // FIXME: Generate this function. 276 // FIXME: Generate this function.
277 void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, StyleResolverSt ate& state, const AnimatableValue* value) 277 void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, StyleResolverSt ate& state, const AnimatableValue* value)
278 { 278 {
279 ASSERT(CSSPropertyMetadata::isInterpolableProperty(property)); 279 ASSERT(CSSPropertyMetadata::isInterpolableProperty(property));
280 if (value->isUnknown()) { 280 if (value->isUnknown()) {
281 StyleBuilder::applyProperty(property, state, toAnimatableUnknown(value)- >toCSSValue().get()); 281 StyleBuilder::applyProperty(property, state, toAnimatableUnknown(value)- >toCSSValue());
282 return; 282 return;
283 } 283 }
284 ComputedStyle* style = state.style(); 284 ComputedStyle* style = state.style();
285 switch (property) { 285 switch (property) {
286 case CSSPropertyBackgroundColor: 286 case CSSPropertyBackgroundColor:
287 style->setBackgroundColor(toAnimatableColor(value)->color()); 287 style->setBackgroundColor(toAnimatableColor(value)->color());
288 style->setVisitedLinkBackgroundColor(toAnimatableColor(value)->visitedLi nkColor()); 288 style->setVisitedLinkBackgroundColor(toAnimatableColor(value)->visitedLi nkColor());
289 return; 289 return;
290 case CSSPropertyBackgroundImage: 290 case CSSPropertyBackgroundImage:
291 setOnFillLayers<CSSPropertyBackgroundImage>(style->accessBackgroundLayer s(), value, state); 291 setOnFillLayers<CSSPropertyBackgroundImage>(style->accessBackgroundLayer s(), value, state);
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 case CSSPropertyRy: 681 case CSSPropertyRy:
682 style->setRy(animatableValueToLength(value, state, ValueRangeNonNegative )); 682 style->setRy(animatableValueToLength(value, state, ValueRangeNonNegative ));
683 return; 683 return;
684 684
685 default: 685 default:
686 ASSERT_NOT_REACHED(); 686 ASSERT_NOT_REACHED();
687 } 687 }
688 } 688 }
689 689
690 } // namespace blink 690 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/parser/SizesCalcParserTest.cpp ('k') | Source/core/css/resolver/CSSToStyleMap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698