Changeset 30319 in webkit
- Timestamp:
- Feb 15, 2008, 1:08:05 PM (17 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/WebCore/ChangeLog ¶
r30306 r30319 1 2008-02-15 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Dave Hyatt. 4 5 - fix http://bugs.webkit.org/show_bug.cgi?id=17306 6 <rdar://problem/5737923> Transitions between styles that have different transition-* properties behave inconsistently 7 8 * manual-tests/transitions.html: Added. 9 * page/AnimationController.cpp: 10 (WebCore::CompositeImplicitAnimation::animate): Changed to use the 11 transition properties of the current style rather than the target style. 12 (WebCore::AnimationControllerPrivate::get): Changed to not create an 13 animation if the style does not have transitions. 14 (WebCore::AnimationController::updateImplicitAnimations): Added code to 15 return the target style if the current style is not animating. 16 * rendering/RenderObject.cpp: 17 (WebCore::RenderObject::setAnimatableStyle): Changed to call 18 updateImplicitAnimations() even if the current style does not have 19 transitions, because we may be animating out of a style that had them. 20 1 21 2008-02-15 Alexey Proskuryakov <ap@webkit.org> 2 22 -
TabularUnified trunk/WebCore/page/AnimationController.cpp ¶
r30039 r30319 428 428 RenderStyle* CompositeImplicitAnimation::animate(RenderObject* renderer, RenderStyle* currentStyle, RenderStyle* targetStyle) 429 429 { 430 const Transition* currentTransitions = currentStyle->transitions(); 431 const Transition* targetTransitions = targetStyle->transitions(); 432 if (currentTransitions != targetTransitions && !(currentTransitions && targetTransitions && *currentTransitions == *targetTransitions)) { 433 reset(renderer); 434 deleteAllValues(m_animations); 435 m_animations.clear(); 436 } 437 430 438 // Get the animation layers from the target style. 431 439 // For each one, we need to create a new animation unless one exists already (later occurrences of duplicate 432 440 // triggers in the layer list get ignored). 433 441 if (m_animations.isEmpty()) { 434 for (const Transition* transition = targetStyle->transitions(); transition; transition = transition->next()) {442 for (const Transition* transition = currentTransitions; transition; transition = transition->next()) { 435 443 int property = transition->transitionProperty(); 436 444 int duration = transition->transitionDuration(); … … 449 457 for (HashMap<int, ImplicitAnimation*>::iterator it = m_animations.begin(); it != end; ++it) 450 458 it->second->animate(this, renderer, currentStyle, targetStyle, result); 451 459 452 460 if (result) 453 461 return result; … … 505 513 { 506 514 CompositeImplicitAnimation* animation = m_animations.get(renderer); 507 if (!animation ) {515 if (!animation && renderer->style()->transitions()) { 508 516 animation = new CompositeImplicitAnimation(); 509 517 m_animations.set(renderer, animation); … … 585 593 // a new style. 586 594 ASSERT(renderer->element()); // FIXME: We do not animate generated content yet. 587 595 588 596 CompositeImplicitAnimation* animation = m_data->get(renderer); 597 if (!animation) 598 return newStyle; 599 589 600 RenderStyle* result = animation->animate(renderer, renderer->style(), newStyle); 590 601 m_data->updateTimer(); -
TabularUnified trunk/WebCore/rendering/RenderObject.cpp ¶
r30243 r30319 2147 2147 void RenderObject::setAnimatableStyle(RenderStyle* style) 2148 2148 { 2149 if (!isText() && m_style && style) { 2150 if (!m_style->transitions()) 2151 animationController()->cancelImplicitAnimations(this); 2152 else 2153 style = animationController()->updateImplicitAnimations(this, style); 2154 } 2149 if (!isText() && m_style && style) 2150 style = animationController()->updateImplicitAnimations(this, style); 2151 2155 2152 setStyle(style); 2156 2153 }
Note:
See TracChangeset
for help on using the changeset viewer.