Changeset 116319 in webkit


Ignore:
Timestamp:
May 7, 2012 10:37:30 AM (12 years ago)
Author:
nduca@chromium.org
Message:

Unreviewed, rolling out r115525.
http://trac.webkit.org/changeset/115525
https://bugs.webkit.org/show_bug.cgi?id=66683

Too many pages rely on DOMTimeStamp as first argument.
Reverting while we consider next steps.

Source/WebCore:

  • WebCore.exp.in:
  • bindings/js/JSRequestAnimationFrameCallbackCustom.cpp:

(WebCore::JSRequestAnimationFrameCallback::handleEvent):

  • dom/Document.cpp:

(WebCore::Document::serviceScriptedAnimations):

  • dom/Document.h:

(Document):

  • dom/RequestAnimationFrameCallback.h:

(RequestAnimationFrameCallback):

  • dom/RequestAnimationFrameCallback.idl:
  • dom/ScriptedAnimationController.cpp:

(WebCore::ScriptedAnimationController::ScriptedAnimationController):
(WebCore::ScriptedAnimationController::serviceScriptedAnimations):
(WebCore):
(WebCore::ScriptedAnimationController::windowScreenDidChange):
(WebCore::ScriptedAnimationController::scheduleAnimation):
(WebCore::ScriptedAnimationController::animationTimerFired):

  • dom/ScriptedAnimationController.h:

(ScriptedAnimationController):
(WebCore::ScriptedAnimationController::displayRefreshFired):

  • page/FrameView.cpp:

(WebCore::FrameView::serviceScriptedAnimations):

  • page/FrameView.h:

(FrameView):

  • platform/graphics/DisplayRefreshMonitor.cpp:

(WebCore::DisplayRefreshMonitor::DisplayRefreshMonitor):
(WebCore::DisplayRefreshMonitor::notifyClients):

  • platform/graphics/DisplayRefreshMonitor.h:

(DisplayRefreshMonitor):

  • platform/graphics/blackberry/DisplayRefreshMonitorBlackBerry.cpp:

(WebCore::DisplayRefreshMonitor::displayLinkFired):

  • platform/graphics/mac/DisplayRefreshMonitorMac.cpp:

(WebCore):
(WebCore::DisplayRefreshMonitor::requestRefreshCallback):
(WebCore::DisplayRefreshMonitor::displayLinkFired):

Source/WebKit/chromium:

  • src/PageWidgetDelegate.cpp:

(WebKit::PageWidgetDelegate::animate):

  • src/WebViewImpl.cpp:

(WebKit::WebViewImpl::updateAnimations):

Location:
trunk/Source
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r116317 r116319  
     12012-05-07  Nat Duca  <nduca@chromium.org>
     2
     3        Unreviewed, rolling out r115525.
     4        http://trac.webkit.org/changeset/115525
     5        https://bugs.webkit.org/show_bug.cgi?id=66683
     6
     7        Too many pages rely on DOMTimeStamp as first argument.
     8        Reverting while we consider next steps.
     9
     10        * WebCore.exp.in:
     11        * bindings/js/JSRequestAnimationFrameCallbackCustom.cpp:
     12        (WebCore::JSRequestAnimationFrameCallback::handleEvent):
     13        * dom/Document.cpp:
     14        (WebCore::Document::serviceScriptedAnimations):
     15        * dom/Document.h:
     16        (Document):
     17        * dom/RequestAnimationFrameCallback.h:
     18        (RequestAnimationFrameCallback):
     19        * dom/RequestAnimationFrameCallback.idl:
     20        * dom/ScriptedAnimationController.cpp:
     21        (WebCore::ScriptedAnimationController::ScriptedAnimationController):
     22        (WebCore::ScriptedAnimationController::serviceScriptedAnimations):
     23        (WebCore):
     24        (WebCore::ScriptedAnimationController::windowScreenDidChange):
     25        (WebCore::ScriptedAnimationController::scheduleAnimation):
     26        (WebCore::ScriptedAnimationController::animationTimerFired):
     27        * dom/ScriptedAnimationController.h:
     28        (ScriptedAnimationController):
     29        (WebCore::ScriptedAnimationController::displayRefreshFired):
     30        * page/FrameView.cpp:
     31        (WebCore::FrameView::serviceScriptedAnimations):
     32        * page/FrameView.h:
     33        (FrameView):
     34        * platform/graphics/DisplayRefreshMonitor.cpp:
     35        (WebCore::DisplayRefreshMonitor::DisplayRefreshMonitor):
     36        (WebCore::DisplayRefreshMonitor::notifyClients):
     37        * platform/graphics/DisplayRefreshMonitor.h:
     38        (DisplayRefreshMonitor):
     39        * platform/graphics/blackberry/DisplayRefreshMonitorBlackBerry.cpp:
     40        (WebCore::DisplayRefreshMonitor::displayLinkFired):
     41        * platform/graphics/mac/DisplayRefreshMonitorMac.cpp:
     42        (WebCore):
     43        (WebCore::DisplayRefreshMonitor::requestRefreshCallback):
     44        (WebCore::DisplayRefreshMonitor::displayLinkFired):
     45
    1462012-05-07  Tommy Widenflycht  <tommyw@google.com>
    247
  • trunk/Source/WebCore/WebCore.exp.in

    r116277 r116319  
    20512051
    20522052#if ENABLE(REQUEST_ANIMATION_FRAME)
    2053 __ZN7WebCore9FrameView25serviceScriptedAnimationsEd
     2053__ZN7WebCore9FrameView25serviceScriptedAnimationsEy
    20542054#endif
    20552055
  • trunk/Source/WebCore/bindings/js/JSRequestAnimationFrameCallbackCustom.cpp

    r115525 r116319  
    3434namespace WebCore {
    3535
    36 bool JSRequestAnimationFrameCallback::handleEvent(double highResNowMs)
     36bool JSRequestAnimationFrameCallback::handleEvent(DOMTimeStamp time)
    3737{
    3838    if (!canInvokeCallback())
     
    4444
    4545    MarkedArgumentBuffer args;
    46     args.append(jsNumber(highResNowMs));
     46    args.append(jsNumber(time));
    4747
    4848    bool raisedException = false;
  • trunk/Source/WebCore/dom/Document.cpp

    r116277 r116319  
    58065806}
    58075807
    5808 void Document::serviceScriptedAnimations(double monotonicAnimationStartTime)
     5808void Document::serviceScriptedAnimations(DOMTimeStamp time)
    58095809{
    58105810    if (!m_scriptedAnimationController)
    58115811        return;
    5812     m_scriptedAnimationController->serviceScriptedAnimations(monotonicAnimationStartTime);
     5812    m_scriptedAnimationController->serviceScriptedAnimations(time);
    58135813}
    58145814#endif
  • trunk/Source/WebCore/dom/Document.h

    r116066 r116319  
    11251125    int webkitRequestAnimationFrame(PassRefPtr<RequestAnimationFrameCallback>);
    11261126    void webkitCancelAnimationFrame(int id);
    1127     void serviceScriptedAnimations(double monotonicAnimationStartTime);
     1127    void serviceScriptedAnimations(DOMTimeStamp);
    11281128#endif
    11291129
  • trunk/Source/WebCore/dom/RequestAnimationFrameCallback.h

    r115525 r116319  
    3232#define RequestAnimationFrameCallback_h
    3333
     34#include "DOMTimeStamp.h"
    3435#include <wtf/RefCounted.h>
    3536
     
    3940public:
    4041    virtual ~RequestAnimationFrameCallback() { }
    41     virtual bool handleEvent(double highResTimeMs) = 0;
     42    virtual bool handleEvent(DOMTimeStamp) = 0;
    4243
    4344    int m_id;
     
    4849
    4950#endif // RequestAnimationFrameCallback_h
     51
  • trunk/Source/WebCore/dom/RequestAnimationFrameCallback.idl

    r115525 r116319  
    3434        Conditional=REQUEST_ANIMATION_FRAME,
    3535    ] RequestAnimationFrameCallback{
    36         // highResTime is passed as high resolution timestamp, see
    37         // http://www.w3.org/TR/hr-time/ for details.
    3836#if defined(V8_BINDING) && V8_BINDING
    39         boolean handleEvent(in double highResTime);
     37        boolean handleEvent(in DOMTimeStamp time);
    4038#else
    41         [Custom] boolean handleEvent(in double highResTime);
     39        [Custom] boolean handleEvent(in DOMTimeStamp time);
    4240#endif
    43 
     41       
    4442    };
    4543}
  • trunk/Source/WebCore/dom/ScriptedAnimationController.cpp

    r116230 r116319  
    3030
    3131#include "Document.h"
    32 #include "DocumentLoader.h"
    3332#include "FrameView.h"
    3433#include "InspectorInstrumentation.h"
     
    5453#if USE(REQUEST_ANIMATION_FRAME_TIMER)
    5554    , m_animationTimer(this, &ScriptedAnimationController::animationTimerFired)
    56     , m_lastAnimationFrameTimeMonotonic(0)
     55    , m_lastAnimationFrameTime(0)
    5756#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
    5857    , m_useTimer(false)
     
    109108}
    110109
    111 void ScriptedAnimationController::serviceScriptedAnimations(double monotonicTimeNow)
     110void ScriptedAnimationController::serviceScriptedAnimations(DOMTimeStamp time)
    112111{
    113112    if (!m_callbacks.size() || m_suspendCount || (m_document->settings() && !m_document->settings()->requestAnimationFrameEnabled()))
    114113        return;
    115 
    116     double highResNowMs = 1000.0 * m_document->loader()->timing()->convertMonotonicTimeToZeroBasedDocumentTime(monotonicTimeNow);
    117114
    118115    // First, generate a list of callbacks to consider.  Callbacks registered from this point
     
    129126            callback->m_firedOrCancelled = true;
    130127            InspectorInstrumentationCookie cookie = InspectorInstrumentation::willFireAnimationFrame(m_document, callback->m_id);
    131             callback->handleEvent(highResNowMs);
     128            callback->handleEvent(time);
    132129            InspectorInstrumentation::didFireAnimationFrame(cookie);
    133130        }
     
    145142        scheduleAnimation();
    146143}
    147 
     144   
    148145void ScriptedAnimationController::windowScreenDidChange(PlatformDisplayID displayID)
    149146{
     
    154151#else
    155152    UNUSED_PARAM(displayID);
    156 #endif
     153#endif   
    157154}
    158155
     
    167164        if (DisplayRefreshMonitorManager::sharedManager()->scheduleAnimation(this))
    168165            return;
    169 
     166           
    170167        m_useTimer = true;
    171168    }
     
    173170    if (m_animationTimer.isActive())
    174171        return;
    175 
    176     double scheduleDelay = max<double>(MinimumAnimationInterval - (monotonicallyIncreasingTime() - m_lastAnimationFrameTimeMonotonic), 0);
     172       
     173    double scheduleDelay = max<double>(MinimumAnimationInterval - (currentTime() - m_lastAnimationFrameTime), 0);
    177174    m_animationTimer.startOneShot(scheduleDelay);
    178175#else
     
    185182void ScriptedAnimationController::animationTimerFired(Timer<ScriptedAnimationController>*)
    186183{
    187     m_lastAnimationFrameTimeMonotonic = monotonicallyIncreasingTime();
    188     serviceScriptedAnimations(m_lastAnimationFrameTimeMonotonic);
    189 }
    190 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
    191 void ScriptedAnimationController::displayRefreshFired(double monotonicTimeNow)
    192 {
    193     serviceScriptedAnimations(monotonicTimeNow);
     184    m_lastAnimationFrameTime = currentTime();
     185    serviceScriptedAnimations(convertSecondsToDOMTimeStamp(m_lastAnimationFrameTime));
    194186}
    195187#endif
    196 #endif
    197 
    198 
    199188
    200189}
    201190
    202191#endif
     192
  • trunk/Source/WebCore/dom/ScriptedAnimationController.h

    r115525 r116319  
    6262    CallbackId registerCallback(PassRefPtr<RequestAnimationFrameCallback>);
    6363    void cancelCallback(CallbackId);
    64     void serviceScriptedAnimations(double monotonicTimeNow);
     64    void serviceScriptedAnimations(DOMTimeStamp);
    6565
    6666    void suspend();
     
    7171private:
    7272    ScriptedAnimationController(Document*, PlatformDisplayID);
    73 
     73   
    7474    typedef Vector<RefPtr<RequestAnimationFrameCallback> > CallbackList;
    7575    CallbackList m_callbacks;
     
    8484    void animationTimerFired(Timer<ScriptedAnimationController>*);
    8585    Timer<ScriptedAnimationController> m_animationTimer;
    86     double m_lastAnimationFrameTimeMonotonic;
     86    double m_lastAnimationFrameTime;
    8787
    8888#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
    8989    // Override for DisplayRefreshMonitorClient
    90     virtual void displayRefreshFired(double timestamp);
     90    virtual void displayRefreshFired(double timestamp) { serviceScriptedAnimations(convertSecondsToDOMTimeStamp(timestamp)); }
    9191
    9292    bool m_useTimer;
     
    100100
    101101#endif // ScriptedAnimationController_h
     102
  • trunk/Source/WebCore/page/FrameView.cpp

    r115525 r116319  
    21622162
    21632163#if ENABLE(REQUEST_ANIMATION_FRAME)
    2164 void FrameView::serviceScriptedAnimations(double monotonicAnimationStartTime)
     2164void FrameView::serviceScriptedAnimations(DOMTimeStamp time)
    21652165{
    21662166    for (Frame* frame = m_frame.get(); frame; frame = frame->tree()->traverseNext()) {
     
    21742174
    21752175    for (size_t i = 0; i < documents.size(); ++i)
    2176         documents[i]->serviceScriptedAnimations(monotonicAnimationStartTime);
     2176        documents[i]->serviceScriptedAnimations(time);
    21772177}
    21782178#endif
  • trunk/Source/WebCore/page/FrameView.h

    r115525 r116319  
    113113
    114114#if ENABLE(REQUEST_ANIMATION_FRAME)
    115     void serviceScriptedAnimations(double monotonicAnimationStartTime);
     115    void serviceScriptedAnimations(DOMTimeStamp);
    116116#endif
    117117
  • trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.cpp

    r115525 r116319  
    5454
    5555DisplayRefreshMonitor::DisplayRefreshMonitor(PlatformDisplayID displayID)
    56     : m_monotonicAnimationStartTime(0)
     56    : m_timestamp(0)
    5757    , m_active(true)
    5858    , m_scheduled(false)
     
    7676void DisplayRefreshMonitor::notifyClients()
    7777{
    78     double monotonicAnimationStartTime;
     78    double timestamp;
    7979    {
    8080        MutexLocker lock(m_mutex);
    8181        m_scheduled = false;
    82         monotonicAnimationStartTime = m_monotonicAnimationStartTime;
     82        timestamp = m_timestamp;
    8383    }
    8484
    8585    for (size_t i = 0; i < m_clients.size(); ++i)
    86         m_clients[i]->fireDisplayRefreshIfNeeded(monotonicAnimationStartTime);
     86        m_clients[i]->fireDisplayRefreshIfNeeded(timestamp);
    8787
    8888    {
  • trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.h

    r115525 r116319  
    114114    static void refreshDisplayOnMainThread(void* data);
    115115
    116     double m_monotonicAnimationStartTime;
     116    double m_timestamp;
    117117    bool m_active;
    118118    bool m_scheduled;
  • trunk/Source/WebCore/platform/graphics/blackberry/DisplayRefreshMonitorBlackBerry.cpp

    r115525 r116319  
    8282    m_previousFrameDone = false;
    8383
    84     m_monotonicAnimationStartTime = monotonicallyIncreasingTime();
     84    m_timestamp = currentTime();
    8585
    8686    callOnMainThread(refreshDisplayOnMainThread, this);
  • trunk/Source/WebCore/platform/graphics/mac/DisplayRefreshMonitorMac.cpp

    r115525 r116319  
    4646    return kCVReturnSuccess;
    4747}
    48 
     48 
    4949DisplayRefreshMonitor::~DisplayRefreshMonitor()
    5050{
     
    6262    if (!m_active)
    6363        return false;
    64 
     64       
    6565    if (!m_displayLink) {
    6666        m_active = false;
     
    7979        m_active = true;
    8080    }
    81 
     81   
    8282    MutexLocker lock(m_mutex);
    8383    m_scheduled = true;
     
    9393    m_previousFrameDone = false;
    9494
    95     double webKitMonotonicNow = monotonicallyIncreasingTime();
    96     double timeUntilOutput = outputTimeSeconds - nowSeconds;
    97     // FIXME: Should this be using webKitMonotonicNow?
    98     m_monotonicAnimationStartTime = webKitMonotonicNow + timeUntilOutput;
    99 
     95    double webKitNow = currentTime();
     96    m_timestamp = webKitNow - nowSeconds + outputTimeSeconds;
     97   
    10098    callOnMainThread(refreshDisplayOnMainThread, this);
    10199}
  • trunk/Source/WebKit/chromium/ChangeLog

    r116317 r116319  
     12012-05-07  Nat Duca  <nduca@chromium.org>
     2
     3        Unreviewed, rolling out r115525.
     4        http://trac.webkit.org/changeset/115525
     5        https://bugs.webkit.org/show_bug.cgi?id=66683
     6
     7        Too many pages rely on DOMTimeStamp as first argument.
     8        Reverting while we consider next steps.
     9
     10        * src/PageWidgetDelegate.cpp:
     11        (WebKit::PageWidgetDelegate::animate):
     12        * src/WebViewImpl.cpp:
     13        (WebKit::WebViewImpl::updateAnimations):
     14
    1152012-05-07  Tommy Widenflycht  <tommyw@google.com>
    216
  • trunk/Source/WebKit/chromium/src/PageWidgetDelegate.cpp

    r115525 r116319  
    6060    if (!view)
    6161        return;
    62     view->serviceScriptedAnimations(monotonicFrameBeginTime);
     62    double timeShift = currentTime() - monotonicallyIncreasingTime();
     63    view->serviceScriptedAnimations(convertSecondsToDOMTimeStamp(monotonicFrameBeginTime + timeShift));
    6364#endif
    6465}
  • trunk/Source/WebKit/chromium/src/WebViewImpl.cpp

    r115771 r116319  
    14331433    TRACE_EVENT("WebViewImpl::updateAnimations", this, 0);
    14341434
     1435    WebFrameImpl* webframe = mainFrameImpl();
     1436    if (!webframe)
     1437        return;
     1438    FrameView* view = webframe->frameView();
     1439    if (!view)
     1440        return;
     1441
    14351442    // Create synthetic wheel events as necessary for fling.
    14361443    if (m_gestureAnimation) {
     
    14401447            m_gestureAnimation.clear();
    14411448    }
    1442 
    1443     if (!m_page)
    1444         return;
    14451449
    14461450    PageWidgetDelegate::animate(m_page.get(), monotonicFrameBeginTime);
Note: See TracChangeset for help on using the changeset viewer.