Changeset 183990 in webkit


Ignore:
Timestamp:
May 8, 2015, 2:44:28 AM (10 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r183985.
https://bugs.webkit.org/show_bug.cgi?id=144796

broke loader/go-back-to-different-window-size.html (Requested
by kling on #webkit).

Reverted changeset:

"Throttle RequestAnimationFrame in subframes that are outside
the viewport"
https://bugs.webkit.org/show_bug.cgi?id=144718
http://trac.webkit.org/changeset/183985

Location:
trunk
Files:
5 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r183989 r183990  
     12015-05-08  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r183985.
     4        https://bugs.webkit.org/show_bug.cgi?id=144796
     5
     6        broke loader/go-back-to-different-window-size.html (Requested
     7        by kling on #webkit).
     8
     9        Reverted changeset:
     10
     11        "Throttle RequestAnimationFrame in subframes that are outside
     12        the viewport"
     13        https://bugs.webkit.org/show_bug.cgi?id=144718
     14        http://trac.webkit.org/changeset/183985
     15
    1162015-05-08  Csaba Osztrogonác  <ossy@webkit.org>
    217
  • trunk/Source/WebCore/ChangeLog

    r183987 r183990  
     12015-05-08  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r183985.
     4        https://bugs.webkit.org/show_bug.cgi?id=144796
     5
     6        broke loader/go-back-to-different-window-size.html (Requested
     7        by kling on #webkit).
     8
     9        Reverted changeset:
     10
     11        "Throttle RequestAnimationFrame in subframes that are outside
     12        the viewport"
     13        https://bugs.webkit.org/show_bug.cgi?id=144718
     14        http://trac.webkit.org/changeset/183985
     15
    1162015-05-08  Youenn Fablet  <youenn.fablet@crf.canon.fr>
    217
  • trunk/Source/WebCore/dom/Document.h

    r183985 r183990  
    949949    virtual void postTask(Task) override final; // Executes the task on context's thread asynchronously.
    950950
    951 #if ENABLE(REQUEST_ANIMATION_FRAME)
    952     ScriptedAnimationController* scriptedAnimationController() { return m_scriptedAnimationController.get(); }
    953 #endif
    954951    void suspendScriptedAnimationControllerCallbacks();
    955952    void resumeScriptedAnimationControllerCallbacks();
  • trunk/Source/WebCore/dom/ScriptedAnimationController.cpp

    r183985 r183990  
    3535#include "FrameView.h"
    3636#include "InspectorInstrumentation.h"
    37 #include "Logging.h"
    38 #include "MainFrame.h"
    3937#include "RequestAnimationFrameCallback.h"
    4038#include "Settings.h"
     
    8785        return;
    8886
    89     LOG(Animations, "%p - Setting RequestAnimationFrame throttling state to %d in frame %p (isMainFrame: %d)", this, isThrottled, m_document->frame(), m_document->frame() ? m_document->frame()->isMainFrame() : 0);
    90 
    9187    m_isThrottled = isThrottled;
    9288    if (m_animationTimer.isActive()) {
     
    9692#else
    9793    UNUSED_PARAM(isThrottled);
    98 #endif
    99 }
    100 
    101 bool ScriptedAnimationController::isThrottled() const
    102 {
    103 #if USE(REQUEST_ANIMATION_FRAME_TIMER) && USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
    104     return m_isThrottled;
    105 #else
    106     return false;
    10794#endif
    10895}
  • trunk/Source/WebCore/dom/ScriptedAnimationController.h

    r183985 r183990  
    6969    void resume();
    7070    void setThrottled(bool);
    71     WEBCORE_EXPORT bool isThrottled() const;
    7271
    7372    void windowScreenDidChange(PlatformDisplayID);
  • trunk/Source/WebCore/page/FrameView.cpp

    r183985 r183990  
    8181#include "SVGDocument.h"
    8282#include "SVGSVGElement.h"
    83 #include "ScriptedAnimationController.h"
    8483#include "ScrollAnimator.h"
    8584#include "ScrollingCoordinator.h"
     
    17571756void FrameView::viewportContentsChanged()
    17581757{
    1759     if (!frame().view()) {
    1760         // The frame is being destroyed.
    1761         return;
    1762     }
    1763 
    17641758    // When the viewport contents changes (scroll, resize, style recalc, layout, ...),
    17651759    // check if we should resume animated images or unthrottle DOM timers.
    1766     applyRecursivelyWithVisibleRect([] (FrameView& frameView, const IntRect& visibleRect) {
    1767         frameView.resumeVisibleImageAnimations(visibleRect);
    1768         frameView.updateThrottledDOMTimersState(visibleRect);
    1769         frameView.updateScriptedAnimationsThrottlingState(visibleRect);
    1770     });
     1760    resumeVisibleImageAnimationsIncludingSubframes();
     1761    updateThrottledDOMTimersState();
    17711762}
    17721763
     
    21052096}
    21062097
    2107 void FrameView::applyRecursivelyWithVisibleRect(const std::function<void (FrameView& frameView, const IntRect& visibleRect)>& apply)
    2108 {
     2098void FrameView::resumeVisibleImageAnimationsIncludingSubframes()
     2099{
     2100    auto* renderView = frame().contentRenderer();
     2101    if (!renderView)
     2102        return;
     2103
    21092104    IntRect windowClipRect = this->windowClipRect();
    21102105    auto visibleRect = windowToContents(windowClipRect);
    2111     apply(*this, visibleRect);
     2106    if (visibleRect.isEmpty())
     2107        return;
     2108
     2109    // Resume paused image animations in this frame.
     2110    renderView->resumePausedImageAnimationsIfNeeded(visibleRect);
    21122111
    21132112    // Recursive call for subframes. We cache the current FrameView's windowClipRect to avoid recomputing it for every subframe.
     
    21152114    for (Frame* childFrame = frame().tree().firstChild(); childFrame; childFrame = childFrame->tree().nextSibling()) {
    21162115        if (auto* childView = childFrame->view())
    2117             childView->applyRecursivelyWithVisibleRect(apply);
    2118     }
    2119 }
    2120 
    2121 void FrameView::resumeVisibleImageAnimations(const IntRect& visibleRect)
    2122 {
    2123     if (visibleRect.isEmpty())
    2124         return;
    2125 
    2126     if (auto* renderView = frame().contentRenderer())
    2127         renderView->resumePausedImageAnimationsIfNeeded(visibleRect);
    2128 }
    2129 
    2130 void FrameView::updateScriptedAnimationsThrottlingState(const IntRect& visibleRect)
    2131 {
    2132 #if ENABLE(REQUEST_ANIMATION_FRAME)
    2133     if (frame().isMainFrame())
    2134         return;
    2135 
    2136     auto* document = frame().document();
    2137     if (!document)
    2138         return;
    2139 
    2140     auto* scriptedAnimationController = document->scriptedAnimationController();
    2141     if (!scriptedAnimationController)
    2142         return;
    2143 
    2144     // FIXME: This doesn't work for subframes of a "display: none" frame because
    2145     // they have a non-null ownerRenderer.
    2146     bool shouldThrottle = !frame().ownerRenderer() || visibleRect.isEmpty();
    2147     scriptedAnimationController->setThrottled(shouldThrottle);
    2148 #else
    2149     UNUSED_PARAM(visibleRect);
    2150 #endif
    2151 }
    2152 
    2153 
    2154 void FrameView::resumeVisibleImageAnimationsIncludingSubframes()
    2155 {
    2156     applyRecursivelyWithVisibleRect([] (FrameView& frameView, const IntRect& visibleRect) {
    2157         frameView.resumeVisibleImageAnimations(visibleRect);
    2158     });
     2116            childView->resumeVisibleImageAnimationsIncludingSubframes();
     2117    }
    21592118}
    21602119
     
    31013060}
    31023061
    3103 void FrameView::updateThrottledDOMTimersState(const IntRect& visibleRect)
     3062void FrameView::updateThrottledDOMTimersState()
    31043063{
    31053064    if (m_throttledTimers.isEmpty())
    31063065        return;
     3066
     3067    IntRect visibleRect = windowToContents(windowClipRect());
    31073068
    31083069    // Do not iterate over the HashSet because calling DOMTimer::updateThrottlingStateAfterViewportChange()
  • trunk/Source/WebCore/page/FrameView.h

    r183985 r183990  
    597597    void performPostLayoutTasks();
    598598    void autoSizeIfEnabled();
    599 
    600     void applyRecursivelyWithVisibleRect(const std::function<void (FrameView& frameView, const IntRect& visibleRect)>&);
    601     void updateThrottledDOMTimersState(const IntRect& visibleRect);
    602     void resumeVisibleImageAnimations(const IntRect& visibleRect);
    603     void updateScriptedAnimationsThrottlingState(const IntRect& visibleRect);
     599    void updateThrottledDOMTimersState();
    604600
    605601    void updateLayerFlushThrottling();
  • trunk/Source/WebCore/testing/Internals.cpp

    r183985 r183990  
    9999#include "RuntimeEnabledFeatures.h"
    100100#include "SchemeRegistry.h"
    101 #include "ScriptedAnimationController.h"
    102101#include "ScrollingCoordinator.h"
    103102#include "SerializedScriptValue.h"
     
    766765    }
    767766    return timer->m_throttleState == DOMTimer::ShouldThrottle;
    768 }
    769 
    770 bool Internals::isRequestAnimationFrameThrottled() const
    771 {
    772 #if ENABLE(REQUEST_ANIMATION_FRAME)
    773     auto* scriptedAnimationController = contextDocument()->scriptedAnimationController();
    774     if (!scriptedAnimationController)
    775         return false;
    776     return scriptedAnimationController->isThrottled();
    777 #else
    778     return false;
    779 #endif
    780767}
    781768
  • trunk/Source/WebCore/testing/Internals.h

    r183985 r183990  
    114114    // DOMTimers throttling testing.
    115115    bool isTimerThrottled(int timeoutId, ExceptionCode&);
    116     bool isRequestAnimationFrameThrottled() const;
    117116
    118117    // Spatial Navigation testing.
  • trunk/Source/WebCore/testing/Internals.idl

    r183985 r183990  
    280280    [RaisesException] boolean isTimerThrottled(long timerHandle);
    281281
    282     boolean isRequestAnimationFrameThrottled();
    283 
    284282    [RaisesException] void startTrackingStyleRecalcs();
    285283    [RaisesException] unsigned long styleRecalcCount();
Note: See TracChangeset for help on using the changeset viewer.