Changeset 149576 in webkit
- Timestamp:
- May 4, 2013 9:43:05 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r149451 r149576 1 2013-04-30 Dean Jackson <dino@apple.com> 2 3 Animations and Transitions should not start when globally suspended 4 https://bugs.webkit.org/show_bug.cgi?id=114915 5 6 Reviewed by Sam Weinig. 7 8 Export AnimationController::isSuspended(). 9 10 * Source/autotools/symbols.filter: 11 1 12 2013-05-01 Benjamin Poulain <benjamin@webkit.org> 2 13 -
trunk/LayoutTests/ChangeLog
r149553 r149576 1 2013-04-30 Dean Jackson <dino@apple.com> 2 3 Animations and Transitions should not start when globally suspended 4 https://bugs.webkit.org/show_bug.cgi?id=114915 5 6 Reviewed by Sam Weinig. 7 8 Two new tests. Add an animation or transition to 9 the document when the global animation controller is suspended. 10 In the animation case, nothing should happen until the 11 animations are resumed. In the transition case, the style 12 change should happen immediately and not fire any events. 13 14 * animations/added-while-suspended-expected.txt: Added. 15 * animations/added-while-suspended.html: Added. 16 * animations/suspend-transform-animation.html: Make sure to resume suspended animations 17 before quitting the test. 18 * transitions/started-while-suspended-expected.txt: Added. 19 * transitions/started-while-suspended.html: Added. 20 * transitions/suspend-transform-transition.html: Make sure to resume suspended animations 21 before quitting the test. 22 1 23 2013-04-30 Robert Hogan <robert@webkit.org> 2 24 -
trunk/LayoutTests/animations/suspend-transform-animation.html
r119985 r149576 43 43 44 44 window.setTimeout(function() { 45 if (window.testRunner) 45 if (window.testRunner) { 46 internals.resumeAnimations(document); 46 47 testRunner.notifyDone(); 48 } 47 49 }, 250); 48 50 } -
trunk/LayoutTests/transitions/suspend-transform-transition.html
r120521 r149576 38 38 39 39 window.setTimeout(function() { 40 if (window.testRunner) 40 if (window.testRunner) { 41 internals.resumeAnimations(document); 41 42 testRunner.notifyDone(); 43 } 42 44 }, 250); 43 45 } -
trunk/Source/WebCore/ChangeLog
r149574 r149576 1 2013-04-30 Dean Jackson <dino@apple.com> 2 3 Animations and Transitions should not start when globally suspended 4 https://bugs.webkit.org/show_bug.cgi?id=114915 5 6 Reviewed by Sam Weinig. 7 8 When the Document's AnimationController was suspended, we still 9 started new transitions and animations. Change this so that 10 animations enter a paused-but-new state, where they are frozen 11 until the AnimationController resumes. At that time, it is as 12 if they had just appeared: any delay counts down before 13 the animation starts. 14 15 For transitions, the change in value must still happen, but 16 it does so immediately. No transitionend event should be fired. 17 This produces a slightly confusing behaviour, because any 18 in-progress transitions are suspended, but any new style changes 19 happen instantly. This might sound contradictory, but in general 20 suspending the document is a rare (and dangerous) thing to do. 21 22 Previously, the Document would call resumeAnimations as it loaded, 23 effectively starting all the animations. This meant if you suspended 24 animations before loading a document, it was ignored as soon as the 25 load finished. Now there is a separate method startAnimationsIfNotSuspended 26 which checks to see if the document is suspended as it loads. 27 28 In order to handle this case, I added a new state to the Animation 29 machinery: AnimationStatePausedNew. This is an animation that was created 30 in the suspended state. 31 32 Tests: animations/added-while-suspended.html 33 transitions/started-while-suspended.html 34 35 * WebCore.exp.in: Export AnimationController::isSuspended(). 36 37 * dom/Document.cpp: 38 (WebCore::Document::implicitClose): 39 resumeAnimationsForDocument() -> startAnimationsIfNotSuspended() 40 41 * page/animation/AnimationBase.cpp: 42 (WebCore::nameForState): New name for AnimationStatePausedNew. 43 (WebCore::AnimationBase::updateStateMachine): Handle new state AnimationStatePausedNew. The 44 most important change is that when go from PausedNew to Running, we jump back into 45 the New state and continue from there. 46 (WebCore::AnimationBase::updatePlayState): suspended -> isSuspended 47 * page/animation/AnimationBase.h: New state: AnimationStatePausedNew 48 (WebCore::AnimationBase::waitingToStart): Add AnimationStatePausedNew. 49 (WebCore::AnimationBase::paused): Add AnimationStatePausedNew. 50 (WebCore::AnimationBase::isNew): Add AnimationStatePausedNew. 51 52 * page/animation/AnimationController.cpp: 53 (WebCore::AnimationControllerPrivate::AnimationControllerPrivate): Initialise m_suspended. 54 (WebCore::AnimationControllerPrivate::clear): suspended -> isSuspended 55 (WebCore::AnimationControllerPrivate::updateAnimations): Ditto. 56 (WebCore::AnimationControllerPrivate::updateAnimationTimerForRenderer): Ditto. 57 (WebCore::AnimationControllerPrivate::suspendAnimations): Update m_suspended. 58 (WebCore::AnimationControllerPrivate::resumeAnimations): Ditto. 59 (WebCore::AnimationControllerPrivate::suspendAnimationsForDocument): 60 (WebCore::AnimationControllerPrivate::resumeAnimationsForDocument): 61 (WebCore::AnimationControllerPrivate::startAnimationsIfNotSuspended): New method that will 62 only resume animations if we were not globally suspended. 63 (WebCore::AnimationController::isSuspended): New method. 64 (WebCore::AnimationController::suspendAnimations): Add logging. 65 (WebCore::AnimationController::resumeAnimations): Add logging. 66 (WebCore::AnimationController::suspendAnimationsForDocument): Add logging. 67 (WebCore::AnimationController::resumeAnimationsForDocument): Add logging. 68 (WebCore::AnimationController::startAnimationsIfNotSuspended): Calls private method. 69 * page/animation/AnimationController.h: 70 (AnimationController): Add isSuspended() and animationsForDocumentMayStart(). 71 * page/animation/AnimationControllerPrivate.h: 72 (WebCore::AnimationControllerPrivate::isSuspended): New method. 73 (AnimationControllerPrivate): Add m_isSuspended member. 74 75 * page/animation/CompositeAnimation.cpp: 76 (WebCore::CompositeAnimation::CompositeAnimation): Moved from header - initialise m_isSuspended. 77 (WebCore::CompositeAnimation::updateTransitions): Do not create ImplicitAnimation if suspended. 78 (WebCore::CompositeAnimation::updateKeyframeAnimations): Move to AnimationStatePausedNew if suspended. 79 (WebCore::CompositeAnimation::suspendAnimations): m_suspended -> m_isSuspended 80 (WebCore::CompositeAnimation::resumeAnimations): Ditto. 81 * page/animation/CompositeAnimation.h: 82 (WebCore::CompositeAnimation::isSuspended): Renamed from suspended() 83 84 * page/animation/KeyframeAnimation.cpp: 85 (WebCore::KeyframeAnimation::animate): If we're in the AnimationStatePausedNew state, then 86 we need to go to the first frame (to handle fill mode). 87 88 * testing/Internals.cpp: 89 (WebCore::Internals::animationsAreSuspended): New exposed method to reflect AnimationController. 90 * testing/Internals.h: Add animationsAreSuspended. 91 * testing/Internals.idl: Ditto. 92 1 93 2013-05-04 Sam Weinig <sam@webkit.org> 2 94 -
trunk/Source/WebCore/WebCore.exp.in
r149574 r149576 603 603 __ZN7WebCore18pluginScriptObjectEPN3JSC9ExecStateEPNS_13JSHTMLElementE 604 604 __ZN7WebCore18proxyServersForURLERKNS_4KURLEPKNS_17NetworkingContextE 605 __ZNK7WebCore19AnimationController11isSuspendedEv 605 606 __ZN7WebCore19AnimationController16resumeAnimationsEv 606 607 __ZN7WebCore19AnimationController17suspendAnimationsEv -
trunk/Source/WebCore/dom/Document.cpp
r149549 r149576 2397 2397 if (f) { 2398 2398 f->loader()->icon()->startLoader(); 2399 f->animation()-> resumeAnimationsForDocument(this);2399 f->animation()->startAnimationsIfNotSuspended(this); 2400 2400 } 2401 2401 -
trunk/Source/WebCore/page/animation/AnimationBase.cpp
r148145 r149576 123 123 case AnimationBase::AnimationStateLooping: return "Looping"; 124 124 case AnimationBase::AnimationStateEnding: return "Ending"; 125 case AnimationBase::AnimationStatePausedNew: return "PausedNew"; 125 126 case AnimationBase::AnimationStatePausedWaitTimer: return "PausedWaitTimer"; 126 127 case AnimationBase::AnimationStatePausedWaitStyleAvailable: return "PausedWaitStyleAvailable"; … … 204 205 LOG(Animations, "%p AnimationState %s -> StartWaitTimer", this, nameForState(m_animState)); 205 206 m_animState = AnimationStateStartWaitTimer; 207 } else { 208 // We are pausing before we even started. 209 LOG(Animations, "%p AnimationState %s -> AnimationStatePausedNew", this, nameForState(m_animState)); 210 m_animState = AnimationStatePausedNew; 206 211 } 207 212 break; … … 356 361 updateStateMachine(AnimationStateInputStartAnimation, 0); 357 362 break; 363 case AnimationStatePausedNew: 358 364 case AnimationStatePausedWaitResponse: 359 365 case AnimationStatePausedWaitStyleAvailable: … … 363 369 // When the AnimationStateInputStartTimeSet comes in and we were in AnimationStatePausedRun, we will notice 364 370 // that we have already set the startTime and will ignore it. 365 ASSERT(input == AnimationStateInputPlayStateRunning || input == AnimationStateInputStartTimeSet || input == AnimationStateInputStyleAvailable );371 ASSERT(input == AnimationStateInputPlayStateRunning || input == AnimationStateInputStartTimeSet || input == AnimationStateInputStyleAvailable || input == AnimationStateInputStartAnimation); 366 372 ASSERT(paused()); 367 373 368 374 if (input == AnimationStateInputPlayStateRunning) { 375 if (m_animState == AnimationStatePausedNew) { 376 // We were paused before we even started, and now we're supposed 377 // to start, so jump back to the New state and reset. 378 LOG(Animations, "%p AnimationState %s -> AnimationStateNew", this, nameForState(m_animState)); 379 m_animState = AnimationStateNew; 380 updateStateMachine(input, param); 381 break; 382 } 383 369 384 // Update the times 370 385 if (m_animState == AnimationStatePausedRun) … … 411 426 break; 412 427 } 413 428 414 429 ASSERT(m_animState == AnimationStatePausedWaitStyleAvailable); 415 430 // We are paused but we got the callback that notifies us that style has been updated. … … 492 507 // The state machine can be in one of two states: running, paused. 493 508 // Set the state machine to the desired state. 494 bool pause = playState == AnimPlayStatePaused || m_compAnim-> suspended();495 509 bool pause = playState == AnimPlayStatePaused || m_compAnim->isSuspended(); 510 496 511 if (pause == paused() && !isNew()) 497 512 return; 498 513 499 514 updateStateMachine(pause ? AnimationStateInputPlayStatePaused : AnimationStateInputPlayStateRunning, -1); 500 515 } -
trunk/Source/WebCore/page/animation/AnimationBase.h
r141314 r149576 79 79 AnimationStateLooping, // response received, animation running, loop timer running, waiting for fire 80 80 AnimationStateEnding, // received, animation running, end timer running, waiting for fire 81 AnimationStatePausedNew, // in pause mode when animation was created 81 82 AnimationStatePausedWaitTimer, // in pause mode when animation started 82 83 AnimationStatePausedWaitStyleAvailable, // in pause mode when waiting for style setup … … 116 117 bool playStatePlaying() const; 117 118 118 bool waitingToStart() const { return m_animState == AnimationStateNew || m_animState == AnimationStateStartWaitTimer ; }119 bool waitingToStart() const { return m_animState == AnimationStateNew || m_animState == AnimationStateStartWaitTimer || m_animState == AnimationStatePausedNew; } 119 120 bool preActive() const 120 121 { … … 125 126 bool active() const { return !postActive() && !preActive(); } 126 127 bool running() const { return !isNew() && !postActive(); } 127 bool paused() const { return m_pauseTime >= 0 ; }128 bool isNew() const { return m_animState == AnimationStateNew ; }128 bool paused() const { return m_pauseTime >= 0 || m_animState == AnimationStatePausedNew; } 129 bool isNew() const { return m_animState == AnimationStateNew || m_animState == AnimationStatePausedNew; } 129 130 bool waitingForStartTime() const { return m_animState == AnimationStateStartWaitResponse; } 130 131 bool waitingForStyleAvailable() const { return m_animState == AnimationStateStartWaitStyleAvailable; } -
trunk/Source/WebCore/page/animation/AnimationController.cpp
r148155 r149576 60 60 , m_animationsWaitingForStartTimeResponse() 61 61 , m_waitingForAsyncStartNotification(false) 62 , m_isSuspended(false) 62 63 { 63 64 } … … 85 86 return false; 86 87 animation->clearRenderer(); 87 return animation-> suspended();88 return animation->isSuspended(); 88 89 } 89 90 … … 96 97 for (RenderObjectAnimationMap::const_iterator it = m_compositeAnimations.begin(); it != animationsEnd; ++it) { 97 98 CompositeAnimation* compAnim = it->value.get(); 98 if (!compAnim-> suspended() && compAnim->hasAnimations()) {99 if (!compAnim->isSuspended() && compAnim->hasAnimations()) { 99 100 double t = compAnim->timeToNextService(); 100 101 if (t != -1 && (t < timeToNextService || timeToNextService == -1)) … … 124 125 125 126 RefPtr<CompositeAnimation> compAnim = m_compositeAnimations.get(renderer); 126 if (!compAnim-> suspended() && compAnim->hasAnimations())127 if (!compAnim->isSuspended() && compAnim->hasAnimations()) 127 128 timeToNextService = compAnim->timeToNextService(); 128 129 … … 265 266 void AnimationControllerPrivate::suspendAnimations() 266 267 { 268 if (isSuspended()) 269 return; 270 267 271 suspendAnimationsForDocument(m_frame->document()); 268 272 269 273 // Traverse subframes 270 274 for (Frame* child = m_frame->tree()->firstChild(); child; child = child->tree()->nextSibling()) 271 275 child->animation()->suspendAnimations(); 276 277 m_isSuspended = true; 272 278 } 273 279 274 280 void AnimationControllerPrivate::resumeAnimations() 275 281 { 282 if (!isSuspended()) 283 return; 284 276 285 resumeAnimationsForDocument(m_frame->document()); 277 286 278 287 // Traverse subframes 279 288 for (Frame* child = m_frame->tree()->firstChild(); child; child = child->tree()->nextSibling()) 280 289 child->animation()->resumeAnimations(); 290 291 m_isSuspended = false; 281 292 } 282 293 283 294 void AnimationControllerPrivate::suspendAnimationsForDocument(Document* document) 284 295 { 296 if (isSuspended()) 297 return; 298 285 299 setBeginAnimationUpdateTime(cBeginAnimationUpdateTimeNotSet); 286 300 287 301 RenderObjectAnimationMap::const_iterator animationsEnd = m_compositeAnimations.end(); 288 302 for (RenderObjectAnimationMap::const_iterator it = m_compositeAnimations.begin(); it != animationsEnd; ++it) { … … 293 307 } 294 308 } 295 309 296 310 updateAnimationTimer(); 297 311 } … … 299 313 void AnimationControllerPrivate::resumeAnimationsForDocument(Document* document) 300 314 { 315 if (!isSuspended()) 316 return; 317 301 318 setBeginAnimationUpdateTime(cBeginAnimationUpdateTimeNotSet); 302 319 303 320 RenderObjectAnimationMap::const_iterator animationsEnd = m_compositeAnimations.end(); 304 321 for (RenderObjectAnimationMap::const_iterator it = m_compositeAnimations.begin(); it != animationsEnd; ++it) { … … 309 326 } 310 327 } 311 328 312 329 updateAnimationTimer(); 330 } 331 332 void AnimationControllerPrivate::startAnimationsIfNotSuspended(Document* document) 333 { 334 if (!isSuspended()) 335 resumeAnimationsForDocument(document); 313 336 } 314 337 … … 579 602 } 580 603 604 bool AnimationController::isSuspended() const 605 { 606 return m_data->isSuspended(); 607 } 608 581 609 void AnimationController::suspendAnimations() 582 610 { 611 LOG(Animations, "controller is suspending animations"); 583 612 m_data->suspendAnimations(); 584 613 } … … 586 615 void AnimationController::resumeAnimations() 587 616 { 617 LOG(Animations, "controller is resuming animations"); 588 618 m_data->resumeAnimations(); 589 619 } … … 598 628 void AnimationController::suspendAnimationsForDocument(Document* document) 599 629 { 630 LOG(Animations, "suspending animations for document %p", document); 600 631 m_data->suspendAnimationsForDocument(document); 601 632 } … … 603 634 void AnimationController::resumeAnimationsForDocument(Document* document) 604 635 { 636 LOG(Animations, "resuming animations for document %p", document); 605 637 m_data->resumeAnimationsForDocument(document); 638 } 639 640 void AnimationController::startAnimationsIfNotSuspended(Document* document) 641 { 642 LOG(Animations, "animations may start for document %p", document); 643 m_data->startAnimationsIfNotSuspended(document); 606 644 } 607 645 -
trunk/Source/WebCore/page/animation/AnimationController.h
r141656 r149576 64 64 bool isRunningAcceleratedAnimationOnRenderer(RenderObject*, CSSPropertyID, bool isRunningNow = true) const; 65 65 66 bool isSuspended() const; 66 67 void suspendAnimations(); 67 68 void resumeAnimations(); … … 72 73 void suspendAnimationsForDocument(Document*); 73 74 void resumeAnimationsForDocument(Document*); 75 void startAnimationsIfNotSuspended(Document*); 74 76 75 77 void beginAnimationUpdate(); -
trunk/Source/WebCore/page/animation/AnimationControllerPrivate.h
r144935 r149576 76 76 bool hasAnimations() const { return !m_compositeAnimations.isEmpty(); } 77 77 78 bool isSuspended() const { return m_isSuspended; } 78 79 void suspendAnimations(); 79 80 void resumeAnimations(); … … 84 85 void suspendAnimationsForDocument(Document*); 85 86 void resumeAnimationsForDocument(Document*); 87 void startAnimationsIfNotSuspended(Document*); 86 88 87 89 bool isRunningAnimationOnRenderer(RenderObject*, CSSPropertyID, bool isRunningNow) const; … … 140 142 WaitingAnimationsSet m_animationsWaitingForStartTimeResponse; 141 143 bool m_waitingForAsyncStartNotification; 144 bool m_isSuspended; 142 145 }; 143 146 -
trunk/Source/WebCore/page/animation/CompositeAnimation.cpp
r148925 r149576 42 42 namespace WebCore { 43 43 44 CompositeAnimation::CompositeAnimation(AnimationControllerPrivate* animationController) 45 : m_animationController(animationController) 46 { 47 m_suspended = animationController->isSuspended(); 48 } 49 44 50 CompositeAnimation::~CompositeAnimation() 45 51 { … … 93 99 for (size_t i = 0; i < targetStyle->transitions()->size(); ++i) { 94 100 const Animation* anim = targetStyle->transitions()->animation(i); 95 bool isActiveTransition = anim->duration() || anim->delay() > 0;101 bool isActiveTransition = !m_suspended && (anim->duration() || anim->delay() > 0); 96 102 97 103 Animation::AnimationMode mode = anim->animationMode(); … … 253 259 } else if ((anim->duration() || anim->delay()) && anim->iterationCount() && animationName != none) { 254 260 keyframeAnim = KeyframeAnimation::create(const_cast<Animation*>(anim), renderer, i, this, targetStyle); 255 LOG(Animations, "Creating KeyframeAnimation %p with keyframes %s duration %.2f delay %.2f, iterations %.2f", keyframeAnim.get(), anim->name().utf8().data(), anim->duration(), anim->delay(), anim->iterationCount()); 261 LOG(Animations, "Creating KeyframeAnimation %p with keyframes %s, duration %.2f, delay %.2f, iterations %.2f", keyframeAnim.get(), anim->name().utf8().data(), anim->duration(), anim->delay(), anim->iterationCount()); 262 if (m_suspended) { 263 keyframeAnim->updatePlayState(AnimPlayStatePaused); 264 LOG(Animations, " (created in suspended/paused state)"); 265 } 256 266 #if !LOG_DISABLED 257 267 HashSet<CSSPropertyID>::const_iterator endProperties = keyframeAnim->keyframes().endProperties(); -
trunk/Source/WebCore/page/animation/CompositeAnimation.h
r141314 r149576 65 65 void suspendAnimations(); 66 66 void resumeAnimations(); 67 bool suspended() const { return m_suspended; }67 bool isSuspended() const { return m_suspended; } 68 68 69 69 bool hasAnimations() const { return !m_transitions.isEmpty() || !m_keyframeAnimations.isEmpty(); } … … 81 81 82 82 private: 83 CompositeAnimation(AnimationControllerPrivate* animationController) 84 : m_animationController(animationController) 85 , m_suspended(false) 86 { 87 } 83 CompositeAnimation(AnimationControllerPrivate*); 88 84 89 85 void updateTransitions(RenderObject*, RenderStyle* currentStyle, RenderStyle* targetStyle); -
trunk/Source/WebCore/page/animation/KeyframeAnimation.cpp
r149392 r149576 141 141 } 142 142 143 void KeyframeAnimation::animate(CompositeAnimation* , RenderObject*, const RenderStyle*, RenderStyle* targetStyle, RefPtr<RenderStyle>& animatedStyle)143 void KeyframeAnimation::animate(CompositeAnimation* compositeAnimation, RenderObject*, const RenderStyle*, RenderStyle* targetStyle, RefPtr<RenderStyle>& animatedStyle) 144 144 { 145 145 // Fire the start timeout if needed … … 147 147 148 148 // If we have not yet started, we will not have a valid start time, so just start the animation if needed. 149 if (isNew() && m_animation->playState() == AnimPlayStatePlaying )149 if (isNew() && m_animation->playState() == AnimPlayStatePlaying && !compositeAnimation->isSuspended()) 150 150 updateStateMachine(AnimationStateInputStartAnimation, -1); 151 151 -
trunk/Source/WebCore/testing/Internals.cpp
r149549 r149576 468 468 } 469 469 470 bool Internals::animationsAreSuspended(Document* document, ExceptionCode& ec) const 471 { 472 if (!document || !document->frame()) { 473 ec = INVALID_ACCESS_ERR; 474 return false; 475 } 476 477 AnimationController* controller = document->frame()->animation(); 478 if (!controller) 479 return false; 480 481 return controller->isSuspended(); 482 } 483 470 484 void Internals::suspendAnimations(Document* document, ExceptionCode& ec) const 471 485 { -
trunk/Source/WebCore/testing/Internals.h
r149549 r149576 100 100 // CSS Animation testing. 101 101 unsigned numberOfActiveAnimations() const; 102 bool animationsAreSuspended(Document*, ExceptionCode&) const; 102 103 void suspendAnimations(Document*, ExceptionCode&) const; 103 104 void resumeAnimations(Document*, ExceptionCode&) const; -
trunk/Source/WebCore/testing/Internals.idl
r149549 r149576 66 66 void suspendAnimations(Document document) raises (DOMException); 67 67 void resumeAnimations(Document document) raises (DOMException); 68 boolean animationsAreSuspended(in Document document) raises (DOMException); 68 69 boolean pauseAnimationAtTimeOnElement(DOMString animationName, double pauseTime, Element element) raises (DOMException); 69 70 boolean pauseAnimationAtTimeOnPseudoElement(DOMString animationName, double pauseTime, Element element, DOMString pseudoId) raises (DOMException); -
trunk/Source/WebKit/ChangeLog
r149574 r149576 1 2013-05-04 Dean Jackson <dino@apple.com> 2 3 Animations and Transitions should not start when globally suspended 4 https://bugs.webkit.org/show_bug.cgi?id=114915 5 6 Reviewed by Sam Weinig. 7 8 Export AnimationController::isSuspended 9 10 * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: 11 1 12 2013-05-04 Sam Weinig <sam@webkit.org> 2 13 -
trunk/Source/WebKit/mac/ChangeLog
r149574 r149576 1 2013-05-04 Dean Jackson <dino@apple.com> 2 3 Animations and Transitions should not start when globally suspended 4 https://bugs.webkit.org/show_bug.cgi?id=114915 5 6 Reviewed by Sam Weinig. 7 8 The WebView private API cssAnimationsSuspended did not necessarily 9 reflect the reality of the Frame's AnimationController value because it 10 was caching rather than asking directly. While the WebCore part of this 11 patch ensured loading the Document wouldn't resume all animations, it 12 is still better to ask directly. 13 14 * WebView/WebView.mm: 15 (-[WebView cssAnimationsSuspended]): Call into AnimationController. 16 (-[WebView setCSSAnimationsSuspended:]): Ditto. 17 * WebView/WebViewData.h: Remove cssAnimationsSuspended boolean. 18 * WebView/WebViewData.mm: Ditto. 19 (-[WebViewPrivate init]): 20 1 21 2013-05-04 Sam Weinig <sam@webkit.org> 2 22 -
trunk/Source/WebKit/mac/WebView/WebView.mm
r149476 r149576 2770 2770 - (BOOL)cssAnimationsSuspended 2771 2771 { 2772 return _private->cssAnimationsSuspended; 2772 // should ask the page! 2773 Frame* frame = core([self mainFrame]); 2774 if (frame) 2775 return frame->animation()->isSuspended(); 2776 2777 return false; 2773 2778 } 2774 2779 2775 2780 - (void)setCSSAnimationsSuspended:(BOOL)suspended 2776 2781 { 2777 if (suspended == _private->cssAnimationsSuspended) 2782 Frame* frame = core([self mainFrame]); 2783 if (suspended == frame->animation()->isSuspended()) 2778 2784 return; 2779 2785 2780 _private->cssAnimationsSuspended = suspended;2781 2782 Frame* frame = core([self mainFrame]);2783 2786 if (suspended) 2784 2787 frame->animation()->suspendAnimations(); -
trunk/Source/WebKit/mac/WebView/WebViewData.h
r145849 r149576 138 138 BOOL becomingFirstResponderFromOutside; 139 139 BOOL usesPageCache; 140 BOOL cssAnimationsSuspended;141 140 142 141 NSColor *backgroundColor; -
trunk/Source/WebKit/mac/WebView/WebViewData.mm
r145849 r149576 81 81 usesPageCache = YES; 82 82 shouldUpdateWhileOffscreen = YES; 83 cssAnimationsSuspended = NO;84 83 85 84 zoomMultiplier = 1; -
trunk/Source/WebKit/win/ChangeLog
r149432 r149576 1 2013-05-04 Dean Jackson <dino@apple.com> 2 3 Animations and Transitions should not start when globally suspended 4 https://bugs.webkit.org/show_bug.cgi?id=114915 5 6 Reviewed by Sam Weinig. 7 8 Export AnimationController::isSuspended 9 10 * WebKit.vcproj/WebKitExports.def.in: 11 1 12 2013-05-01 Sergio Villar Senin <svillar@igalia.com> 2 13 -
trunk/Source/WebKit/win/WebKit.vcproj/WebKitExports.def.in
r149432 r149576 334 334 ?isPageBoxVisible@Document@WebCore@@QAE_NH@Z 335 335 ?isActive@InsertionPoint@WebCore@@QBE_NXZ 336 ?isSuspended@AnimationController@WebCore@@QBE_NXZ 336 337 ?suspendAnimations@AnimationController@WebCore@@QAEXXZ 337 338 ?resumeAnimations@AnimationController@WebCore@@QAEXXZ -
trunk/Source/autotools/symbols.filter
r149432 r149576 185 185 _ZN7WebCore8Document16isPageBoxVisibleEi; 186 186 _ZN7WebCore18ContentDistributor22ensureSelectFeatureSetEPNS_13ElementShadowE; 187 _ZNK7WebCore19AnimationController11isSuspendedEv; 187 188 _ZN7WebCore19AnimationController17suspendAnimationsEv; 188 189 _ZN7WebCore19AnimationController16resumeAnimationsEv;
Note: See TracChangeset
for help on using the changeset viewer.