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 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 547 continue; | 547 continue; |
| 548 | 548 |
| 549 bool animateAll = mode == CSSTransitionData::TransitionAll; | 549 bool animateAll = mode == CSSTransitionData::TransitionAll; |
| 550 ASSERT(animateAll || mode == CSSTransitionData::TransitionSingleProp erty); | 550 ASSERT(animateAll || mode == CSSTransitionData::TransitionSingleProp erty); |
| 551 if (animateAll) | 551 if (animateAll) |
| 552 anyTransitionHadTransitionAll = true; | 552 anyTransitionHadTransitionAll = true; |
| 553 const StylePropertyShorthand& propertyList = animateAll ? CSSAnimati ons::propertiesForTransitionAll() : shorthandForProperty(property); | 553 const StylePropertyShorthand& propertyList = animateAll ? CSSAnimati ons::propertiesForTransitionAll() : shorthandForProperty(property); |
| 554 // If not a shorthand we only execute one iteration of this loop, an d refer to the property directly. | 554 // If not a shorthand we only execute one iteration of this loop, an d refer to the property directly. |
| 555 for (unsigned j = 0; !j || j < propertyList.length(); ++j) { | 555 for (unsigned j = 0; !j || j < propertyList.length(); ++j) { |
| 556 CSSPropertyID id = propertyList.length() ? propertyList.properti es()[j] : property; | 556 CSSPropertyID id = propertyList.length() ? propertyList.properti es()[j] : property; |
| 557 ASSERT(id >= firstCSSProperty); | |
| 557 | 558 |
| 558 if (!animateAll) { | 559 if (!animateAll) { |
| 559 if (CSSPropertyMetadata::isInterpolableProperty(id)) | 560 if (CSSPropertyMetadata::isInterpolableProperty(id)) |
| 560 listedProperties.set(id); | 561 listedProperties.set(id - firstCSSProperty); |
|
alancutter (OOO until 2018)
2015/08/24 00:34:06
No need to subtract firstCSSProperty when you have
| |
| 561 else | 562 else |
| 562 continue; | 563 continue; |
| 563 } | 564 } |
| 564 | 565 |
| 565 // FIXME: We should transition if an !important property changes even when an animation is running, | 566 // FIXME: We should transition if an !important property changes even when an animation is running, |
| 566 // but this is a bit hard to do with the current applyMatchedPro perties system. | 567 // but this is a bit hard to do with the current applyMatchedPro perties system. |
| 567 PropertyHandle property = PropertyHandle(id); | 568 PropertyHandle property = PropertyHandle(id); |
| 568 if (!update->activeInterpolationsForAnimations().contains(proper ty) | 569 if (!update->activeInterpolationsForAnimations().contains(proper ty) |
| 569 && (!elementAnimations || !elementAnimations->cssAnimations( ).m_previousActiveInterpolationsForAnimations.contains(property))) { | 570 && (!elementAnimations || !elementAnimations->cssAnimations( ).m_previousActiveInterpolationsForAnimations.contains(property))) { |
| 570 calculateTransitionUpdateForProperty(id, *transitionData, i, oldStyle, style, activeTransitions, update, animatingElement); | 571 calculateTransitionUpdateForProperty(id, *transitionData, i, oldStyle, style, activeTransitions, update, animatingElement); |
| 571 } | 572 } |
| 572 } | 573 } |
| 573 } | 574 } |
| 574 } | 575 } |
| 575 | 576 |
| 576 if (activeTransitions) { | 577 if (activeTransitions) { |
| 577 for (const auto& entry : *activeTransitions) { | 578 for (const auto& entry : *activeTransitions) { |
| 578 CSSPropertyID id = entry.key; | 579 CSSPropertyID id = entry.key; |
| 579 if (!anyTransitionHadTransitionAll && !animationStyleRecalc && !list edProperties.get(id)) { | 580 if (!anyTransitionHadTransitionAll && !animationStyleRecalc && !list edProperties.get(id - firstCSSProperty)) { |
| 580 // TODO: Figure out why this fails on Chrome OS login page. crbu g.com/365507 | 581 // TODO: Figure out why this fails on Chrome OS login page. crbu g.com/365507 |
| 581 // ASSERT(animation.playStateInternal() == Animation::Finished | | !(elementAnimations && elementAnimations->isAnimationStyleChange())); | 582 // ASSERT(animation.playStateInternal() == Animation::Finished | | !(elementAnimations && elementAnimations->isAnimationStyleChange())); |
| 582 update->cancelTransition(id); | 583 update->cancelTransition(id); |
| 583 } else if (entry.value.animation->finishedInternal()) { | 584 } else if (entry.value.animation->finishedInternal()) { |
| 584 update->finishTransition(id); | 585 update->finishTransition(id); |
| 585 } | 586 } |
| 586 } | 587 } |
| 587 } | 588 } |
| 588 } | 589 } |
| 589 | 590 |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 807 visitor->trace(m_activeInterpolationsForAnimations); | 808 visitor->trace(m_activeInterpolationsForAnimations); |
| 808 visitor->trace(m_activeInterpolationsForTransitions); | 809 visitor->trace(m_activeInterpolationsForTransitions); |
| 809 visitor->trace(m_newAnimations); | 810 visitor->trace(m_newAnimations); |
| 810 visitor->trace(m_suppressedAnimations); | 811 visitor->trace(m_suppressedAnimations); |
| 811 visitor->trace(m_animationsWithUpdates); | 812 visitor->trace(m_animationsWithUpdates); |
| 812 visitor->trace(m_animationsWithStyleUpdates); | 813 visitor->trace(m_animationsWithStyleUpdates); |
| 813 #endif | 814 #endif |
| 814 } | 815 } |
| 815 | 816 |
| 816 } // namespace blink | 817 } // namespace blink |
| OLD | NEW |