2011-02-15 James Robinson <jamesr@chromium.org>
authorjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Feb 2011 00:53:36 +0000 (00:53 +0000)
committerjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Feb 2011 00:53:36 +0000 (00:53 +0000)
commitce0a66f8c5137daee26528e7127326a90383cc40
treead8e79c65a681a30762143ae7d5e3559e4a54004
parent8de3795c42435ab5df847037a839c82df2a6f808
2011-02-15  James Robinson  <jamesr@chromium.org>

        Reviewed by Alexey Proskuryakov.

        requestAnimationFrame callbacks should not fire within a modal dialog
        https://bugs.webkit.org/show_bug.cgi?id=53188

        Tests that requestAnimationFrame callbacks are suspended while a modal
        dialog is showing.

        * fast/animation/request-animation-frame-during-modal-expected.txt: Added.
        * fast/animation/request-animation-frame-during-modal.html: Added.
2011-02-15  James Robinson  <jamesr@chromium.org>

        Reviewed by Alexey Proskuryakov.

        requestAnimationFrame callbacks should not fire within a modal dialog
        https://bugs.webkit.org/show_bug.cgi?id=53188

        requestAnimationFrame callbacks shouldn't fire while a modal dialog is up (like a window.alert()).
        This matches Firefox and other async APIs.  This patch moves the callback servicing into its own
        controller class which receives notifications on suspend/resume.

        Test: fast/animation/request-animation-frame-during-modal.html

        * WebCore.gypi:
        * bindings/js/ScriptDebugServer.cpp:
        (WebCore::ScriptDebugServer::setJavaScriptPaused):
        * dom/Document.cpp:
        (WebCore::Document::Document):
        (WebCore::Document::suspendScriptedAnimationControllerCallbacks):
        (WebCore::Document::resumeScriptedAnimationControllerCallbacks):
        (WebCore::Document::webkitRequestAnimationFrame):
        (WebCore::Document::webkitCancelRequestAnimationFrame):
        (WebCore::Document::serviceScriptedAnimations):
        * dom/Document.h:
        * dom/ScriptExecutionContext.h:
        (WebCore::ScriptExecutionContext::suspendScriptedAnimationControllerCallbacks):
        (WebCore::ScriptExecutionContext::resumeScriptedAnimationControllerCallbacks):
        * dom/ScriptedAnimationController.cpp: Added.
        (WebCore::ScriptedAnimationController::ScriptedAnimationController):
        (WebCore::ScriptedAnimationController::suspend):
        (WebCore::ScriptedAnimationController::resume):
        (WebCore::ScriptedAnimationController::registerCallback):
        (WebCore::ScriptedAnimationController::cancelCallback):
        (WebCore::ScriptedAnimationController::serviceScriptedAnimations):
        * dom/ScriptedAnimationController.h: Added.
        (WebCore::ScriptedAnimationController::create):
        * history/CachedFrame.cpp:
        (WebCore::CachedFrameBase::restore):
        (WebCore::CachedFrame::CachedFrame):
        * page/PageGroupLoadDeferrer.cpp:
        (WebCore::PageGroupLoadDeferrer::PageGroupLoadDeferrer):
        (WebCore::PageGroupLoadDeferrer::~PageGroupLoadDeferrer):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@78648 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/animation/request-animation-frame-during-modal-expected.txt [new file with mode: 0644]
LayoutTests/fast/animation/request-animation-frame-during-modal.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/WebCore.gypi
Source/WebCore/bindings/js/ScriptDebugServer.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/dom/ScriptExecutionContext.h
Source/WebCore/dom/ScriptedAnimationController.cpp [new file with mode: 0644]
Source/WebCore/dom/ScriptedAnimationController.h [new file with mode: 0644]
Source/WebCore/history/CachedFrame.cpp
Source/WebCore/page/PageGroupLoadDeferrer.cpp