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 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 return; | 629 return; |
630 } | 630 } |
631 | 631 |
632 RefPtr<AnimatableValue> to = nullptr; | 632 RefPtr<AnimatableValue> to = nullptr; |
633 const RunningTransition* interruptedTransition = nullptr; | 633 const RunningTransition* interruptedTransition = nullptr; |
634 if (state.activeTransitions) { | 634 if (state.activeTransitions) { |
635 TransitionMap::const_iterator activeTransitionIter = | 635 TransitionMap::const_iterator activeTransitionIter = |
636 state.activeTransitions->find(property); | 636 state.activeTransitions->find(property); |
637 if (activeTransitionIter != state.activeTransitions->end()) { | 637 if (activeTransitionIter != state.activeTransitions->end()) { |
638 const RunningTransition* runningTransition = &activeTransitionIter->value; | 638 const RunningTransition* runningTransition = &activeTransitionIter->value; |
639 to = CSSAnimatableValueFactory::create(property.cssProperty(), | 639 to = CSSAnimatableValueFactory::create(property, state.style); |
640 state.style); | |
641 const AnimatableValue* activeTo = runningTransition->to.get(); | 640 const AnimatableValue* activeTo = runningTransition->to.get(); |
642 if (to->equals(activeTo)) | 641 if (to->equals(activeTo)) |
643 return; | 642 return; |
644 state.update.cancelTransition(property); | 643 state.update.cancelTransition(property); |
645 DCHECK(!state.animatingElement->elementAnimations() || | 644 DCHECK(!state.animatingElement->elementAnimations() || |
646 !state.animatingElement->elementAnimations() | 645 !state.animatingElement->elementAnimations() |
647 ->isAnimationStyleChange()); | 646 ->isAnimationStyleChange()); |
648 | 647 |
649 if (to->equals(runningTransition->reversingAdjustedStartValue.get())) { | 648 if (to->equals(runningTransition->reversingAdjustedStartValue.get())) { |
650 interruptedTransition = runningTransition; | 649 interruptedTransition = runningTransition; |
651 } | 650 } |
652 } | 651 } |
653 } | 652 } |
654 | 653 |
655 if (CSSPropertyEquality::propertiesEqual(property.cssProperty(), | 654 if (CSSPropertyEquality::propertiesEqual(property.cssProperty(), |
656 state.oldStyle, state.style)) { | 655 state.oldStyle, state.style)) { |
657 return; | 656 return; |
658 } | 657 } |
659 | 658 |
660 if (!to) | 659 if (!to) |
661 to = CSSAnimatableValueFactory::create(property.cssProperty(), state.style); | 660 to = CSSAnimatableValueFactory::create(property, state.style); |
662 RefPtr<AnimatableValue> from = | 661 RefPtr<AnimatableValue> from = |
663 CSSAnimatableValueFactory::create(property.cssProperty(), state.oldStyle); | 662 CSSAnimatableValueFactory::create(property, state.oldStyle); |
664 | 663 |
665 // TODO(alancutter): Support transitions on registered custom properties and | 664 // TODO(alancutter): Support transitions on registered custom properties and |
666 // give the map a PropertyRegistry. | 665 // give the map a PropertyRegistry. |
667 CSSInterpolationTypesMap map(nullptr); | 666 CSSInterpolationTypesMap map(nullptr); |
668 InterpolationEnvironment oldEnvironment(map, state.oldStyle); | 667 InterpolationEnvironment oldEnvironment(map, state.oldStyle); |
669 InterpolationEnvironment newEnvironment(map, state.style); | 668 InterpolationEnvironment newEnvironment(map, state.style); |
670 InterpolationValue start = nullptr; | 669 InterpolationValue start = nullptr; |
671 InterpolationValue end = nullptr; | 670 InterpolationValue end = nullptr; |
672 const InterpolationType* transitionType = nullptr; | 671 const InterpolationType* transitionType = nullptr; |
673 for (const auto& interpolationType : map.get(property)) { | 672 for (const auto& interpolationType : map.get(property)) { |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1145 isCustomPropertyHandle); | 1144 isCustomPropertyHandle); |
1146 } | 1145 } |
1147 | 1146 |
1148 DEFINE_TRACE(CSSAnimations) { | 1147 DEFINE_TRACE(CSSAnimations) { |
1149 visitor->trace(m_transitions); | 1148 visitor->trace(m_transitions); |
1150 visitor->trace(m_pendingUpdate); | 1149 visitor->trace(m_pendingUpdate); |
1151 visitor->trace(m_runningAnimations); | 1150 visitor->trace(m_runningAnimations); |
1152 } | 1151 } |
1153 | 1152 |
1154 } // namespace blink | 1153 } // namespace blink |
OLD | NEW |