Changeset 116422 in webkit
- Timestamp:
- May 8, 2012 7:59:58 AM (12 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r116420 r116422 1 2012-05-08 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org> 2 3 [WK2] Integrate Page Visibility state change and WK2 Suspend/Resume API 4 https://bugs.webkit.org/show_bug.cgi?id=85650 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 This patch uses state changes of the Page Visibility API to trigger the 9 automatic suspension/resume of animations on the WebPage and its main frame, 10 in the same fashion of what is used by the Suspend/Resume API of WebKit2. 11 By telling the WebPage it will move off/on the screen and the FrameView to 12 hide/show, this patch is suspending/resuming animations (animated painting) 13 but not timers and other active DOM objects. 14 15 * WebProcess/WebPage/WebPage.cpp: 16 (WebKit::WebPage::setVisibilityState): 17 1 18 2012-05-08 Kenneth Rohde Christiansen <kenneth@webkit.org> 2 19 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r116230 r116422 225 225 , m_gestureReachedScrollingLimit(false) 226 226 #endif 227 #if ENABLE(PAGE_VISIBILITY_API) 228 , m_visibilityState(WebCore::PageVisibilityStateVisible) 229 #endif 227 230 { 228 231 ASSERT(m_pageID); … … 3158 3161 if (!m_page) 3159 3162 return; 3160 m_page->setVisibilityState(static_cast<WebCore::PageVisibilityState>(visibilityState), isInitialState); 3163 3164 WebCore::PageVisibilityState state = static_cast<WebCore::PageVisibilityState>(visibilityState); 3165 3166 if (m_visibilityState == state) 3167 return; 3168 3169 FrameView* view = m_page->mainFrame() ? m_page->mainFrame()->view() : 0; 3170 3171 if (state == WebCore::PageVisibilityStateVisible) { 3172 m_page->didMoveOnscreen(); 3173 if (view) 3174 view->show(); 3175 } 3176 3177 m_page->setVisibilityState(state, isInitialState); 3178 m_visibilityState = state; 3179 3180 if (state == WebCore::PageVisibilityStateHidden) { 3181 m_page->willMoveOffscreen(); 3182 if (view) 3183 view->hide(); 3184 } 3161 3185 } 3162 3186 #endif -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r115145 r116422 53 53 #include <WebCore/FrameLoaderTypes.h> 54 54 #include <WebCore/IntRect.h> 55 #if ENABLE(PAGE_VISIBILITY_API) 56 #include <WebCore/PageVisibilityState.h> 57 #endif 55 58 #include <WebCore/PlatformScreen.h> 56 59 #include <WebCore/ScrollTypes.h> … … 829 832 HashMap<String, QtNetworkReply*> m_applicationSchemeReplies; 830 833 #endif 834 #if ENABLE(PAGE_VISIBILITY_API) 835 WebCore::PageVisibilityState m_visibilityState; 836 #endif 831 837 }; 832 838
Note: See TracChangeset
for help on using the changeset viewer.