Title: [179126] branches/safari-600.1.4.15-branch

Diff

Modified: branches/safari-600.1.4.15-branch/LayoutTests/ChangeLog (179125 => 179126)


--- branches/safari-600.1.4.15-branch/LayoutTests/ChangeLog	2015-01-26 18:33:47 UTC (rev 179125)
+++ branches/safari-600.1.4.15-branch/LayoutTests/ChangeLog	2015-01-26 19:38:48 UTC (rev 179126)
@@ -1,5 +1,19 @@
 2015-01-26  David Kilzer  <[email protected]>
 
+        Merge r172854.
+
+    2014-08-21  Antti Koivisto  <[email protected]>
+
+        Animated GIFs scrolled out of view still cause titlebar blur to update, on tumblr.com page
+        https://bugs.webkit.org/show_bug.cgi?id=136139
+
+        Reviewed by Simon Fraser.
+
+        * fast/repaint/no-animation-outside-viewport-subframe-expected.txt: Added.
+        * fast/repaint/no-animation-outside-viewport-subframe.html: Added.
+
+2015-01-26  David Kilzer  <[email protected]>
+
         Merge r177135.
 
     2014-12-10  Chris Dumez  <[email protected]>

Added: branches/safari-600.1.4.15-branch/LayoutTests/fast/repaint/no-animation-outside-viewport-subframe-expected.txt (0 => 179126)


--- branches/safari-600.1.4.15-branch/LayoutTests/fast/repaint/no-animation-outside-viewport-subframe-expected.txt	                        (rev 0)
+++ branches/safari-600.1.4.15-branch/LayoutTests/fast/repaint/no-animation-outside-viewport-subframe-expected.txt	2015-01-26 19:38:48 UTC (rev 179126)
@@ -0,0 +1,12 @@
+Test that animated gif in a frame outside viewport does not trigger repaint.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS repaintRectsAfterScroll is ""
+PASS repaintRectsAfterScrollBack is not ""
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
+

Added: branches/safari-600.1.4.15-branch/LayoutTests/fast/repaint/no-animation-outside-viewport-subframe.html (0 => 179126)


--- branches/safari-600.1.4.15-branch/LayoutTests/fast/repaint/no-animation-outside-viewport-subframe.html	                        (rev 0)
+++ branches/safari-600.1.4.15-branch/LayoutTests/fast/repaint/no-animation-outside-viewport-subframe.html	2015-01-26 19:38:48 UTC (rev 179126)
@@ -0,0 +1,53 @@
+<html>
+<head>
+<script>jsTestIsAsync = true;</script>
+<script src=""
+<script>
+    description("Test that animated gif in a frame outside viewport does not trigger repaint.");
+    function startTrackingRepaints()
+    {
+        document.body.offsetTop;
+        window.internals.startTrackingRepaints();
+        window.scrollTo(0,200);
+        testRunner.display();
+        setTimeout(testAfterScroll, 200);
+    }
+
+    function testAfterScroll()
+    {
+        repaintRectsAfterScroll = window.internals.repaintRectsAsText();
+        window.internals.stopTrackingRepaints();
+
+        shouldBeEqualToString("repaintRectsAfterScroll", "");
+
+        window.internals.startTrackingRepaints();
+        window.scrollTo(0,0);
+        testRunner.display();
+        setTimeout(testAfterScrollBack, 200);
+    }
+
+    function testAfterScrollBack()
+    {
+        repaintRectsAfterScrollBack = window.internals.repaintRectsAsText();
+        window.internals.stopTrackingRepaints();
+
+        shouldNotBeEqualToString("repaintRectsAfterScrollBack", "");
+
+        finishJSTest();
+    }
+
+    function start() {
+        if (!window.testRunner || !window.internals)
+            return;
+
+        var img = new Image();
+        img._onload_ = startTrackingRepaints;
+        img.src = ""
+    }
+</script>
+</head>
+<body _onload_="start()">
+<iframe srcdoc="<img src=""
+<div style="height:1000px"></div>
+<script src=""
+</html>

Modified: branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog (179125 => 179126)


--- branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog	2015-01-26 18:33:47 UTC (rev 179125)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog	2015-01-26 19:38:48 UTC (rev 179126)
@@ -1,5 +1,41 @@
 2015-01-26  David Kilzer  <[email protected]>
 
+        Merge r172854.
+
+    2014-08-21  Antti Koivisto  <[email protected]>
+
+        Animated GIFs scrolled out of view still cause titlebar blur to update, on tumblr.com page
+        https://bugs.webkit.org/show_bug.cgi?id=136139
+
+        Reviewed by Simon Fraser.
+
+        The mechanism for pausing GIF images outside the viewport did not work for subframes.
+
+        Test: fast/repaint/no-animation-outside-viewport-subframe.html
+
+        * WebCore.exp.in:
+        * page/FrameView.cpp:
+        (WebCore::FrameView::scrollPositionChanged):
+        (WebCore::FrameView::resumeVisibleImageAnimationsIncludingSubframes):
+
+            Add a function for resuming animations as needed in all subframes.
+            This is used after scrolling instead of calling the RenderView function directly.
+
+        * page/FrameView.h:
+        * page/Page.cpp:
+        (WebCore::Page::resumeAnimatingImages):
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::newImageAnimationFrameAvailable):
+
+            Determine the overall visible rect so that it is correct in subframes too.
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::scrollTo):
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::resumePausedImageAnimationsIfNeeded):
+
+2015-01-26  David Kilzer  <[email protected]>
+
         Merge r177135.
 
     2014-12-10  Chris Dumez  <[email protected]>

Modified: branches/safari-600.1.4.15-branch/Source/WebCore/WebCore.exp.in (179125 => 179126)


--- branches/safari-600.1.4.15-branch/Source/WebCore/WebCore.exp.in	2015-01-26 18:33:47 UTC (rev 179125)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/WebCore.exp.in	2015-01-26 19:38:48 UTC (rev 179126)
@@ -2529,7 +2529,6 @@
 _WebUIApplicationWillEnterForegroundNotification
 _WebUIApplicationWillResignActiveNotification
 __ZN7WebCore10CredentialC1EP13__SecIdentityPK9__CFArrayNS_21CredentialPersistenceE
-__ZN7WebCore10RenderView35resumePausedImageAnimationsIfNeededEv
 __ZN7WebCore10ScrollView15setScrollOffsetERKNS_8IntPointE
 __ZN7WebCore10ScrollView21setExposedContentRectERKNS_9FloatRectE
 __ZN7WebCore10ScrollView24setUnobscuredContentSizeERKNS_9FloatSizeE
@@ -2755,6 +2754,7 @@
 __ZN7WebCore9FrameView32setCustomFixedPositionLayoutRectERKNS_7IntRectE
 __ZN7WebCore9FrameView33rectForViewportConstrainedObjectsERKNS_10LayoutRectERKNS_10LayoutSizeEfbNS_30ScrollBehaviorForFixedElementsE
 __ZN7WebCore9FrameView36scheduleLayerFlushAllowingThrottlingEv
+__ZN7WebCore9FrameView46resumeVisibleImageAnimationsIncludingSubframesEv
 __ZN7WebCore9PageGroup17removeVisitedLinkERKNS_3URLE
 __ZNK7WebCore10FloatPointcv7CGPointEv
 __ZNK7WebCore10ScrollView18exposedContentRectEv

Modified: branches/safari-600.1.4.15-branch/Source/WebCore/page/FrameView.cpp (179125 => 179126)


--- branches/safari-600.1.4.15-branch/Source/WebCore/page/FrameView.cpp	2015-01-26 18:33:47 UTC (rev 179125)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/page/FrameView.cpp	2015-01-26 19:38:48 UTC (rev 179126)
@@ -2064,12 +2064,22 @@
         document->sendWillRevealEdgeEventsIfNeeded(oldPosition, newPosition, visibleContentRect(), contentsSize());
 
     if (RenderView* renderView = this->renderView()) {
-        renderView->resumePausedImageAnimationsIfNeeded();
         if (renderView->usesCompositing())
             renderView->compositor().frameViewDidScroll();
     }
+
+    resumeVisibleImageAnimationsIncludingSubframes();
 }
 
+void FrameView::resumeVisibleImageAnimationsIncludingSubframes()
+{
+    // A change in scroll position may affect image visibility in subframes.
+    for (auto* frame = m_frame.get(); frame; frame = frame->tree().traverseNext(m_frame.get())) {
+        if (auto* renderView = frame->contentRenderer())
+            renderView->resumePausedImageAnimationsIfNeeded();
+    }
+}
+
 void FrameView::updateLayerPositionsAfterScrolling()
 {
     // If we're scrolling as a result of updating the view size after layout, we'll update widgets and layer positions soon anyway.

Modified: branches/safari-600.1.4.15-branch/Source/WebCore/page/FrameView.h (179125 => 179126)


--- branches/safari-600.1.4.15-branch/Source/WebCore/page/FrameView.h	2015-01-26 18:33:47 UTC (rev 179125)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/page/FrameView.h	2015-01-26 19:38:48 UTC (rev 179126)
@@ -244,6 +244,8 @@
     virtual IntPoint maximumScrollPosition() const override;
     void delayedScrollEventTimerFired(Timer<FrameView>&);
 
+    void resumeVisibleImageAnimationsIncludingSubframes();
+
     // This is different than visibleContentRect() in that it ignores negative (or overly positive)
     // offsets from rubber-banding, and it takes zooming into account. 
     LayoutRect viewportConstrainedVisibleContentRect() const;

Modified: branches/safari-600.1.4.15-branch/Source/WebCore/page/Page.cpp (179125 => 179126)


--- branches/safari-600.1.4.15-branch/Source/WebCore/page/Page.cpp	2015-01-26 18:33:47 UTC (rev 179125)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/page/Page.cpp	2015-01-26 19:38:48 UTC (rev 179126)
@@ -1191,11 +1191,8 @@
 {
     // Drawing models which cache painted content while out-of-window (WebKit2's composited drawing areas, etc.)
     // require that we repaint animated images to kickstart the animation loop.
-
-    for (Frame* frame = m_mainFrame.get(); frame; frame = frame->tree().traverseNext()) {
-        if (auto* renderView = frame->contentRenderer())
-            renderView->resumePausedImageAnimationsIfNeeded();
-    }
+    if (FrameView* view = mainFrame().view())
+        view->resumeVisibleImageAnimationsIncludingSubframes();
 }
 
 void Page::createPageThrottler()

Modified: branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderElement.cpp (179125 => 179126)


--- branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderElement.cpp	2015-01-26 18:33:47 UTC (rev 179125)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderElement.cpp	2015-01-26 19:38:48 UTC (rev 179126)
@@ -1321,7 +1321,8 @@
 
 void RenderElement::newImageAnimationFrameAvailable(CachedImage& image)
 {
-    auto visibleRect = view().frameView().visibleContentRect();
+    auto& frameView = view().frameView();
+    auto visibleRect = frameView.windowToContents(frameView.windowClipRect());
     if (!shouldRepaintForImageAnimation(*this, visibleRect)) {
         // FIXME: It would be better to pass the image along with the renderer
         // so that we can be smarter about detecting if the image is inside the

Modified: branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderLayer.cpp (179125 => 179126)


--- branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderLayer.cpp	2015-01-26 18:33:47 UTC (rev 179125)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderLayer.cpp	2015-01-26 19:38:48 UTC (rev 179126)
@@ -2303,7 +2303,7 @@
     if (scrollsOverflow())
         frame.loader().client().didChangeScrollOffset();
 
-    renderer().view().resumePausedImageAnimationsIfNeeded();
+    view.frameView().resumeVisibleImageAnimationsIncludingSubframes();
 }
 
 static inline bool frameElementAndViewPermitScroll(HTMLFrameElementBase* frameElementBase, FrameView* frameView) 

Modified: branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderView.cpp (179125 => 179126)


--- branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderView.cpp	2015-01-26 18:33:47 UTC (rev 179125)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderView.cpp	2015-01-26 19:38:48 UTC (rev 179126)
@@ -1339,7 +1339,7 @@
 
 void RenderView::resumePausedImageAnimationsIfNeeded()
 {
-    auto visibleRect = frameView().visibleContentRect();
+    auto visibleRect = frameView().windowToContents(frameView().windowClipRect());
     Vector<RenderElement*, 10> toRemove;
     for (auto* renderer : m_renderersWithPausedImageAnimation) {
         if (renderer->repaintForPausedImageAnimationsIfNeeded(visibleRect))

Modified: branches/safari-600.1.4.15-branch/Source/WebKit/mac/ChangeLog (179125 => 179126)


--- branches/safari-600.1.4.15-branch/Source/WebKit/mac/ChangeLog	2015-01-26 18:33:47 UTC (rev 179125)
+++ branches/safari-600.1.4.15-branch/Source/WebKit/mac/ChangeLog	2015-01-26 19:38:48 UTC (rev 179126)
@@ -1,3 +1,11 @@
+2015-01-26  David Kilzer  <[email protected]>
+
+        Merge r172854.
+
+        * WebView/WebView.mm:
+        (-[WebView _didFinishScrollingOrZooming]): Call
+        FrameView::resumeVisibleImageAnimationsIncludingSubframes().
+
 2015-01-25  David Kilzer  <[email protected]>
 
         Merge r177301.

Modified: branches/safari-600.1.4.15-branch/Source/WebKit/mac/WebView/WebView.mm (179125 => 179126)


--- branches/safari-600.1.4.15-branch/Source/WebKit/mac/WebView/WebView.mm	2015-01-26 18:33:47 UTC (rev 179125)
+++ branches/safari-600.1.4.15-branch/Source/WebKit/mac/WebView/WebView.mm	2015-01-26 19:38:48 UTC (rev 179126)
@@ -1572,9 +1572,8 @@
     _private->mainViewIsScrollingOrZooming = NO;
     [self setDefersCallbacks:NO];
     [[self mainFrame] setTimeoutsPaused:NO];
-    FrameView* view = [self _mainCoreFrame]->view();
-    if (view && view->renderView())
-        view->renderView()->resumePausedImageAnimationsIfNeeded();
+    if (FrameView* view = [self _mainCoreFrame]->view())
+        view->resumeVisibleImageAnimationsIncludingSubframes();
 }
 
 - (void)_setResourceLoadSchedulerSuspended:(BOOL)suspend
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to