Changeset 157056 in webkit for trunk/Source/WebCore/page/Page.cpp


Ignore:
Timestamp:
Oct 7, 2013, 1:27:16 PM (12 years ago)
Author:
[email protected]
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/page/Page.cpp

    r156924 r157056  
    896896            frameView->setIsInWindow(isInWindow);
    897897    }
     898
     899    if (isInWindow)
     900        resumeAnimatingImages();
    898901}
    899902
     
    12191222}
    12201223
     1224void Page::resumeAnimatingImages()
     1225{
     1226    // Drawing models which cache painted content while out-of-window (WebKit2's composited drawing areas, etc.)
     1227    // require that we repaint animated images to kickstart the animation loop.
     1228
     1229    for (Frame* frame = m_mainFrame.get(); frame; frame = frame->tree().traverseNext())
     1230        CachedImage::resumeAnimatingImagesForLoader(frame->document()->cachedResourceLoader());
     1231}
     1232
    12211233#if ENABLE(PAGE_VISIBILITY_API) || ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING)
    12221234void Page::setVisibilityState(PageVisibilityState visibilityState, bool isInitialState)
     
    12511263        if (m_settings->hiddenPageCSSAnimationSuspensionEnabled())
    12521264            mainFrame().animation().resumeAnimations();
     1265        resumeAnimatingImages();
    12531266    }
    12541267}
     
    14341447    for (Frame* frame = &mainFrame(); frame; frame = frame->tree().traverseNext())
    14351448        frame->resumeActiveDOMObjectsAndAnimations();
     1449
     1450    resumeAnimatingImages();
    14361451}
    14371452
Note: See TracChangeset for help on using the changeset viewer.