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

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

Issue 1158603003: CSS Independent Transform Properties (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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
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 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
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& op = toAnimatableTransform(value)->transformO perations();
602 if (!op.size())
603 return;
Timothy Loh 2015/06/05 00:55:59 unreachable?
Eric Willigers 2015/06/05 01:58:22 Should we clear the translate? Or should we be ass
soonm 2015/06/10 04:09:32 Done.
604 const TranslateTransformOperation* transform = static_cast<const Transl ateTransformOperation*>(op.operations().last().get());
605 style->setTranslate(transform->x(), transform->y(), transform->z());
Timothy Loh 2015/06/05 00:55:59 setTranslate(transform)?
soonm 2015/06/10 04:09:32 Done.
606 return;
607 }
608 case CSSPropertyRotate: {
609 const TransformOperations& op = toAnimatableTransform(value)->transformO perations();
610 if (!op.size())
611 return;
612 const RotateTransformOperation* transform = static_cast<const RotateTra nsformOperation*>(op.operations().last().get());
613 style->setRotate(transform->angle(), transform->x(), transform->y(), tra nsform->z());
Timothy Loh 2015/06/05 00:55:59 setRotate(transform)?
soonm 2015/06/10 04:09:32 Done.
614 return;
615 }
616 case CSSPropertyScale: {
617 const TransformOperations& op = toAnimatableTransform(value)->transformO perations();
618 if (!op.size())
619 return;
620 const ScaleTransformOperation* transform = static_cast<const ScaleTrans formOperation*>(op.operations().last().get());
621 style->setScale(transform->x(), transform->y(), transform->z());
622 return;
623 }
600 case CSSPropertyTransformOrigin: 624 case CSSPropertyTransformOrigin:
601 style->setTransformOrigin(animatableValueToTransformOrigin(value, state) ); 625 style->setTransformOrigin(animatableValueToTransformOrigin(value, state) );
602 return; 626 return;
603 case CSSPropertyMotionOffset: 627 case CSSPropertyMotionOffset:
604 style->setMotionOffset(animatableValueToLength(value, state)); 628 style->setMotionOffset(animatableValueToLength(value, state));
605 return; 629 return;
606 case CSSPropertyMotionRotation: 630 case CSSPropertyMotionRotation:
607 style->setMotionRotation(toAnimatableDoubleAndBool(value)->toDouble()); 631 style->setMotionRotation(toAnimatableDoubleAndBool(value)->toDouble());
608 style->setMotionRotationType(toAnimatableDoubleAndBool(value)->flag() ? MotionRotationAuto : MotionRotationFixed); 632 style->setMotionRotationType(toAnimatableDoubleAndBool(value)->flag() ? MotionRotationAuto : MotionRotationFixed);
609 return; 633 return;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 case CSSPropertyRy: 685 case CSSPropertyRy:
662 style->setRy(animatableValueToLength(value, state, ValueRangeNonNegative )); 686 style->setRy(animatableValueToLength(value, state, ValueRangeNonNegative ));
663 return; 687 return;
664 688
665 default: 689 default:
666 ASSERT_NOT_REACHED(); 690 ASSERT_NOT_REACHED();
667 } 691 }
668 } 692 }
669 693
670 } // namespace blink 694 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698