OLD | NEW |
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 Loading... |
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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 return FontDescription::Size(0, size, true); | 263 return FontDescription::Size(0, size, true); |
264 } | 264 } |
265 | 265 |
266 } // namespace | 266 } // namespace |
267 | 267 |
268 // FIXME: Generate this function. | 268 // FIXME: Generate this function. |
269 void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, StyleResolverSt
ate& state, const AnimatableValue* value) | 269 void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, StyleResolverSt
ate& state, const AnimatableValue* value) |
270 { | 270 { |
271 ASSERT(CSSPropertyMetadata::isAnimatableProperty(property)); | 271 ASSERT(CSSPropertyMetadata::isAnimatableProperty(property)); |
272 if (value->isUnknown()) { | 272 if (value->isUnknown()) { |
273 StyleBuilder::applyProperty(property, state, toAnimatableUnknown(value)-
>toCSSValue().get()); | 273 StyleBuilder::applyProperty(property, state, toAnimatableUnknown(value)-
>toCSSValue()); |
274 return; | 274 return; |
275 } | 275 } |
276 ComputedStyle* style = state.style(); | 276 ComputedStyle* style = state.style(); |
277 switch (property) { | 277 switch (property) { |
278 case CSSPropertyBackgroundColor: | 278 case CSSPropertyBackgroundColor: |
279 style->setBackgroundColor(toAnimatableColor(value)->color()); | 279 style->setBackgroundColor(toAnimatableColor(value)->color()); |
280 style->setVisitedLinkBackgroundColor(toAnimatableColor(value)->visitedLi
nkColor()); | 280 style->setVisitedLinkBackgroundColor(toAnimatableColor(value)->visitedLi
nkColor()); |
281 return; | 281 return; |
282 case CSSPropertyBackgroundImage: | 282 case CSSPropertyBackgroundImage: |
283 setOnFillLayers<CSSPropertyBackgroundImage>(style->accessBackgroundLayer
s(), value, state); | 283 setOnFillLayers<CSSPropertyBackgroundImage>(style->accessBackgroundLayer
s(), value, state); |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 case CSSPropertyRy: | 661 case CSSPropertyRy: |
662 style->setRy(animatableValueToLength(value, state, ValueRangeNonNegative
)); | 662 style->setRy(animatableValueToLength(value, state, ValueRangeNonNegative
)); |
663 return; | 663 return; |
664 | 664 |
665 default: | 665 default: |
666 ASSERT_NOT_REACHED(); | 666 ASSERT_NOT_REACHED(); |
667 } | 667 } |
668 } | 668 } |
669 | 669 |
670 } // namespace blink | 670 } // namespace blink |
OLD | NEW |