Change Page, FocusController to use ViewState
https://bugs.webkit.org/show_bug.cgi?id=126533
Reviewed by Tim Horton.
These classes currently maintain a set of separate fields to represent the view state;
combine these into a single field, and allow WebPage to send the combined update rather
than individual changes.
Maintain existing interface for WebKit1 clients.
Source/WebCore:
* WebCore.exp.in:
- Added WebCore::setViewState, removed WebCore::setIsVisuallyIdle.
* page/FocusController.cpp:
(WebCore::FocusController::FocusController):
- Initialize combined m_viewState.
(WebCore::FocusController::setFocused):
- Calls setViewState.
(WebCore::FocusController::setFocusedInternal):
- setFocused -> setFocusedInternal.
(WebCore::FocusController::setViewState):
- Added, update all ViewState flags.
(WebCore::FocusController::setActive):
- Calls setViewState.
(WebCore::FocusController::setActiveInternal):
- setActive -> setActiveInternal.
(WebCore::FocusController::setContentIsVisible):
- Calls setViewState.
(WebCore::FocusController::setContentIsVisibleInternal):
- setContentIsVisible -> setContentIsVisibleInternal.
* page/FocusController.h:
(WebCore::FocusController::isActive):
(WebCore::FocusController::isFocused):
(WebCore::FocusController::contentIsVisible):
- Implemented in terms of ViewState.
* page/Page.cpp:
(WebCore::Page::Page):
- Initialize using PageInitialViewState.
(WebCore::Page::setIsInWindow):
- Calls setViewState.
(WebCore::Page::setIsInWindowInternal):
- setIsInWindow -> setIsInWindowInternal.
(WebCore::Page::setIsVisuallyIdleInternal):
- setIsVisuallyIdle -> setIsVisuallyIdleInternal.
(WebCore::Page::setViewState):
- Added, update all ViewState flags, including FocusController.
(WebCore::Page::setIsVisible):
- Calls setViewState.
(WebCore::Page::setIsVisibleInternal):
- setIsVisible -> setIsVisibleInternal.
(WebCore::Page::visibilityState):
- m_isVisible -> isVisible()
(WebCore::Page::hiddenPageCSSAnimationSuspensionStateChanged):
- m_isVisible -> isVisible()
* page/Page.h:
(WebCore::Page::isVisible):
(WebCore::Page::isInWindow):
- Implemented in terms of ViewState.
(WebCore::Page::scriptedAnimationsSuspended):
- Combined member fields into ViewState::Flags.
Source/WebKit/mac:
* WebView/WebView.mm:
(-[WebView _windowWillOrderOnScreen:]):
(-[WebView _windowWillOrderOffScreen:]):
- remove calls to FocusController::setContentIsVisible, these are redundant
(this is handled when page visibility is set).
Source/WebKit2:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
- Combined separate calls to Page::setViewState.
(WebKit::WebPage::updateIsInWindow):
- Simplied from setIsInWindow.
(WebKit::WebPage::setViewState):
- Combined separate calls to Page::setViewState.
* WebProcess/WebPage/WebPage.h:
- Declare updateIsInWindow.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162452 268f45cc-cd09-0410-ab3c-d52691b4dbfc
11 files changed