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

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

Issue 98663004: Add support for unprefixed CSS Transforms (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. Created 6 years, 9 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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 return; 547 return;
547 case CSSPropertyWebkitMaskPositionX: 548 case CSSPropertyWebkitMaskPositionX:
548 setOnFillLayers<CSSPropertyWebkitMaskPositionX>(style->accessMaskLayers( ), value, state); 549 setOnFillLayers<CSSPropertyWebkitMaskPositionX>(style->accessMaskLayers( ), value, state);
549 return; 550 return;
550 case CSSPropertyWebkitMaskPositionY: 551 case CSSPropertyWebkitMaskPositionY:
551 setOnFillLayers<CSSPropertyWebkitMaskPositionY>(style->accessMaskLayers( ), value, state); 552 setOnFillLayers<CSSPropertyWebkitMaskPositionY>(style->accessMaskLayers( ), value, state);
552 return; 553 return;
553 case CSSPropertyWebkitMaskSize: 554 case CSSPropertyWebkitMaskSize:
554 setOnFillLayers<CSSPropertyWebkitMaskSize>(style->accessMaskLayers(), va lue, state); 555 setOnFillLayers<CSSPropertyWebkitMaskSize>(style->accessMaskLayers(), va lue, state);
555 return; 556 return;
556 case CSSPropertyWebkitPerspective: 557 case CSSPropertyPerspective:
557 style->setPerspective(clampTo<float>(toAnimatableDouble(value)->toDouble ())); 558 style->setPerspective(clampTo<float>(toAnimatableDouble(value)->toDouble ()));
558 return; 559 return;
560 case CSSPropertyPerspectiveOrigin: {
561 ASSERT(RuntimeEnabledFeatures::cssTransformsUnprefixedEnabled());
562 const AnimatableLengthPoint* animatableLengthPoint = toAnimatableLengthP oint(value);
563 style->setPerspectiveOriginX(animatableValueToLength(animatableLengthPoi nt->x(), state));
564 style->setPerspectiveOriginY(animatableValueToLength(animatableLengthPoi nt->y(), state));
565 return;
566 }
559 case CSSPropertyWebkitPerspectiveOriginX: 567 case CSSPropertyWebkitPerspectiveOriginX:
568 ASSERT(!RuntimeEnabledFeatures::cssTransformsUnprefixedEnabled());
560 style->setPerspectiveOriginX(animatableValueToLength(value, state)); 569 style->setPerspectiveOriginX(animatableValueToLength(value, state));
561 return; 570 return;
562 case CSSPropertyWebkitPerspectiveOriginY: 571 case CSSPropertyWebkitPerspectiveOriginY:
572 ASSERT(!RuntimeEnabledFeatures::cssTransformsUnprefixedEnabled());
563 style->setPerspectiveOriginY(animatableValueToLength(value, state)); 573 style->setPerspectiveOriginY(animatableValueToLength(value, state));
564 return; 574 return;
565 case CSSPropertyShapeInside: 575 case CSSPropertyShapeInside:
566 style->setShapeInside(toAnimatableShapeValue(value)->shapeValue()); 576 style->setShapeInside(toAnimatableShapeValue(value)->shapeValue());
567 return; 577 return;
568 case CSSPropertyShapeOutside: 578 case CSSPropertyShapeOutside:
569 style->setShapeOutside(toAnimatableShapeValue(value)->shapeValue()); 579 style->setShapeOutside(toAnimatableShapeValue(value)->shapeValue());
570 return; 580 return;
571 case CSSPropertyShapeMargin: 581 case CSSPropertyShapeMargin:
572 style->setShapeMargin(animatableValueToLength(value, state, NonNegativeV alues)); 582 style->setShapeMargin(animatableValueToLength(value, state, NonNegativeV alues));
573 return; 583 return;
574 case CSSPropertyShapeImageThreshold: 584 case CSSPropertyShapeImageThreshold:
575 style->setShapeImageThreshold(clampTo<float>(toAnimatableDouble(value)-> toDouble(), 0, 1)); 585 style->setShapeImageThreshold(clampTo<float>(toAnimatableDouble(value)-> toDouble(), 0, 1));
576 return; 586 return;
577 case CSSPropertyWebkitTextStrokeColor: 587 case CSSPropertyWebkitTextStrokeColor:
578 style->setTextStrokeColor(toAnimatableColor(value)->color()); 588 style->setTextStrokeColor(toAnimatableColor(value)->color());
579 style->setVisitedLinkTextStrokeColor(toAnimatableColor(value)->visitedLi nkColor()); 589 style->setVisitedLinkTextStrokeColor(toAnimatableColor(value)->visitedLi nkColor());
580 return; 590 return;
581 case CSSPropertyWebkitTransform: { 591 case CSSPropertyTransform: {
582 const TransformOperations& operations = toAnimatableTransform(value)->tr ansformOperations(); 592 const TransformOperations& operations = toAnimatableTransform(value)->tr ansformOperations();
583 // FIXME: This normalization (handling of 'none') should be performed at input in AnimatableValueFactory. 593 // FIXME: This normalization (handling of 'none') should be performed at input in AnimatableValueFactory.
584 style->setTransform(operations.size() ? operations : TransformOperations (true)); 594 style->setTransform(operations.size() ? operations : TransformOperations (true));
585 return; 595 return;
586 } 596 }
597 case CSSPropertyTransformOrigin: {
598 ASSERT(RuntimeEnabledFeatures::cssTransformsUnprefixedEnabled());
599 const AnimatableLengthPoint3D* animatableLengthPoint3D = toAnimatableLen gthPoint3D(value);
600 style->setTransformOriginX(animatableValueToLength(animatableLengthPoint 3D->x(), state));
601 style->setTransformOriginY(animatableValueToLength(animatableLengthPoint 3D->y(), state));
602 style->setTransformOriginZ(clampTo<float>(toAnimatableDouble(animatableL engthPoint3D->z())->toDouble()));
603 return;
604 }
587 case CSSPropertyWebkitTransformOriginX: 605 case CSSPropertyWebkitTransformOriginX:
606 ASSERT(!RuntimeEnabledFeatures::cssTransformsUnprefixedEnabled());
588 style->setTransformOriginX(animatableValueToLength(value, state)); 607 style->setTransformOriginX(animatableValueToLength(value, state));
589 return; 608 return;
590 case CSSPropertyWebkitTransformOriginY: 609 case CSSPropertyWebkitTransformOriginY:
610 ASSERT(!RuntimeEnabledFeatures::cssTransformsUnprefixedEnabled());
591 style->setTransformOriginY(animatableValueToLength(value, state)); 611 style->setTransformOriginY(animatableValueToLength(value, state));
592 return; 612 return;
593 case CSSPropertyWebkitTransformOriginZ: 613 case CSSPropertyWebkitTransformOriginZ:
614 ASSERT(!RuntimeEnabledFeatures::cssTransformsUnprefixedEnabled());
594 style->setTransformOriginZ(toAnimatableDouble(value)->toDouble()); 615 style->setTransformOriginZ(toAnimatableDouble(value)->toDouble());
595 return; 616 return;
596 case CSSPropertyWidows: 617 case CSSPropertyWidows:
597 style->setWidows(animatableValueRoundClampTo<unsigned short>(value, 1)); 618 style->setWidows(animatableValueRoundClampTo<unsigned short>(value, 1));
598 return; 619 return;
599 case CSSPropertyWidth: 620 case CSSPropertyWidth:
600 style->setWidth(animatableValueToLength(value, state, NonNegativeValues) ); 621 style->setWidth(animatableValueToLength(value, state, NonNegativeValues) );
601 return; 622 return;
602 case CSSPropertyWordSpacing: 623 case CSSPropertyWordSpacing:
603 style->setWordSpacing(clampTo<float>(toAnimatableDouble(value)->toDouble ())); 624 style->setWordSpacing(clampTo<float>(toAnimatableDouble(value)->toDouble ()));
604 return; 625 return;
605 case CSSPropertyVisibility: 626 case CSSPropertyVisibility:
606 style->setVisibility(toAnimatableVisibility(value)->visibility()); 627 style->setVisibility(toAnimatableVisibility(value)->visibility());
607 return; 628 return;
608 case CSSPropertyZIndex: 629 case CSSPropertyZIndex:
609 style->setZIndex(animatableValueRoundClampTo<int>(value)); 630 style->setZIndex(animatableValueRoundClampTo<int>(value));
610 return; 631 return;
611 case CSSPropertyZoom: 632 case CSSPropertyZoom:
612 style->setZoom(clampTo<float>(toAnimatableDouble(value)->toDouble(), std ::numeric_limits<float>::denorm_min())); 633 style->setZoom(clampTo<float>(toAnimatableDouble(value)->toDouble(), std ::numeric_limits<float>::denorm_min()));
613 return; 634 return;
614 default: 635 default:
615 ASSERT_NOT_REACHED(); 636 ASSERT_NOT_REACHED();
616 } 637 }
617 } 638 }
618 639
619 } // namespace WebCore 640 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/parser/CSSPropertyParser.cpp ('k') | Source/core/css/resolver/StyleAdjuster.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698