Summary: | Move resumeAnimations/suspendAnimations from Frame to AnimationController. | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Chris Marrin <cmarrin> | ||||||||
Component: | Layout and Rendering | Assignee: | Chris Marrin <cmarrin> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | simon.fraser | ||||||||
Priority: | P2 | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||
Hardware: | PC | ||||||||||
OS: | OS X 10.5 | ||||||||||
Attachments: |
|
Description
Chris Marrin
2010-11-05 09:55:15 PDT
Created attachment 73088 [details]
Patch
Comment on attachment 73088 [details]
Patch
I think it would be cleaner to rename the existing function resumeAnimationsForThisFrameOnly or something like that, and have a new function with the loop in it, instead of using a magic value of 0 to mean "loop through subframes".
Comment on attachment 73088 [details]
Patch
Right, Chris is going to add new methods to AnimationController.
Created attachment 73103 [details]
Patch
Comment on attachment 73103 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=73103&action=review > WebCore/page/animation/AnimationController.cpp:241 > setBeginAnimationUpdateTime(cBeginAnimationUpdateTimeNotSet); > > RenderObjectAnimationMap::const_iterator animationsEnd = m_compositeAnimations.end(); > for (RenderObjectAnimationMap::const_iterator it = m_compositeAnimations.begin(); it != animationsEnd; ++it) { > RenderObject* renderer = it->first; > + if (renderer->document() == m_frame->document()) { > + CompositeAnimation* compAnim = it->second.get(); > + compAnim->suspendAnimations(); > + } > + } Too much copied code here. This should just do suspendAnimationsForDocument(m_frame->document()); > WebCore/page/animation/AnimationController.cpp:261 > + setBeginAnimationUpdateTime(cBeginAnimationUpdateTimeNotSet); > + > + RenderObjectAnimationMap::const_iterator animationsEnd = m_compositeAnimations.end(); > + for (RenderObjectAnimationMap::const_iterator it = m_compositeAnimations.begin(); it != animationsEnd; ++it) { > + RenderObject* renderer = it->first; > + if (renderer->document() == m_frame->document()) { > + CompositeAnimation* compAnim = it->second.get(); > + compAnim->resumeAnimations(); > + } > + } Same, just call resumeAnimationsForDocument(m_frame->document()); > WebCore/page/animation/AnimationController.cpp:311 > + /* > + bool traverseSubframes = false; > + if (!document) { > + document = m_frame->document(); > + traverseSubframes = true; > + } > + */ > + Remove! Created attachment 73110 [details]
Patch
Comment on attachment 73110 [details]
Patch
So much nicer!
Committed r71451: <http://trac.webkit.org/changeset/71451> |