| 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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 return; | 338 return; |
| 339 case CSSPropertyClip: | 339 case CSSPropertyClip: |
| 340 style->setClip(animatableValueToLengthBox(value, state)); | 340 style->setClip(animatableValueToLengthBox(value, state)); |
| 341 style->setHasClip(true); | 341 style->setHasClip(true); |
| 342 return; | 342 return; |
| 343 case CSSPropertyColor: | 343 case CSSPropertyColor: |
| 344 style->setColor(toAnimatableColor(value)->color()); | 344 style->setColor(toAnimatableColor(value)->color()); |
| 345 style->setVisitedLinkColor(toAnimatableColor(value)->visitedLinkColor())
; | 345 style->setVisitedLinkColor(toAnimatableColor(value)->visitedLinkColor())
; |
| 346 return; | 346 return; |
| 347 case CSSPropertyFillOpacity: | 347 case CSSPropertyFillOpacity: |
| 348 // Avoiding a value of 1 forces a layer to be created. | 348 style->setFillOpacity(clampTo<float>(toAnimatableDouble(value)->toDouble
(), 0, 1)); |
| 349 style->setFillOpacity(clampTo<float>(toAnimatableDouble(value)->toDouble
(), 0, nextafterf(1, 0))); | |
| 350 return; | 349 return; |
| 351 case CSSPropertyFill: | 350 case CSSPropertyFill: |
| 352 { | 351 { |
| 353 const AnimatableSVGPaint* svgPaint = toAnimatableSVGPaint(value); | 352 const AnimatableSVGPaint* svgPaint = toAnimatableSVGPaint(value); |
| 354 style->accessSVGStyle()->setFillPaint(svgPaint->paintType(), svgPain
t->color(), svgPaint->uri()); | 353 style->accessSVGStyle()->setFillPaint(svgPaint->paintType(), svgPain
t->color(), svgPaint->uri()); |
| 355 } | 354 } |
| 356 return; | 355 return; |
| 357 case CSSPropertyFlexGrow: | 356 case CSSPropertyFlexGrow: |
| 358 style->setFlexGrow(clampTo<float>(toAnimatableDouble(value)->toDouble(),
0)); | 357 style->setFlexGrow(clampTo<float>(toAnimatableDouble(value)->toDouble(),
0)); |
| 359 return; | 358 return; |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 case CSSPropertyShapeMargin: | 571 case CSSPropertyShapeMargin: |
| 573 style->setShapeMargin(animatableValueToLength(value, state, NonNegativeV
alues)); | 572 style->setShapeMargin(animatableValueToLength(value, state, NonNegativeV
alues)); |
| 574 return; | 573 return; |
| 575 case CSSPropertyShapeImageThreshold: | 574 case CSSPropertyShapeImageThreshold: |
| 576 style->setShapeImageThreshold(clampTo<float>(toAnimatableDouble(value)->
toDouble(), 0, 1)); | 575 style->setShapeImageThreshold(clampTo<float>(toAnimatableDouble(value)->
toDouble(), 0, 1)); |
| 577 return; | 576 return; |
| 578 case CSSPropertyWebkitTextStrokeColor: | 577 case CSSPropertyWebkitTextStrokeColor: |
| 579 style->setTextStrokeColor(toAnimatableColor(value)->color()); | 578 style->setTextStrokeColor(toAnimatableColor(value)->color()); |
| 580 style->setVisitedLinkTextStrokeColor(toAnimatableColor(value)->visitedLi
nkColor()); | 579 style->setVisitedLinkTextStrokeColor(toAnimatableColor(value)->visitedLi
nkColor()); |
| 581 return; | 580 return; |
| 582 case CSSPropertyWebkitTransform: { | 581 case CSSPropertyWebkitTransform: |
| 583 const TransformOperations& operations = toAnimatableTransform(value)->tr
ansformOperations(); | 582 style->setTransform(toAnimatableTransform(value)->transformOperations())
; |
| 584 // FIXME: Using identity matrix here when the transform list is empty | |
| 585 // forces a layer to be created in the presence of a transform animation
. | |
| 586 style->setTransform(operations.size() ? operations : TransformOperations
(true)); | |
| 587 return; | 583 return; |
| 588 } | |
| 589 case CSSPropertyWebkitTransformOriginX: | 584 case CSSPropertyWebkitTransformOriginX: |
| 590 style->setTransformOriginX(animatableValueToLength(value, state)); | 585 style->setTransformOriginX(animatableValueToLength(value, state)); |
| 591 return; | 586 return; |
| 592 case CSSPropertyWebkitTransformOriginY: | 587 case CSSPropertyWebkitTransformOriginY: |
| 593 style->setTransformOriginY(animatableValueToLength(value, state)); | 588 style->setTransformOriginY(animatableValueToLength(value, state)); |
| 594 return; | 589 return; |
| 595 case CSSPropertyWebkitTransformOriginZ: | 590 case CSSPropertyWebkitTransformOriginZ: |
| 596 style->setTransformOriginZ(toAnimatableDouble(value)->toDouble()); | 591 style->setTransformOriginZ(toAnimatableDouble(value)->toDouble()); |
| 597 return; | 592 return; |
| 598 case CSSPropertyWidows: | 593 case CSSPropertyWidows: |
| (...skipping 13 matching lines...) Expand all Loading... |
| 612 return; | 607 return; |
| 613 case CSSPropertyZoom: | 608 case CSSPropertyZoom: |
| 614 style->setZoom(clampTo<float>(toAnimatableDouble(value)->toDouble(), std
::numeric_limits<float>::denorm_min())); | 609 style->setZoom(clampTo<float>(toAnimatableDouble(value)->toDouble(), std
::numeric_limits<float>::denorm_min())); |
| 615 return; | 610 return; |
| 616 default: | 611 default: |
| 617 ASSERT_NOT_REACHED(); | 612 ASSERT_NOT_REACHED(); |
| 618 } | 613 } |
| 619 } | 614 } |
| 620 | 615 |
| 621 } // namespace WebCore | 616 } // namespace WebCore |
| OLD | NEW |