Diff
Modified: branches/safari-537.73-branch/Source/WebCore/ChangeLog (158398 => 158399)
--- branches/safari-537.73-branch/Source/WebCore/ChangeLog 2013-10-31 21:59:49 UTC (rev 158398)
+++ branches/safari-537.73-branch/Source/WebCore/ChangeLog 2013-10-31 22:21:55 UTC (rev 158399)
@@ -1,3 +1,48 @@
+2013-10-31 Lucas Forschler <[email protected]>
+
+ Merge r157056
+
+ 2013-10-07 Tim Horton <[email protected]>
+
+ Animated images are not restarted when page visibility changes
+ https://bugs.webkit.org/show_bug.cgi?id=122464
+ <rdar://problem/14293474>
+
+ Reviewed by Simon Fraser.
+
+ Always kickstart animated images when the page visibility changes,
+ which can occur via window occlusion, and which is independent of in-window
+ state, which we were previously using to advance animation.
+
+ No new tests; attempts to make a test have resulted only in a flaky, timing-dependent test.
+
+ * page/Frame.cpp:
+ (WebCore::Frame::resumeActiveDOMObjectsAndAnimations):
+ Move this call to resumeAnimatingImages() up to Page.
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::setIsInWindow):
+ Move this call to resumeAnimatingImages() up to Page.
+
+ * WebCore.exp.in
+ * page/FrameView.h:
+ * page/Page.h:
+ Move resumeAnimatingImages() itself up to Page.
+
+ * page/Page.cpp:
+ (WebCore::Page::setIsInWindow):
+ Resume animated images when we move in-window.
+
+ (WebCore::Page::setVisibilityState):
+ Resume animated images when we become visible.
+ This is the one we were previously missing.
+
+ (WebCore::Page::resumeActiveDOMObjectsAndAnimations):
+ Resume animated images when we're told to.
+
+ (WebCore::Page::resumeAnimatingImages):
+ Kickstart any animated images in all frames.
+
2013-10-28 Brent Fulgham <[email protected]>
Modified: branches/safari-537.73-branch/Source/WebCore/WebCore.exp.in (158398 => 158399)
--- branches/safari-537.73-branch/Source/WebCore/WebCore.exp.in 2013-10-31 21:59:49 UTC (rev 158398)
+++ branches/safari-537.73-branch/Source/WebCore/WebCore.exp.in 2013-10-31 22:21:55 UTC (rev 158399)
@@ -878,6 +878,7 @@
__ZN7WebCore4Page20setDeviceScaleFactorEf
__ZN7WebCore4Page20unmarkAllTextMatchesEv
__ZN7WebCore4Page21markAllMatchesForTextERKN3WTF6StringEjbj
+__ZN7WebCore4Page21resumeAnimatingImagesEv
__ZN7WebCore4Page22allVisitedStateChangedEPNS_9PageGroupE
__ZN7WebCore4Page22nonFastScrollableRectsEPKNS_5FrameE
__ZN7WebCore4Page22removeLayoutMilestonesEj
@@ -1168,7 +1169,6 @@
__ZN7WebCore9FrameView20removeScrollableAreaEPNS_14ScrollableAreaE
__ZN7WebCore9FrameView20resetTrackedRepaintsEv
__ZN7WebCore9FrameView21flushDeferredRepaintsEv
-__ZN7WebCore9FrameView21resumeAnimatingImagesEv
__ZN7WebCore9FrameView22setBaseBackgroundColorERKNS_5ColorE
__ZN7WebCore9FrameView23updateCanHaveScrollbarsEv
__ZN7WebCore9FrameView24forceLayoutForPaginationERKNS_9FloatSizeES3_fNS_19AdjustViewSizeOrNotE
Modified: branches/safari-537.73-branch/Source/WebCore/page/FrameView.cpp (158398 => 158399)
--- branches/safari-537.73-branch/Source/WebCore/page/FrameView.cpp 2013-10-31 21:59:49 UTC (rev 158398)
+++ branches/safari-537.73-branch/Source/WebCore/page/FrameView.cpp 2013-10-31 22:21:55 UTC (rev 158399)
@@ -1065,19 +1065,8 @@
{
if (RenderView* renderView = this->renderView())
renderView->setIsInWindow(isInWindow);
-
- if (isInWindow)
- resumeAnimatingImages();
}
-void FrameView::resumeAnimatingImages()
-{
- // 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.
-
- CachedImage::resumeAnimatingImagesForLoader(frame()->document()->cachedResourceLoader());
-}
-
RenderObject* FrameView::layoutRoot(bool onlyDuringLayout) const
{
return onlyDuringLayout && layoutPending() ? 0 : m_layoutRoot;
Modified: branches/safari-537.73-branch/Source/WebCore/page/FrameView.h (158398 => 158399)
--- branches/safari-537.73-branch/Source/WebCore/page/FrameView.h 2013-10-31 21:59:49 UTC (rev 158398)
+++ branches/safari-537.73-branch/Source/WebCore/page/FrameView.h 2013-10-31 22:21:55 UTC (rev 158399)
@@ -435,8 +435,6 @@
bool visualUpdatesAllowedByClient() const { return m_visualUpdatesAllowedByClient; }
void setVisualUpdatesAllowedByClient(bool);
- void resumeAnimatingImages();
-
void setScrollPinningBehavior(ScrollPinningBehavior);
protected:
Modified: branches/safari-537.73-branch/Source/WebCore/page/Page.cpp (158398 => 158399)
--- branches/safari-537.73-branch/Source/WebCore/page/Page.cpp 2013-10-31 21:59:49 UTC (rev 158398)
+++ branches/safari-537.73-branch/Source/WebCore/page/Page.cpp 2013-10-31 22:21:55 UTC (rev 158399)
@@ -24,6 +24,7 @@
#include "AnimationController.h"
#include "BackForwardController.h"
#include "BackForwardList.h"
+#include "CachedImage.h"
#include "Chrome.h"
#include "ChromeClient.h"
#include "ClientRectList.h"
@@ -948,6 +949,9 @@
if (FrameView* frameView = frame->view())
frameView->setIsInWindow(isInWindow);
}
+
+ if (isInWindow)
+ resumeAnimatingImages();
}
void Page::windowScreenDidChange(PlatformDisplayID displayID)
@@ -1283,6 +1287,15 @@
#endif
}
+void Page::resumeAnimatingImages()
+{
+ // 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())
+ CachedImage::resumeAnimatingImagesForLoader(frame->document()->cachedResourceLoader());
+}
+
#if ENABLE(PAGE_VISIBILITY_API) || ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING)
void Page::setVisibilityState(PageVisibilityState visibilityState, bool isInitialState)
{
@@ -1306,6 +1319,7 @@
unthrottleTimers();
if (m_settings->hiddenPageCSSAnimationSuspensionEnabled())
mainFrame()->animation()->resumeAnimations();
+ resumeAnimatingImages();
}
#if !ENABLE(PAGE_VISIBILITY_API)
UNUSED_PARAM(isInitialState);
@@ -1501,6 +1515,8 @@
{
for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext())
frame->resumeActiveDOMObjectsAndAnimations();
+
+ resumeAnimatingImages();
}
bool Page::hasSeenAnyPlugin() const
Modified: branches/safari-537.73-branch/Source/WebCore/page/Page.h (158398 => 158399)
--- branches/safari-537.73-branch/Source/WebCore/page/Page.h 2013-10-31 21:59:49 UTC (rev 158398)
+++ branches/safari-537.73-branch/Source/WebCore/page/Page.h 2013-10-31 22:21:55 UTC (rev 158399)
@@ -354,6 +354,7 @@
#if ENABLE(PAGE_VISIBILITY_API) || ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING)
void setVisibilityState(PageVisibilityState, bool);
#endif
+ void resumeAnimatingImages();
PlatformDisplayID displayID() const { return m_displayID; }
Modified: branches/safari-537.73-branch/Source/WebKit2/ChangeLog (158398 => 158399)
--- branches/safari-537.73-branch/Source/WebKit2/ChangeLog 2013-10-31 21:59:49 UTC (rev 158398)
+++ branches/safari-537.73-branch/Source/WebKit2/ChangeLog 2013-10-31 22:21:55 UTC (rev 158399)
@@ -1,3 +1,19 @@
+2013-10-31 Lucas Forschler <[email protected]>
+
+ Merge r157056
+
+ 2013-10-07 Tim Horton <[email protected]>
+
+ Animated images are not restarted when page visibility changes
+ https://bugs.webkit.org/show_bug.cgi?id=122464
+ <rdar://problem/14293474>
+
+ Reviewed by Simon Fraser.
+
+ * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+ (WebKit::TiledCoreAnimationDrawingArea::resumePainting):
+ This is on Page now.
+
2013-10-28 Lucas Forschler <[email protected]>
Merge r157561
Modified: branches/safari-537.73-branch/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (158398 => 158399)
--- branches/safari-537.73-branch/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm 2013-10-31 21:59:49 UTC (rev 158398)
+++ branches/safari-537.73-branch/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm 2013-10-31 22:21:55 UTC (rev 158399)
@@ -391,15 +391,7 @@
if (m_webPage->windowIsVisible()) {
m_webPage->corePage()->resumeScriptedAnimations();
- Frame* frame = m_webPage->corePage()->mainFrame();
- if (!frame)
- return;
-
- FrameView* frameView = frame->view();
- if (!frameView)
- return;
-
- frameView->resumeAnimatingImages();
+ m_webPage->corePage()->resumeAnimatingImages();
}
}