Chromium Code Reviews| 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 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 590 case CSSPropertyWebkitTextStrokeColor: | 590 case CSSPropertyWebkitTextStrokeColor: |
| 591 style->setTextStrokeColor(toAnimatableColor(value)->color()); | 591 style->setTextStrokeColor(toAnimatableColor(value)->color()); |
| 592 style->setVisitedLinkTextStrokeColor(toAnimatableColor(value)->visitedLi nkColor()); | 592 style->setVisitedLinkTextStrokeColor(toAnimatableColor(value)->visitedLi nkColor()); |
| 593 return; | 593 return; |
| 594 case CSSPropertyTransform: { | 594 case CSSPropertyTransform: { |
| 595 const TransformOperations& operations = toAnimatableTransform(value)->tr ansformOperations(); | 595 const TransformOperations& operations = toAnimatableTransform(value)->tr ansformOperations(); |
| 596 // FIXME: This normalization (handling of 'none') should be performed at input in AnimatableValueFactory. | 596 // FIXME: This normalization (handling of 'none') should be performed at input in AnimatableValueFactory. |
| 597 style->setTransform(operations.size() ? operations : TransformOperations (true)); | 597 style->setTransform(operations.size() ? operations : TransformOperations (true)); |
| 598 return; | 598 return; |
| 599 } | 599 } |
| 600 case CSSPropertyTranslate: { | |
| 601 const TransformOperations& transformList = toAnimatableTransform(value)- >transformOperations(); | |
| 602 ASSERT(transformList.size() == 1); | |
| 603 ASSERT(transformList.operations()[0]->type() == TransformOperation::Tran slate3D); | |
| 604 style->setTranslate(toTranslateTransformOperation(transformList.operatio ns()[0].get())); | |
| 605 return; | |
| 606 } | |
| 607 case CSSPropertyRotate: { | |
| 608 const TransformOperations& transformList = toAnimatableTransform(value)- >transformOperations(); | |
|
Eric Willigers
2015/06/24 03:43:08
The repetition here is unfortunate. Perhaps consid
soonm
2015/06/24 05:00:44
Done - abstracted to a new method in anonymous nam
| |
| 609 ASSERT(transformList.size() == 1); | |
| 610 ASSERT(transformList.operations()[0]->type() == TransformOperation::Rota te3D); | |
| 611 style->setRotate(toRotateTransformOperation(transformList.operations()[0 ].get())); | |
| 612 return; | |
| 613 } | |
| 614 case CSSPropertyScale: { | |
| 615 const TransformOperations& transformList = toAnimatableTransform(value)- >transformOperations(); | |
| 616 ASSERT(transformList.size() == 1); | |
| 617 ASSERT(transformList.operations()[0]->type() == TransformOperation::Scal e3D); | |
| 618 style->setScale(toScaleTransformOperation(transformList.operations()[0]. get())); | |
| 619 return; | |
| 620 } | |
| 600 case CSSPropertyTransformOrigin: | 621 case CSSPropertyTransformOrigin: |
| 601 style->setTransformOrigin(animatableValueToTransformOrigin(value, state) ); | 622 style->setTransformOrigin(animatableValueToTransformOrigin(value, state) ); |
| 602 return; | 623 return; |
| 603 case CSSPropertyMotionOffset: | 624 case CSSPropertyMotionOffset: |
| 604 style->setMotionOffset(animatableValueToLength(value, state)); | 625 style->setMotionOffset(animatableValueToLength(value, state)); |
| 605 return; | 626 return; |
| 606 case CSSPropertyMotionRotation: | 627 case CSSPropertyMotionRotation: |
| 607 style->setMotionRotation(toAnimatableDoubleAndBool(value)->toDouble()); | 628 style->setMotionRotation(toAnimatableDoubleAndBool(value)->toDouble()); |
| 608 style->setMotionRotationType(toAnimatableDoubleAndBool(value)->flag() ? MotionRotationAuto : MotionRotationFixed); | 629 style->setMotionRotationType(toAnimatableDoubleAndBool(value)->flag() ? MotionRotationAuto : MotionRotationFixed); |
| 609 return; | 630 return; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 661 case CSSPropertyRy: | 682 case CSSPropertyRy: |
| 662 style->setRy(animatableValueToLength(value, state, ValueRangeNonNegative )); | 683 style->setRy(animatableValueToLength(value, state, ValueRangeNonNegative )); |
| 663 return; | 684 return; |
| 664 | 685 |
| 665 default: | 686 default: |
| 666 ASSERT_NOT_REACHED(); | 687 ASSERT_NOT_REACHED(); |
| 667 } | 688 } |
| 668 } | 689 } |
| 669 | 690 |
| 670 } // namespace blink | 691 } // namespace blink |
| OLD | NEW |