Changeset 162452 in webkit


Ignore:
Timestamp:
Jan 21, 2014 11:02:08 AM (10 years ago)
Author:
barraclough@apple.com
Message:

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.
Location:
trunk/Source
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r162451 r162452  
     12014-01-21  Gavin Barraclough  <barraclough@apple.com>
     2
     3        Change Page, FocusController to use ViewState
     4        https://bugs.webkit.org/show_bug.cgi?id=126533
     5
     6        Reviewed by Tim Horton.
     7
     8        These classes currently maintain a set of separate fields to represent the view state;
     9        combine these into a single field, and allow WebPage to send the combined update rather
     10        than individual changes.
     11
     12        Maintain existing interface for WebKit1 clients.
     13
     14        * WebCore.exp.in:
     15            - Added WebCore::setViewState, removed WebCore::setIsVisuallyIdle.
     16        * page/FocusController.cpp:
     17        (WebCore::FocusController::FocusController):
     18            - Initialize combined m_viewState.
     19        (WebCore::FocusController::setFocused):
     20            - Calls setViewState.
     21        (WebCore::FocusController::setFocusedInternal):
     22            - setFocused -> setFocusedInternal.
     23        (WebCore::FocusController::setViewState):
     24            - Added, update all ViewState flags.
     25        (WebCore::FocusController::setActive):
     26            - Calls setViewState.
     27        (WebCore::FocusController::setActiveInternal):
     28            - setActive -> setActiveInternal.
     29        (WebCore::FocusController::setContentIsVisible):
     30            - Calls setViewState.
     31        (WebCore::FocusController::setContentIsVisibleInternal):
     32            - setContentIsVisible -> setContentIsVisibleInternal.
     33        * page/FocusController.h:
     34        (WebCore::FocusController::isActive):
     35        (WebCore::FocusController::isFocused):
     36        (WebCore::FocusController::contentIsVisible):
     37            - Implemented in terms of ViewState.
     38        * page/Page.cpp:
     39        (WebCore::Page::Page):
     40            - Initialize using PageInitialViewState.
     41        (WebCore::Page::setIsInWindow):
     42            - Calls setViewState.
     43        (WebCore::Page::setIsInWindowInternal):
     44            - setIsInWindow -> setIsInWindowInternal.
     45        (WebCore::Page::setIsVisuallyIdleInternal):
     46            - setIsVisuallyIdle -> setIsVisuallyIdleInternal.
     47        (WebCore::Page::setViewState):
     48            - Added, update all ViewState flags, including FocusController.
     49        (WebCore::Page::setIsVisible):
     50            - Calls setViewState.
     51        (WebCore::Page::setIsVisibleInternal):
     52            - setIsVisible -> setIsVisibleInternal.
     53        (WebCore::Page::visibilityState):
     54            - m_isVisible -> isVisible()
     55        (WebCore::Page::hiddenPageCSSAnimationSuspensionStateChanged):
     56            - m_isVisible -> isVisible()
     57        * page/Page.h:
     58        (WebCore::Page::isVisible):
     59        (WebCore::Page::isInWindow):
     60            - Implemented in terms of ViewState.
     61        (WebCore::Page::scriptedAnimationsSuspended):
     62            - Combined member fields into ViewState::Flags.
     63
    1642014-01-21  Lauro Neto  <lauro.neto@openbossa.org>
    265
  • trunk/Source/WebCore/WebCore.exp.in

    r162396 r162452  
    485485__ZN7WebCore15FocusController15setInitialFocusENS_14FocusDirectionEPNS_13KeyboardEventE
    486486__ZN7WebCore15FocusController17setFocusedElementEPNS_7ElementEN3WTF10PassRefPtrINS_5FrameEEENS_14FocusDirectionE
    487 __ZN7WebCore15FocusController19setContentIsVisibleEb
    488487__ZN7WebCore15FocusController9setActiveEb
    489488__ZN7WebCore15GraphicsContext10strokeRectERKNS_9FloatRectEf
     
    976975__ZN7WebCore4Page12setGroupNameERKN3WTF6StringE
    977976__ZN7WebCore4Page12setIsVisibleEbb
     977__ZN7WebCore4Page12setViewStateEjb
    978978__ZN7WebCore4Page13rangeOfStringERKN3WTF6StringEPNS_5RangeEj
    979979__ZN7WebCore4Page13setIsInWindowEb
     
    985985__ZN7WebCore4Page16setCanStartMediaEb
    986986__ZN7WebCore4Page16setDefersLoadingEb
    987 __ZN7WebCore4Page17setIsVisuallyIdleEb
    988987__ZN7WebCore4Page18removeSchedulePairEN3WTF10PassRefPtrINS1_12SchedulePairEEE
    989988__ZN7WebCore4Page18setPageScaleFactorEfRKNS_8IntPointE
  • trunk/Source/WebCore/page/FocusController.cpp

    r162107 r162452  
    159159}
    160160
    161 FocusController::FocusController(Page& page)
     161FocusController::FocusController(Page& page, ViewState::Flags viewState)
    162162    : m_page(page)
    163     , m_isActive(false)
    164     , m_isFocused(false)
    165163    , m_isChangingFocusedFrame(false)
    166     , m_contentIsVisible(false)
     164    , m_viewState(viewState)
    167165{
    168166}
     
    206204void FocusController::setFocused(bool focused)
    207205{
    208     if (isFocused() == focused)
    209         return;
    210    
    211     m_isFocused = focused;
    212 
    213     if (!m_isFocused)
     206    m_page.setViewState(focused ? m_viewState | ViewState::IsFocused : m_viewState & ~ViewState::IsFocused);
     207}
     208
     209void FocusController::setFocusedInternal(bool focused)
     210{
     211    if (!isFocused())
    214212        focusedOrMainFrame().eventHandler().stopAutoscrollTimer();
    215213
     
    636634}
    637635
     636void FocusController::setViewState(ViewState::Flags viewState)
     637{
     638    ViewState::Flags changed = m_viewState ^ viewState;
     639    m_viewState = viewState;
     640
     641    if (changed & ViewState::IsFocused)
     642        setFocusedInternal(viewState & ViewState::IsFocused);
     643    if (changed & ViewState::WindowIsActive)
     644        setActiveInternal(viewState & ViewState::WindowIsActive);
     645    if (changed & ViewState::IsVisible)
     646        setIsVisibleInternal(viewState & ViewState::IsVisible);
     647}
     648
    638649void FocusController::setActive(bool active)
    639650{
    640     if (m_isActive == active)
    641         return;
    642 
    643     m_isActive = active;
    644 
     651    m_page.setViewState(active ? m_viewState | ViewState::WindowIsActive : m_viewState & ~ViewState::WindowIsActive);
     652}
     653
     654void FocusController::setActiveInternal(bool active)
     655{
    645656    if (FrameView* view = m_page.mainFrame().view()) {
    646657        if (!view->platformWidget()) {
     
    664675}
    665676
    666 void FocusController::setContentIsVisible(bool contentIsVisible)
    667 {
    668     if (m_contentIsVisible == contentIsVisible)
    669         return;
    670 
    671     m_contentIsVisible = contentIsVisible;
    672 
     677void FocusController::setIsVisibleInternal(bool contentIsVisible)
     678{
    673679    FrameView* view = m_page.mainFrame().view();
    674680    if (!view)
  • trunk/Source/WebCore/page/FocusController.h

    r162107 r162452  
    2929#include "FocusDirection.h"
    3030#include "LayoutRect.h"
     31#include "ViewState.h"
    3132#include <wtf/Forward.h>
    3233#include <wtf/Noncopyable.h>
     
    6364    WTF_MAKE_NONCOPYABLE(FocusController); WTF_MAKE_FAST_ALLOCATED;
    6465public:
    65     explicit FocusController(Page&);
     66    explicit FocusController(Page&, ViewState::Flags);
    6667
    6768    void setFocusedFrame(PassRefPtr<Frame>);
     
    7475    bool setFocusedElement(Element*, PassRefPtr<Frame>, FocusDirection = FocusDirectionNone);
    7576
     77    void setViewState(ViewState::Flags);
     78
    7679    void setActive(bool);
    77     bool isActive() const { return m_isActive; }
     80    bool isActive() const { return m_viewState & ViewState::WindowIsActive; }
    7881
    7982    void setFocused(bool);
    80     bool isFocused() const { return m_isFocused; }
     83    bool isFocused() const { return m_viewState & ViewState::IsFocused; }
    8184
    82     void setContentIsVisible(bool);
     85    bool contentIsVisible() const { return m_viewState & ViewState::IsVisible; }
    8386
    8487    // These methods are used in WebCore/bindings/objc/DOM.mm.
     
    8790
    8891private:
     92    void setActiveInternal(bool);
     93    void setFocusedInternal(bool);
     94    void setIsVisibleInternal(bool);
     95
    8996    bool advanceFocusDirectionally(FocusDirection, KeyboardEvent*);
    9097    bool advanceFocusInDocumentOrder(FocusDirection, KeyboardEvent*, bool initialFocus);
     
    112119    Page& m_page;
    113120    RefPtr<Frame> m_focusedFrame;
    114     bool m_isActive;
    115     bool m_isFocused;
    116121    bool m_isChangingFocusedFrame;
    117     bool m_contentIsVisible;
    118 
     122    ViewState::Flags m_viewState;
    119123};
    120124
  • trunk/Source/WebCore/page/Page.cpp

    r162380 r162452  
    125125}
    126126
     127static const ViewState::Flags PageInitialViewState = ViewState::IsVisible | ViewState::IsInWindow;
     128
    127129Page::Page(PageClients& pageClients)
    128130    : m_chrome(std::make_unique<Chrome>(*this, *pageClients.chromeClient))
     
    131133    , m_dragController(std::make_unique<DragController>(*this, *pageClients.dragClient))
    132134#endif
    133     , m_focusController(std::make_unique<FocusController>(*this))
     135    , m_focusController(std::make_unique<FocusController>(*this, PageInitialViewState))
    134136#if ENABLE(CONTEXT_MENUS)
    135137    , m_contextMenuController(std::make_unique<ContextMenuController>(*this, *pageClients.contextMenuClient))
     
    173175    , m_timerAlignmentInterval(Settings::defaultDOMTimerAlignmentInterval())
    174176    , m_isEditable(false)
    175     , m_isInWindow(true)
    176     , m_isVisible(true)
    177177    , m_isPrerender(false)
     178    , m_viewState(PageInitialViewState)
    178179    , m_requestedLayoutMilestones(0)
    179180    , m_headerHeight(0)
     
    882883void Page::setIsInWindow(bool isInWindow)
    883884{
    884     if (m_isInWindow == isInWindow)
    885         return;
    886 
    887     m_isInWindow = isInWindow;
    888 
     885    setViewState(isInWindow ? m_viewState | ViewState::IsInWindow : m_viewState & ~ViewState::IsInWindow);
     886}
     887
     888void Page::setIsInWindowInternal(bool isInWindow)
     889{
    889890    for (Frame* frame = &mainFrame(); frame; frame = frame->tree().traverseNext()) {
    890891        if (FrameView* frameView = frame->view())
     
    914915}
    915916
    916 void Page::setIsVisuallyIdle(bool isVisuallyIdle)
     917void Page::setIsVisuallyIdleInternal(bool isVisuallyIdle)
    917918{
    918919    m_pageThrottler->setIsVisuallyIdle(isVisuallyIdle);
     
    12171218}
    12181219
     1220void Page::setViewState(ViewState::Flags viewState, bool isInitialState)
     1221{
     1222    ViewState::Flags changed = m_viewState ^ viewState;
     1223    m_viewState = viewState;
     1224
     1225    // We want to make sure to update the active state while hidden, so if the view is going
     1226    // to be visible then update the focus controller first (it may currently still be hidden).
     1227    if (changed && (m_viewState & ViewState::IsVisible))
     1228        m_focusController->setViewState(viewState);
     1229
     1230    if (changed & ViewState::IsVisible)
     1231        setIsVisibleInternal(viewState & ViewState::IsVisible, isInitialState);
     1232    if (changed & ViewState::IsInWindow)
     1233        setIsInWindowInternal(viewState & ViewState::IsInWindow);
     1234    if (changed & ViewState::IsVisuallyIdle)
     1235        setIsVisuallyIdleInternal(viewState & ViewState::IsVisuallyIdle);
     1236
     1237    if (changed && !(m_viewState & ViewState::IsVisible))
     1238        m_focusController->setViewState(viewState);
     1239}
     1240
    12191241void Page::setIsVisible(bool isVisible, bool isInitialState)
     1242{
     1243    setViewState(isVisible ? m_viewState | ViewState::IsVisible : m_viewState & ~ViewState::IsVisible, isInitialState);
     1244}
     1245
     1246void Page::setIsVisibleInternal(bool isVisible, bool isInitialState)
    12201247{
    12211248    // FIXME: The visibility state should be stored on the top-level document.
    12221249    // https://bugs.webkit.org/show_bug.cgi?id=116769
    1223 
    1224     if (m_isVisible == isVisible)
    1225         return;
    1226     m_isVisible = isVisible;
    12271250
    12281251    if (isVisible) {
     
    12871310PageVisibilityState Page::visibilityState() const
    12881311{
    1289     if (m_isVisible)
     1312    if (isVisible())
    12901313        return PageVisibilityStateVisible;
    12911314    if (m_isPrerender)
     
    15491572void Page::hiddenPageCSSAnimationSuspensionStateChanged()
    15501573{
    1551     if (!m_isVisible) {
     1574    if (!isVisible()) {
    15521575        if (m_settings->hiddenPageCSSAnimationSuspensionEnabled())
    15531576            mainFrame().animation().suspendAnimations();
  • trunk/Source/WebCore/page/Page.h

    r162380 r162452  
    3232#include "Region.h"
    3333#include "Supplementable.h"
     34#include "ViewState.h"
    3435#include "ViewportArguments.h"
    3536#include <wtf/Forward.h>
     
    298299
    299300    // Notifications when the Page starts and stops being presented via a native window.
     301    void setViewState(ViewState::Flags, bool isInitial = false);
    300302    void setIsVisible(bool isVisible, bool isInitial);
    301303    void setIsPrerender();
    302     bool isVisible() const { return m_isVisible; }
     304    bool isVisible() const { return m_viewState & ViewState::IsVisible; }
    303305
    304306    // Notification that this Page was moved into or out of a native window.
    305307    void setIsInWindow(bool);
    306     bool isInWindow() const { return m_isInWindow; }
     308    bool isInWindow() const { return m_viewState & ViewState::IsInWindow; }
    307309
    308310    void suspendScriptedAnimations();
    309311    void resumeScriptedAnimations();
    310312    bool scriptedAnimationsSuspended() const { return m_scriptedAnimationsSuspended; }
    311     void setIsVisuallyIdle(bool);
    312313
    313314    void userStyleSheetLocationChanged();
     
    426427    void initGroup();
    427428
     429    void setIsInWindowInternal(bool);
     430    void setIsVisibleInternal(bool isVisible, bool isInitial);
     431    void setIsVisuallyIdleInternal(bool);
     432
    428433#if ASSERT_DISABLED
    429434    void checkSubframeCountConsistency() const { }
     
    529534
    530535    bool m_isEditable;
    531     bool m_isInWindow;
    532     bool m_isVisible;
    533536    bool m_isPrerender;
     537    ViewState::Flags m_viewState;
    534538
    535539    LayoutMilestones m_requestedLayoutMilestones;
  • trunk/Source/WebKit/mac/ChangeLog

    r162379 r162452  
     12014-01-21  Gavin Barraclough  <barraclough@apple.com>
     2
     3        Change Page, FocusController to use ViewState
     4        https://bugs.webkit.org/show_bug.cgi?id=126533
     5
     6        Reviewed by Tim Horton.
     7
     8        These classes currently maintain a set of separate fields to represent the view state;
     9        combine these into a single field, and allow WebPage to send the combined update rather
     10        than individual changes.
     11
     12        Maintain existing interface for WebKit1 clients.
     13
     14        * WebView/WebView.mm:
     15        (-[WebView _windowWillOrderOnScreen:]):
     16        (-[WebView _windowWillOrderOffScreen:]):
     17            - remove calls to FocusController::setContentIsVisible, these are redundant
     18              (this is handled when page visibility is set).
     19
    1202014-01-20  Jeremy Jones  <jeremyj@apple.com>
    221
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r162379 r162452  
    53725372    [self doWindowDidChangeScreen];
    53735373
    5374     if (_private && _private->page) {
     5374    if (_private && _private->page)
    53755375        _private->page->resumeScriptedAnimations();
    5376         _private->page->focusController().setContentIsVisible(true);
    5377     }
    53785376}
    53795377
     
    53855383- (void)_windowWillOrderOffScreen:(NSNotification *)notification
    53865384{
    5387     if (_private && _private->page) {
     5385    if (_private && _private->page)
    53885386        _private->page->suspendScriptedAnimations();
    5389         _private->page->focusController().setContentIsVisible(false);
    5390     }
    53915387}
    53925388
  • trunk/Source/WebKit2/ChangeLog

    r162449 r162452  
     12014-01-21  Gavin Barraclough  <barraclough@apple.com>
     2
     3        Change Page, FocusController to use ViewState
     4        https://bugs.webkit.org/show_bug.cgi?id=126533
     5
     6        Reviewed by Tim Horton.
     7
     8        These classes currently maintain a set of separate fields to represent the view state;
     9        combine these into a single field, and allow WebPage to send the combined update rather
     10        than individual changes.
     11
     12        Maintain existing interface for WebKit1 clients.
     13
     14        * WebProcess/WebPage/WebPage.cpp:
     15        (WebKit::WebPage::WebPage):
     16            - Combined separate calls to Page::setViewState.
     17        (WebKit::WebPage::updateIsInWindow):
     18            - Simplied from setIsInWindow.
     19        (WebKit::WebPage::setViewState):
     20            - Combined separate calls to Page::setViewState.
     21        * WebProcess/WebPage/WebPage.h:
     22            - Declare updateIsInWindow.
     23
    1242014-01-21  Carlos Garcia Campos  <cgarcia@igalia.com>
    225
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r162141 r162452  
    374374    setMemoryCacheMessagesEnabled(parameters.areMemoryCacheClientCallsEnabled);
    375375
    376     setActive(parameters.viewState & ViewState::WindowIsActive);
    377     setFocused(parameters.viewState & ViewState::IsFocused);
    378 
    379     // Page defaults to in-window, but setIsInWindow depends on it being a valid indicator of actually having been put into a window.
    380     bool isInWindow = parameters.viewState & ViewState::IsInWindow;
    381     if (!isInWindow)
    382         m_page->setIsInWindow(false);
    383     else
    384         WebProcess::shared().pageDidEnterWindow(m_pageID);
    385 
    386     setIsInWindow(isInWindow);
     376    m_page->setViewState(m_viewState, true);
     377    updateIsInWindow(true);
    387378
    388379    setMinimumLayoutSize(parameters.minimumLayoutSize);
     
    428419        WebProcess::shared().eventDispatcher().addScrollingTreeForPage(this);
    429420#endif
    430 
    431     m_page->setIsVisible(m_viewState & ViewState::IsVisible, true);
    432     setIsVisuallyIdle(m_viewState & ViewState::IsVisuallyIdle);
    433421}
    434422
     
    19251913}
    19261914
    1927 void WebPage::setActive(bool isActive)
    1928 {
    1929     m_page->focusController().setActive(isActive);
    1930 }
    1931 
    1932 void WebPage::setViewIsVisible(bool isVisible)
    1933 {
    1934     corePage()->focusController().setContentIsVisible(isVisible);
    1935 
    1936     m_page->setIsVisible(m_viewState & ViewState::IsVisible, false);
    1937 }
    1938 
    19391915void WebPage::setDrawsBackground(bool drawsBackground)
    19401916{
     
    19921968}
    19931969
    1994 void WebPage::setFocused(bool isFocused)
    1995 {
    1996     m_page->focusController().setFocused(isFocused);
    1997 }
    1998 
    19991970void WebPage::setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent& event)
    20001971{
     
    20512022}
    20522023
    2053 void WebPage::setIsInWindow(bool isInWindow)
    2054 {
    2055     bool pageWasInWindow = m_page->isInWindow();
    2056    
     2024void WebPage::updateIsInWindow(bool isInitialState)
     2025{
     2026    bool isInWindow = m_viewState & WebCore::ViewState::IsInWindow;
     2027
    20572028    if (!isInWindow) {
    20582029        m_setCanStartMediaTimer.stop();
    20592030        m_page->setCanStartMedia(false);
    20602031       
    2061         if (pageWasInWindow)
     2032        // The WebProcess does not yet know about this page; no need to tell it we're leaving the window.
     2033        if (!isInitialState)
    20622034            WebProcess::shared().pageWillLeaveWindow(m_pageID);
    20632035    } else {
     
    20682040            m_setCanStartMediaTimer.startOneShot(0);
    20692041
    2070         if (!pageWasInWindow)
    2071             WebProcess::shared().pageDidEnterWindow(m_pageID);
    2072     }
    2073 
    2074     m_page->setIsInWindow(isInWindow);
     2042        WebProcess::shared().pageDidEnterWindow(m_pageID);
     2043    }
    20752044
    20762045    if (isInWindow)
     
    20922061
    20932062    m_drawingArea->viewStateDidChange(changed);
    2094 
    2095     // We want to make sure to update the active state while hidden, so if the view is hidden then update the active state
    2096     // early (in case it becomes visible), and if the view was visible then update active state later (in case it hides).
    2097     if (changed & ViewState::IsFocused)
    2098         setFocused(viewState & ViewState::IsFocused);
    2099     if (changed & ViewState::WindowIsActive && !(m_viewState & ViewState::IsVisible))
    2100         setActive(viewState & ViewState::WindowIsActive);
    2101     if (changed & ViewState::IsVisible)
    2102         setViewIsVisible(viewState & ViewState::IsVisible);
    2103     if (changed & ViewState::WindowIsActive && m_viewState & ViewState::IsVisible)
    2104         setActive(viewState & ViewState::WindowIsActive);
    2105     if (changed & ViewState::IsInWindow)
    2106          setIsInWindow(viewState & ViewState::IsInWindow);
    2107     if (changed & ViewState::IsVisuallyIdle)
    2108         setIsVisuallyIdle(viewState & ViewState::IsVisuallyIdle);
    2109 
     2063    m_page->setViewState(viewState, isInitialState);
    21102064    for (auto* pluginView : m_pluginViews)
    21112065        pluginView->viewStateDidChange(changed);
     2066
     2067    if (changed & ViewState::IsInWindow)
     2068        updateIsInWindow();
    21122069}
    21132070
     
    37133670}
    37143671
    3715 void WebPage::setIsVisuallyIdle(bool isVisuallyIdle)
    3716 {
    3717     m_page->setIsVisuallyIdle(isVisuallyIdle);
    3718 }
    3719 
    37203672void WebPage::setScrollingPerformanceLoggingEnabled(bool enabled)
    37213673{
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h

    r162141 r162452  
    738738    void setInitialFocus(bool forward, bool isKeyboardEventValid, const WebKeyboardEvent&);
    739739    void setWindowResizerSize(const WebCore::IntSize&);
    740     void setIsInWindow(bool);
    741     void setIsVisuallyIdle(bool);
     740    void updateIsInWindow(bool isInitialState = false);
    742741    void setViewState(WebCore::ViewState::Flags, bool wantsDidUpdateViewState);
    743742    void setViewStateInternal(WebCore::ViewState::Flags, bool isInitialState);
Note: See TracChangeset for help on using the changeset viewer.