Changeset 183990 in webkit
- Timestamp:
- May 8, 2015, 2:44:28 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 5 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r183989 r183990 1 2015-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 1 16 2015-05-08 Csaba Osztrogonác <ossy@webkit.org> 2 17 -
trunk/Source/WebCore/ChangeLog
r183987 r183990 1 2015-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 1 16 2015-05-08 Youenn Fablet <youenn.fablet@crf.canon.fr> 2 17 -
trunk/Source/WebCore/dom/Document.h
r183985 r183990 949 949 virtual void postTask(Task) override final; // Executes the task on context's thread asynchronously. 950 950 951 #if ENABLE(REQUEST_ANIMATION_FRAME)952 ScriptedAnimationController* scriptedAnimationController() { return m_scriptedAnimationController.get(); }953 #endif954 951 void suspendScriptedAnimationControllerCallbacks(); 955 952 void resumeScriptedAnimationControllerCallbacks(); -
trunk/Source/WebCore/dom/ScriptedAnimationController.cpp
r183985 r183990 35 35 #include "FrameView.h" 36 36 #include "InspectorInstrumentation.h" 37 #include "Logging.h"38 #include "MainFrame.h"39 37 #include "RequestAnimationFrameCallback.h" 40 38 #include "Settings.h" … … 87 85 return; 88 86 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 91 87 m_isThrottled = isThrottled; 92 88 if (m_animationTimer.isActive()) { … … 96 92 #else 97 93 UNUSED_PARAM(isThrottled); 98 #endif99 }100 101 bool ScriptedAnimationController::isThrottled() const102 {103 #if USE(REQUEST_ANIMATION_FRAME_TIMER) && USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)104 return m_isThrottled;105 #else106 return false;107 94 #endif 108 95 } -
trunk/Source/WebCore/dom/ScriptedAnimationController.h
r183985 r183990 69 69 void resume(); 70 70 void setThrottled(bool); 71 WEBCORE_EXPORT bool isThrottled() const;72 71 73 72 void windowScreenDidChange(PlatformDisplayID); -
trunk/Source/WebCore/page/FrameView.cpp
r183985 r183990 81 81 #include "SVGDocument.h" 82 82 #include "SVGSVGElement.h" 83 #include "ScriptedAnimationController.h"84 83 #include "ScrollAnimator.h" 85 84 #include "ScrollingCoordinator.h" … … 1757 1756 void FrameView::viewportContentsChanged() 1758 1757 { 1759 if (!frame().view()) {1760 // The frame is being destroyed.1761 return;1762 }1763 1764 1758 // When the viewport contents changes (scroll, resize, style recalc, layout, ...), 1765 1759 // 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(); 1771 1762 } 1772 1763 … … 2105 2096 } 2106 2097 2107 void FrameView::applyRecursivelyWithVisibleRect(const std::function<void (FrameView& frameView, const IntRect& visibleRect)>& apply) 2108 { 2098 void FrameView::resumeVisibleImageAnimationsIncludingSubframes() 2099 { 2100 auto* renderView = frame().contentRenderer(); 2101 if (!renderView) 2102 return; 2103 2109 2104 IntRect windowClipRect = this->windowClipRect(); 2110 2105 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); 2112 2111 2113 2112 // Recursive call for subframes. We cache the current FrameView's windowClipRect to avoid recomputing it for every subframe. … … 2115 2114 for (Frame* childFrame = frame().tree().firstChild(); childFrame; childFrame = childFrame->tree().nextSibling()) { 2116 2115 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 } 2159 2118 } 2160 2119 … … 3101 3060 } 3102 3061 3103 void FrameView::updateThrottledDOMTimersState( const IntRect& visibleRect)3062 void FrameView::updateThrottledDOMTimersState() 3104 3063 { 3105 3064 if (m_throttledTimers.isEmpty()) 3106 3065 return; 3066 3067 IntRect visibleRect = windowToContents(windowClipRect()); 3107 3068 3108 3069 // Do not iterate over the HashSet because calling DOMTimer::updateThrottlingStateAfterViewportChange() -
trunk/Source/WebCore/page/FrameView.h
r183985 r183990 597 597 void performPostLayoutTasks(); 598 598 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(); 604 600 605 601 void updateLayerFlushThrottling(); -
trunk/Source/WebCore/testing/Internals.cpp
r183985 r183990 99 99 #include "RuntimeEnabledFeatures.h" 100 100 #include "SchemeRegistry.h" 101 #include "ScriptedAnimationController.h"102 101 #include "ScrollingCoordinator.h" 103 102 #include "SerializedScriptValue.h" … … 766 765 } 767 766 return timer->m_throttleState == DOMTimer::ShouldThrottle; 768 }769 770 bool Internals::isRequestAnimationFrameThrottled() const771 {772 #if ENABLE(REQUEST_ANIMATION_FRAME)773 auto* scriptedAnimationController = contextDocument()->scriptedAnimationController();774 if (!scriptedAnimationController)775 return false;776 return scriptedAnimationController->isThrottled();777 #else778 return false;779 #endif780 767 } 781 768 -
trunk/Source/WebCore/testing/Internals.h
r183985 r183990 114 114 // DOMTimers throttling testing. 115 115 bool isTimerThrottled(int timeoutId, ExceptionCode&); 116 bool isRequestAnimationFrameThrottled() const;117 116 118 117 // Spatial Navigation testing. -
trunk/Source/WebCore/testing/Internals.idl
r183985 r183990 280 280 [RaisesException] boolean isTimerThrottled(long timerHandle); 281 281 282 boolean isRequestAnimationFrameThrottled();283 284 282 [RaisesException] void startTrackingStyleRecalcs(); 285 283 [RaisesException] unsigned long styleRecalcCount();
Note:
See TracChangeset
for help on using the changeset viewer.