⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 243810 in webkit


Ignore:
Timestamp:
Apr 3, 2019, 10:27:20 AM (7 years ago)
Author:
Chris Dumez
Message:

Remove legacy webkitRequestAnimationFrame time quirk
https://bugs.webkit.org/show_bug.cgi?id=196458
<rdar://problem/49490207>

Reviewed by Simon Fraser.

Source/WebCore:

Remove legacy webkitRequestAnimationFrame time quirk and log a deprecation
warning whenever webkitRequestAnimationFrame is called.

  • dom/ScriptedAnimationController.cpp:

(WebCore::ScriptedAnimationController::serviceScriptedAnimations):

  • page/DOMWindow.cpp:

(WebCore::DOMWindow::requestAnimationFrame):
(WebCore::DOMWindow::webkitRequestAnimationFrame):

LayoutTests:

Rebaseline webkitRequestAnimationFrame layout test now that we log a deprecation
warning.

  • fast/animation/request-animation-frame-prefix-expected.txt:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r243809 r243810  
     12019-04-03  Chris Dumez  <cdumez@apple.com>
     2
     3        Remove legacy webkitRequestAnimationFrame time quirk
     4        https://bugs.webkit.org/show_bug.cgi?id=196458
     5        <rdar://problem/49490207>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Rebaseline webkitRequestAnimationFrame layout test now that we log a deprecation
     10        warning.
     11
     12        * fast/animation/request-animation-frame-prefix-expected.txt:
     13
    1142019-04-03  Alex Christensen  <achristensen@webkit.org>
    215
  • trunk/LayoutTests/fast/animation/request-animation-frame-prefix-expected.txt

    r139509 r243810  
     1CONSOLE MESSAGE: line 27: webkitRequestAnimationFrame() is deprecated and will be removed. Please use requestAnimationFrame() instead.
    12Tests the timestamps provided to prefixed webkitRequestAnimationFrame callbacks
    23
  • trunk/Source/WebCore/ChangeLog

    r243807 r243810  
     12019-04-03  Chris Dumez  <cdumez@apple.com>
     2
     3        Remove legacy webkitRequestAnimationFrame time quirk
     4        https://bugs.webkit.org/show_bug.cgi?id=196458
     5        <rdar://problem/49490207>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Remove legacy webkitRequestAnimationFrame time quirk and log a deprecation
     10        warning whenever webkitRequestAnimationFrame is called.
     11
     12        * dom/ScriptedAnimationController.cpp:
     13        (WebCore::ScriptedAnimationController::serviceScriptedAnimations):
     14        * page/DOMWindow.cpp:
     15        (WebCore::DOMWindow::requestAnimationFrame):
     16        (WebCore::DOMWindow::webkitRequestAnimationFrame):
     17
    1182019-04-03  Sihui Liu  <sihui_liu@apple.com>
    219
  • trunk/Source/WebCore/dom/RequestAnimationFrameCallback.h

    r220210 r243810  
    4545    int m_id;
    4646    bool m_firedOrCancelled;
    47     bool m_useLegacyTimeBase;
    4847};
    4948
  • trunk/Source/WebCore/dom/ScriptedAnimationController.cpp

    r243459 r243810  
    199199    // We round this to the nearest microsecond so that we can return a time that matches what is returned by document.timeline.currentTime.
    200200    double highResNowMs = std::round(1000 * timestamp);
    201     double legacyHighResNowMs = 1000 * (timestamp + m_document->loader()->timing().referenceWallTime().secondsSinceEpoch().seconds());
    202201
    203202    // First, generate a list of callbacks to consider.  Callbacks registered from this point
     
    214213            callback->m_firedOrCancelled = true;
    215214            InspectorInstrumentationCookie cookie = InspectorInstrumentation::willFireAnimationFrame(protectedDocument, callback->m_id);
    216             if (callback->m_useLegacyTimeBase)
    217                 callback->handleEvent(legacyHighResNowMs);
    218             else
    219                 callback->handleEvent(highResNowMs);
     215            callback->handleEvent(highResNowMs);
    220216            InspectorInstrumentation::didFireAnimationFrame(cookie);
    221217        }
  • trunk/Source/WebCore/page/DOMWindow.cpp

    r243705 r243810  
    16961696int DOMWindow::requestAnimationFrame(Ref<RequestAnimationFrameCallback>&& callback)
    16971697{
    1698     callback->m_useLegacyTimeBase = false;
    16991698    auto* document = this->document();
    17001699    if (!document)
     
    17051704int DOMWindow::webkitRequestAnimationFrame(Ref<RequestAnimationFrameCallback>&& callback)
    17061705{
    1707     callback->m_useLegacyTimeBase = true;
    1708     auto* document = this->document();
    1709     if (!document)
    1710         return 0;
    1711     return document->requestAnimationFrame(WTFMove(callback));
     1706    static bool firstTime = true;
     1707    if (firstTime && document()) {
     1708        document()->addConsoleMessage(MessageSource::JS, MessageLevel::Warning, "webkitRequestAnimationFrame() is deprecated and will be removed. Please use requestAnimationFrame() instead."_s);
     1709        firstTime = false;
     1710    }
     1711    return requestAnimationFrame(WTFMove(callback));
    17121712}
    17131713
Note: See TracChangeset for help on using the changeset viewer.