| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 case CSSPropertyLightingColor: | 386 case CSSPropertyLightingColor: |
| 387 style->setLightingColor(toAnimatableColor(value)->color()); | 387 style->setLightingColor(toAnimatableColor(value)->color()); |
| 388 return; | 388 return; |
| 389 case CSSPropertyLineHeight: | 389 case CSSPropertyLineHeight: |
| 390 if (value->isLength()) | 390 if (value->isLength()) |
| 391 style->setLineHeight(animatableValueToLength(value, state, NonNegati
veValues)); | 391 style->setLineHeight(animatableValueToLength(value, state, NonNegati
veValues)); |
| 392 else | 392 else |
| 393 style->setLineHeight(Length(clampTo<float>(toAnimatableDouble(value)
->toDouble(), 0), Percent)); | 393 style->setLineHeight(Length(clampTo<float>(toAnimatableDouble(value)
->toDouble(), 0), Percent)); |
| 394 return; | 394 return; |
| 395 case CSSPropertyListStyleImage: | 395 case CSSPropertyListStyleImage: |
| 396 style->setListStyleImage(toAnimatableImage(value)->toStyleImage()); | 396 style->setListStyleImage(state.styleImage(property, toAnimatableImage(va
lue)->toCSSValue())); |
| 397 return; | 397 return; |
| 398 case CSSPropertyLetterSpacing: | 398 case CSSPropertyLetterSpacing: |
| 399 style->setLetterSpacing(clampTo<float>(toAnimatableDouble(value)->toDoub
le())); | 399 style->setLetterSpacing(clampTo<float>(toAnimatableDouble(value)->toDoub
le())); |
| 400 return; | 400 return; |
| 401 case CSSPropertyMarginBottom: | 401 case CSSPropertyMarginBottom: |
| 402 style->setMarginBottom(animatableValueToLength(value, state)); | 402 style->setMarginBottom(animatableValueToLength(value, state)); |
| 403 return; | 403 return; |
| 404 case CSSPropertyMarginLeft: | 404 case CSSPropertyMarginLeft: |
| 405 style->setMarginLeft(animatableValueToLength(value, state)); | 405 style->setMarginLeft(animatableValueToLength(value, state)); |
| 406 return; | 406 return; |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 style->setFilter(toAnimatableFilterOperations(value)->operations()); | 529 style->setFilter(toAnimatableFilterOperations(value)->operations()); |
| 530 return; | 530 return; |
| 531 case CSSPropertyWebkitMaskBoxImageOutset: | 531 case CSSPropertyWebkitMaskBoxImageOutset: |
| 532 style->setMaskBoxImageOutset(animatableValueToBorderImageLengthBox(value
, state)); | 532 style->setMaskBoxImageOutset(animatableValueToBorderImageLengthBox(value
, state)); |
| 533 return; | 533 return; |
| 534 case CSSPropertyWebkitMaskBoxImageSlice: | 534 case CSSPropertyWebkitMaskBoxImageSlice: |
| 535 style->setMaskBoxImageSlices(animatableValueToLengthBox(toAnimatableLeng
thBoxAndBool(value)->box(), state, NonNegativeValues)); | 535 style->setMaskBoxImageSlices(animatableValueToLengthBox(toAnimatableLeng
thBoxAndBool(value)->box(), state, NonNegativeValues)); |
| 536 style->setMaskBoxImageSlicesFill(toAnimatableLengthBoxAndBool(value)->fl
ag()); | 536 style->setMaskBoxImageSlicesFill(toAnimatableLengthBoxAndBool(value)->fl
ag()); |
| 537 return; | 537 return; |
| 538 case CSSPropertyWebkitMaskBoxImageSource: | 538 case CSSPropertyWebkitMaskBoxImageSource: |
| 539 style->setMaskBoxImageSource(toAnimatableImage(value)->toStyleImage()); | 539 style->setMaskBoxImageSource(state.styleImage(property, toAnimatableImag
e(value)->toCSSValue())); |
| 540 return; | 540 return; |
| 541 case CSSPropertyWebkitMaskBoxImageWidth: | 541 case CSSPropertyWebkitMaskBoxImageWidth: |
| 542 style->setMaskBoxImageWidth(animatableValueToBorderImageLengthBox(value,
state)); | 542 style->setMaskBoxImageWidth(animatableValueToBorderImageLengthBox(value,
state)); |
| 543 return; | 543 return; |
| 544 case CSSPropertyWebkitMaskImage: | 544 case CSSPropertyWebkitMaskImage: |
| 545 setOnFillLayers<CSSPropertyWebkitMaskImage>(style->accessMaskLayers(), v
alue, state); | 545 setOnFillLayers<CSSPropertyWebkitMaskImage>(style->accessMaskLayers(), v
alue, state); |
| 546 return; | 546 return; |
| 547 case CSSPropertyWebkitMaskPositionX: | 547 case CSSPropertyWebkitMaskPositionX: |
| 548 setOnFillLayers<CSSPropertyWebkitMaskPositionX>(style->accessMaskLayers(
), value, state); | 548 setOnFillLayers<CSSPropertyWebkitMaskPositionX>(style->accessMaskLayers(
), value, state); |
| 549 return; | 549 return; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 return; | 610 return; |
| 611 case CSSPropertyZoom: | 611 case CSSPropertyZoom: |
| 612 style->setZoom(clampTo<float>(toAnimatableDouble(value)->toDouble(), std
::numeric_limits<float>::denorm_min())); | 612 style->setZoom(clampTo<float>(toAnimatableDouble(value)->toDouble(), std
::numeric_limits<float>::denorm_min())); |
| 613 return; | 613 return; |
| 614 default: | 614 default: |
| 615 ASSERT_NOT_REACHED(); | 615 ASSERT_NOT_REACHED(); |
| 616 } | 616 } |
| 617 } | 617 } |
| 618 | 618 |
| 619 } // namespace WebCore | 619 } // namespace WebCore |
| OLD | NEW |