• barraclough@apple.com's avatar
    Merge didMoveOnscreen / page visibility to isVisible · 21294937
    barraclough@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=126268
    
    Reviewed by Tim Horton.
    
    The onscreen state most closely tracks view visibility (though currently
    also tracks a mix of in-window state). Make more consistent, simplify,
    and move all animation suspension logic to Page, so it can be controlled
    by the PageThrottler.
    
    Source/WebCore: 
    
    * WebCore.exp.in:
    * page/EventHandler.cpp:
    (WebCore::EventHandler::fakeMouseMoveEventTimerFired):
    * page/FrameView.cpp:
    (WebCore::FrameView::shouldSetCursor):
    * page/Page.cpp:
    (WebCore::Page::Page):
        - initialize new variables.
    (WebCore::Page::setIsVisible):
        - merge setVisibilityState, didMoveOnscreen, willMoveOffscreen.
    (WebCore::Page::setIsPrerender):
        - switches visibility state from hidden to prerender.
    (WebCore::Page::visibilityState):
        - computed from m_isVisible, m_isPrerender.
    (WebCore::Page::hiddenPageCSSAnimationSuspensionStateChanged):
        - m_visibilityState -> m_isVisible.
    * page/Page.h:
        - remove didMoveOnscreen/willMoveOffscreen
          m_isOnscreen & m_visibilityState -> m_isVisible & m_isPrerender
          setVisibilityState -> setIsVisible & setIsPrerender.
    (WebCore::Page::isVisible):
        - isOnscreen -> isVisible.
    
    Source/WebKit/blackberry: 
    
    * Api/WebPage.cpp:
    (BlackBerry::WebKit::WebPagePrivate::setPageVisibilityState):
        - setVisibilityState -> setIsVisible.
    
    Source/WebKit/efl: 
    
    * ewk/ewk_view.cpp:
    (ewk_view_visibility_state_set):
        - setVisibilityState -> setIsVisible/setIsPrerender.
    
    Source/WebKit/gtk: 
    
    * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
    (DumpRenderTreeSupportGtk::setPageVisibility):
        - setVisibilityState -> setIsVisible/setIsPrerender.
    
    Source/WebKit/mac: 
    
    * WebView/WebView.mm:
    (-[WebView _commonInitializationWithFrameName:groupName:]):
    (-[WebView _updateVisibilityState]):
        - _setVisibilityState:isInitialState: -> _setIsVisibile:isInitialState:.
    (-[WebView _setIsVisible:isInitialState:]):
        - added.
    (-[WebView _setVisibilityState:isInitialState:]):
        - setVisibilityState -> setIsVisible/setIsPrerender.
    (-[WebView viewWillMoveToWindow:]):
    (-[WebView viewDidMoveToWindow]):
        - remove redundant calls to willMoveOffscreen/didMoveOnscreen
          (this is handled by _updateVisibilityState).
    
    Source/WebKit2: 
    
    * WebProcess/WebPage/WebPage.cpp:
    (WebKit::WebPage::WebPage):
    (WebKit::WebPage::setViewIsVisible):
        - updateVisibilityState -> setIsVisible.
    (WebKit::WebPage::setIsInWindow):
        - remove redundant willMoveOffscreen/didMoveOnscreen calls - this is handled
          by setIsVisible.
    (WebKit::WebPage::setMayStartMediaWhenInWindow):
        - isOnscreen -> isInWindow. We start media when the view is in a window, not
          when the view is visible.
    (WebKit::WebPage::setVisibilityStatePrerender):
        - setVisibilityState -> setIsPrerender.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161223 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    21294937
EventHandler.cpp 143 KB