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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 default: | 167 default: |
168 ASSERT_NOT_REACHED(); | 168 ASSERT_NOT_REACHED(); |
169 } | 169 } |
170 prev->setNext(fillLayer); | 170 prev->setNext(fillLayer); |
171 } | 171 } |
172 const AnimatableValue* layerValue = values[i].get(); | 172 const AnimatableValue* layerValue = values[i].get(); |
173 switch (property) { | 173 switch (property) { |
174 case CSSPropertyBackgroundImage: | 174 case CSSPropertyBackgroundImage: |
175 case CSSPropertyWebkitMaskImage: | 175 case CSSPropertyWebkitMaskImage: |
176 if (layerValue->isImage()) { | 176 if (layerValue->isImage()) { |
177 fillLayer->setImage(toAnimatableImage(layerValue)->toStyleImage(
)); | 177 fillLayer->setImage(state.styleImage(property, toAnimatableImage
(layerValue)->toCSSValue())); |
178 } else { | 178 } else { |
179 ASSERT(toAnimatableUnknown(layerValue)->toCSSValueID() == CSSVal
ueNone); | 179 ASSERT(toAnimatableUnknown(layerValue)->toCSSValueID() == CSSVal
ueNone); |
180 fillLayer->setImage(nullptr); | 180 fillLayer->setImage(nullptr); |
181 } | 181 } |
182 break; | 182 break; |
183 case CSSPropertyBackgroundPositionX: | 183 case CSSPropertyBackgroundPositionX: |
184 case CSSPropertyWebkitMaskPositionX: | 184 case CSSPropertyWebkitMaskPositionX: |
185 fillLayer->setXPosition(animatableValueToLength(layerValue, state)); | 185 fillLayer->setXPosition(animatableValueToLength(layerValue, state)); |
186 break; | 186 break; |
187 case CSSPropertyBackgroundPositionY: | 187 case CSSPropertyBackgroundPositionY: |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 case CSSPropertyBorderBottomWidth: | 290 case CSSPropertyBorderBottomWidth: |
291 style->setBorderBottomWidth(animatableValueRoundClampTo<unsigned>(value)
); | 291 style->setBorderBottomWidth(animatableValueRoundClampTo<unsigned>(value)
); |
292 return; | 292 return; |
293 case CSSPropertyBorderImageOutset: | 293 case CSSPropertyBorderImageOutset: |
294 style->setBorderImageOutset(animatableValueToBorderImageLengthBox(value,
state)); | 294 style->setBorderImageOutset(animatableValueToBorderImageLengthBox(value,
state)); |
295 return; | 295 return; |
296 case CSSPropertyBorderImageSlice: | 296 case CSSPropertyBorderImageSlice: |
297 style->setBorderImageSlices(animatableValueToLengthBox(value, state, Non
NegativeValues)); | 297 style->setBorderImageSlices(animatableValueToLengthBox(value, state, Non
NegativeValues)); |
298 return; | 298 return; |
299 case CSSPropertyBorderImageSource: | 299 case CSSPropertyBorderImageSource: |
300 style->setBorderImageSource(toAnimatableImage(value)->toStyleImage()); | 300 style->setBorderImageSource(state.styleImage(property, toAnimatableImage
(value)->toCSSValue())); |
301 return; | 301 return; |
302 case CSSPropertyBorderImageWidth: | 302 case CSSPropertyBorderImageWidth: |
303 style->setBorderImageWidth(animatableValueToBorderImageLengthBox(value,
state)); | 303 style->setBorderImageWidth(animatableValueToBorderImageLengthBox(value,
state)); |
304 return; | 304 return; |
305 case CSSPropertyBorderLeftColor: | 305 case CSSPropertyBorderLeftColor: |
306 style->setBorderLeftColor(toAnimatableColor(value)->color()); | 306 style->setBorderLeftColor(toAnimatableColor(value)->color()); |
307 style->setVisitedLinkBorderLeftColor(toAnimatableColor(value)->visitedLi
nkColor()); | 307 style->setVisitedLinkBorderLeftColor(toAnimatableColor(value)->visitedLi
nkColor()); |
308 return; | 308 return; |
309 case CSSPropertyBorderLeftWidth: | 309 case CSSPropertyBorderLeftWidth: |
310 style->setBorderLeftWidth(animatableValueRoundClampTo<unsigned>(value)); | 310 style->setBorderLeftWidth(animatableValueRoundClampTo<unsigned>(value)); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 case CSSPropertyLightingColor: | 387 case CSSPropertyLightingColor: |
388 style->setLightingColor(toAnimatableColor(value)->color()); | 388 style->setLightingColor(toAnimatableColor(value)->color()); |
389 return; | 389 return; |
390 case CSSPropertyLineHeight: | 390 case CSSPropertyLineHeight: |
391 if (value->isLength()) | 391 if (value->isLength()) |
392 style->setLineHeight(animatableValueToLength(value, state, NonNegati
veValues)); | 392 style->setLineHeight(animatableValueToLength(value, state, NonNegati
veValues)); |
393 else | 393 else |
394 style->setLineHeight(Length(clampTo<float>(toAnimatableDouble(value)
->toDouble(), 0), Percent)); | 394 style->setLineHeight(Length(clampTo<float>(toAnimatableDouble(value)
->toDouble(), 0), Percent)); |
395 return; | 395 return; |
396 case CSSPropertyListStyleImage: | 396 case CSSPropertyListStyleImage: |
397 style->setListStyleImage(toAnimatableImage(value)->toStyleImage()); | 397 style->setListStyleImage(state.styleImage(property, toAnimatableImage(va
lue)->toCSSValue())); |
398 return; | 398 return; |
399 case CSSPropertyLetterSpacing: | 399 case CSSPropertyLetterSpacing: |
400 style->setLetterSpacing(clampTo<float>(toAnimatableDouble(value)->toDoub
le())); | 400 style->setLetterSpacing(clampTo<float>(toAnimatableDouble(value)->toDoub
le())); |
401 return; | 401 return; |
402 case CSSPropertyMarginBottom: | 402 case CSSPropertyMarginBottom: |
403 style->setMarginBottom(animatableValueToLength(value, state)); | 403 style->setMarginBottom(animatableValueToLength(value, state)); |
404 return; | 404 return; |
405 case CSSPropertyMarginLeft: | 405 case CSSPropertyMarginLeft: |
406 style->setMarginLeft(animatableValueToLength(value, state)); | 406 style->setMarginLeft(animatableValueToLength(value, state)); |
407 return; | 407 return; |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 style->setFilter(toAnimatableFilterOperations(value)->operations()); | 530 style->setFilter(toAnimatableFilterOperations(value)->operations()); |
531 return; | 531 return; |
532 case CSSPropertyWebkitMaskBoxImageOutset: | 532 case CSSPropertyWebkitMaskBoxImageOutset: |
533 style->setMaskBoxImageOutset(animatableValueToBorderImageLengthBox(value
, state)); | 533 style->setMaskBoxImageOutset(animatableValueToBorderImageLengthBox(value
, state)); |
534 return; | 534 return; |
535 case CSSPropertyWebkitMaskBoxImageSlice: | 535 case CSSPropertyWebkitMaskBoxImageSlice: |
536 style->setMaskBoxImageSlices(animatableValueToLengthBox(toAnimatableLeng
thBoxAndBool(value)->box(), state, NonNegativeValues)); | 536 style->setMaskBoxImageSlices(animatableValueToLengthBox(toAnimatableLeng
thBoxAndBool(value)->box(), state, NonNegativeValues)); |
537 style->setMaskBoxImageSlicesFill(toAnimatableLengthBoxAndBool(value)->fl
ag()); | 537 style->setMaskBoxImageSlicesFill(toAnimatableLengthBoxAndBool(value)->fl
ag()); |
538 return; | 538 return; |
539 case CSSPropertyWebkitMaskBoxImageSource: | 539 case CSSPropertyWebkitMaskBoxImageSource: |
540 style->setMaskBoxImageSource(toAnimatableImage(value)->toStyleImage()); | 540 style->setMaskBoxImageSource(state.styleImage(property, toAnimatableImag
e(value)->toCSSValue())); |
541 return; | 541 return; |
542 case CSSPropertyWebkitMaskBoxImageWidth: | 542 case CSSPropertyWebkitMaskBoxImageWidth: |
543 style->setMaskBoxImageWidth(animatableValueToBorderImageLengthBox(value,
state)); | 543 style->setMaskBoxImageWidth(animatableValueToBorderImageLengthBox(value,
state)); |
544 return; | 544 return; |
545 case CSSPropertyWebkitMaskImage: | 545 case CSSPropertyWebkitMaskImage: |
546 setOnFillLayers<CSSPropertyWebkitMaskImage>(style->accessMaskLayers(), v
alue, state); | 546 setOnFillLayers<CSSPropertyWebkitMaskImage>(style->accessMaskLayers(), v
alue, state); |
547 return; | 547 return; |
548 case CSSPropertyWebkitMaskPositionX: | 548 case CSSPropertyWebkitMaskPositionX: |
549 setOnFillLayers<CSSPropertyWebkitMaskPositionX>(style->accessMaskLayers(
), value, state); | 549 setOnFillLayers<CSSPropertyWebkitMaskPositionX>(style->accessMaskLayers(
), value, state); |
550 return; | 550 return; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 return; | 612 return; |
613 case CSSPropertyZoom: | 613 case CSSPropertyZoom: |
614 style->setZoom(clampTo<float>(toAnimatableDouble(value)->toDouble(), std
::numeric_limits<float>::denorm_min())); | 614 style->setZoom(clampTo<float>(toAnimatableDouble(value)->toDouble(), std
::numeric_limits<float>::denorm_min())); |
615 return; | 615 return; |
616 default: | 616 default: |
617 ASSERT_NOT_REACHED(); | 617 ASSERT_NOT_REACHED(); |
618 } | 618 } |
619 } | 619 } |
620 | 620 |
621 } // namespace WebCore | 621 } // namespace WebCore |
OLD | NEW |