Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(429)

Side by Side Diff: Source/core/css/resolver/AnimatedStyleBuilder.cpp

Issue 212483003: CSS Transforms: Implement transform-origin (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 22 matching lines...) Expand all
33 33
34 #include "core/animation/AnimatableClipPathOperation.h" 34 #include "core/animation/AnimatableClipPathOperation.h"
35 #include "core/animation/AnimatableColor.h" 35 #include "core/animation/AnimatableColor.h"
36 #include "core/animation/AnimatableDouble.h" 36 #include "core/animation/AnimatableDouble.h"
37 #include "core/animation/AnimatableFilterOperations.h" 37 #include "core/animation/AnimatableFilterOperations.h"
38 #include "core/animation/AnimatableImage.h" 38 #include "core/animation/AnimatableImage.h"
39 #include "core/animation/AnimatableLength.h" 39 #include "core/animation/AnimatableLength.h"
40 #include "core/animation/AnimatableLengthBox.h" 40 #include "core/animation/AnimatableLengthBox.h"
41 #include "core/animation/AnimatableLengthBoxAndBool.h" 41 #include "core/animation/AnimatableLengthBoxAndBool.h"
42 #include "core/animation/AnimatableLengthPoint.h" 42 #include "core/animation/AnimatableLengthPoint.h"
43 #include "core/animation/AnimatableLengthPoint3D.h"
43 #include "core/animation/AnimatableLengthSize.h" 44 #include "core/animation/AnimatableLengthSize.h"
44 #include "core/animation/AnimatableRepeatable.h" 45 #include "core/animation/AnimatableRepeatable.h"
45 #include "core/animation/AnimatableSVGLength.h" 46 #include "core/animation/AnimatableSVGLength.h"
46 #include "core/animation/AnimatableSVGPaint.h" 47 #include "core/animation/AnimatableSVGPaint.h"
47 #include "core/animation/AnimatableShadow.h" 48 #include "core/animation/AnimatableShadow.h"
48 #include "core/animation/AnimatableShapeValue.h" 49 #include "core/animation/AnimatableShapeValue.h"
49 #include "core/animation/AnimatableStrokeDasharrayList.h" 50 #include "core/animation/AnimatableStrokeDasharrayList.h"
50 #include "core/animation/AnimatableTransform.h" 51 #include "core/animation/AnimatableTransform.h"
51 #include "core/animation/AnimatableUnknown.h" 52 #include "core/animation/AnimatableUnknown.h"
52 #include "core/animation/AnimatableValue.h" 53 #include "core/animation/AnimatableValue.h"
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 case CSSPropertyWebkitTextStrokeColor: 578 case CSSPropertyWebkitTextStrokeColor:
578 style->setTextStrokeColor(toAnimatableColor(value)->color()); 579 style->setTextStrokeColor(toAnimatableColor(value)->color());
579 style->setVisitedLinkTextStrokeColor(toAnimatableColor(value)->visitedLi nkColor()); 580 style->setVisitedLinkTextStrokeColor(toAnimatableColor(value)->visitedLi nkColor());
580 return; 581 return;
581 case CSSPropertyTransform: { 582 case CSSPropertyTransform: {
582 const TransformOperations& operations = toAnimatableTransform(value)->tr ansformOperations(); 583 const TransformOperations& operations = toAnimatableTransform(value)->tr ansformOperations();
583 // FIXME: This normalization (handling of 'none') should be performed at input in AnimatableValueFactory. 584 // FIXME: This normalization (handling of 'none') should be performed at input in AnimatableValueFactory.
584 style->setTransform(operations.size() ? operations : TransformOperations (true)); 585 style->setTransform(operations.size() ? operations : TransformOperations (true));
585 return; 586 return;
586 } 587 }
588 case CSSPropertyTransformOrigin: {
589 ASSERT(RuntimeEnabledFeatures::cssTransformsUnprefixedEnabled());
590 const AnimatableLengthPoint3D* animatableLengthPoint3D = toAnimatableLen gthPoint3D(value);
591 style->setTransformOriginX(animatableValueToLength(animatableLengthPoint 3D->x(), state));
592 style->setTransformOriginY(animatableValueToLength(animatableLengthPoint 3D->y(), state));
593 style->setTransformOriginZ(clampTo<float>(toAnimatableDouble(animatableL engthPoint3D->z())->toDouble()));
594 return;
595 }
587 case CSSPropertyWebkitTransformOriginX: 596 case CSSPropertyWebkitTransformOriginX:
597 ASSERT(!RuntimeEnabledFeatures::cssTransformsUnprefixedEnabled());
588 style->setTransformOriginX(animatableValueToLength(value, state)); 598 style->setTransformOriginX(animatableValueToLength(value, state));
589 return; 599 return;
590 case CSSPropertyWebkitTransformOriginY: 600 case CSSPropertyWebkitTransformOriginY:
601 ASSERT(!RuntimeEnabledFeatures::cssTransformsUnprefixedEnabled());
591 style->setTransformOriginY(animatableValueToLength(value, state)); 602 style->setTransformOriginY(animatableValueToLength(value, state));
592 return; 603 return;
593 case CSSPropertyWebkitTransformOriginZ: 604 case CSSPropertyWebkitTransformOriginZ:
605 ASSERT(!RuntimeEnabledFeatures::cssTransformsUnprefixedEnabled());
594 style->setTransformOriginZ(toAnimatableDouble(value)->toDouble()); 606 style->setTransformOriginZ(toAnimatableDouble(value)->toDouble());
595 return; 607 return;
596 case CSSPropertyWidows: 608 case CSSPropertyWidows:
597 style->setWidows(animatableValueRoundClampTo<unsigned short>(value, 1)); 609 style->setWidows(animatableValueRoundClampTo<unsigned short>(value, 1));
598 return; 610 return;
599 case CSSPropertyWidth: 611 case CSSPropertyWidth:
600 style->setWidth(animatableValueToLength(value, state, NonNegativeValues) ); 612 style->setWidth(animatableValueToLength(value, state, NonNegativeValues) );
601 return; 613 return;
602 case CSSPropertyWordSpacing: 614 case CSSPropertyWordSpacing:
603 style->setWordSpacing(clampTo<float>(toAnimatableDouble(value)->toDouble ())); 615 style->setWordSpacing(clampTo<float>(toAnimatableDouble(value)->toDouble ()));
604 return; 616 return;
605 case CSSPropertyVisibility: 617 case CSSPropertyVisibility:
606 style->setVisibility(toAnimatableVisibility(value)->visibility()); 618 style->setVisibility(toAnimatableVisibility(value)->visibility());
607 return; 619 return;
608 case CSSPropertyZIndex: 620 case CSSPropertyZIndex:
609 style->setZIndex(animatableValueRoundClampTo<int>(value)); 621 style->setZIndex(animatableValueRoundClampTo<int>(value));
610 return; 622 return;
611 case CSSPropertyZoom: 623 case CSSPropertyZoom:
612 style->setZoom(clampTo<float>(toAnimatableDouble(value)->toDouble(), std ::numeric_limits<float>::denorm_min())); 624 style->setZoom(clampTo<float>(toAnimatableDouble(value)->toDouble(), std ::numeric_limits<float>::denorm_min()));
613 return; 625 return;
614 default: 626 default:
615 ASSERT_NOT_REACHED(); 627 ASSERT_NOT_REACHED();
616 } 628 }
617 } 629 }
618 630
619 } // namespace WebCore 631 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/parser/CSSPropertyParser.cpp ('k') | Source/core/css/resolver/StyleBuilderCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698