Move focused/active state from Frame to SelectionController/FocusController
authoraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Jan 2008 17:44:35 +0000 (17:44 +0000)
committeraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Jan 2008 17:44:35 +0000 (17:44 +0000)
commit8997b10dd09cea6c99d5fe2ecd9f9eaaff7cd66c
tree610252d12bba35fb75b5d4cb2685ced13db882ad
parentdfc58960314ad6264b4a9aae14af8cbfa1221c15
Move focused/active state from Frame to SelectionController/FocusController

WebCore:

        Move focused/active state from Frame to SelectionController/FocusController

        This is the first part of <rdar://5006915> Inactive look for Aqua
        controls.

        The following methods were moved/renamed:
            - Frame::setIsActive -> FocusController::setActive
            - Frame::isActive -> SelectionController::isActiveAndFocused
            - Frame::setWindowHasFocus -> SelectionController::setFocused

        Active state is now correctly a Page-level concept.

        The Mac parts of this patch were written by Darin.

        Reviewed by Darin.

        All tests pass.

        * WebCore.base.exp: Updated for method renames.
        * css/CSSStyleSelector.cpp:
        (WebCore::CSSStyleSelector::checkOneSelector): Ditto.
        * editing/SelectionController.cpp:
        (WebCore::SelectionController::SelectionController): Initialize new
        member.
        (WebCore::SelectionController::focusedOrActiveStateChanged): New
        private method. Most of this code came from Frame::setIsActive.
        (WebCore::SelectionController::pageActivationChanged): Added.
        (WebCore::SelectionController::setFocused): Added. Replaces
        Frame::setWindowHasFocus.
        (WebCore::SelectionController::isFocusedAndActive): Added. Replaces
        Frame::isActive.
        * editing/SelectionController.h:
        * page/FocusController.cpp:
        (WebCore::FocusController::FocusController): Initialize new member.
        (WebCore::FocusController::setFocusedFrame): Changed to just call
        SelectionController::setFocused, since active state has doesn't change
        when the focused frame changes.
        (WebCore::FocusController::setActive): Added. Replaces
        Frame::setIsActive.
        * page/FocusController.h:
        (WebCore::FocusController::isActive): Added.
        * page/Frame.cpp:
        (WebCore::Frame::setDocument): Updated for method renames.
        (WebCore::Frame::setFocusedNodeIfNeeded): Ditto.
        (WebCore::Frame::updateSecureKeyboardEntryIfActive): Ditto.
        (WebCore::FramePrivate::FramePrivate): Removed initialization of
        removed members.
        * page/Frame.h:
        * page/FramePrivate.h:
        * page/mac/WebCoreFrameBridge.h: Removed -selectionColor.
        * page/mac/WebCoreFrameBridge.mm: Ditto.
        * rendering/RenderListBox.cpp:
        (WebCore::RenderListBox::paintItemForeground): Updated for method
        renames.
        (WebCore::RenderListBox::paintItemBackground): Ditto.
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::selectionBackgroundColor): Ditto.
        (WebCore::RenderObject::selectionForegroundColor): Ditto.
        * rendering/RenderTextControl.cpp:
        (WebCore::RenderTextControl::capsLockStateMayHaveChanged): Ditto.
        * rendering/RenderTheme.cpp:
        (WebCore::RenderTheme::isFocused): Ditto.

WebKit/mac:

        Updated for renames/removal of WebCore methods.

        Reviewed by Darin.

        * Plugins/WebPluginController.mm:
        (-[WebPluginController webPlugInContainerSelectionColor]): Changed to
        ask isFocusedAndActive directly, instead of going through the frame
        bridge.
        * WebView/WebHTMLView.mm:
        (-[WebHTMLView _updateActiveState]): Updated for method renames.

WebKit/win:

        Updated for changes to WebCore methods

        Focus and active state are now handled (somewhat) separately. Future
        patches will further separate these concepts.

        Reviewed by Darin.

        * WebView.cpp:
        (WebViewWndProc): Updated for method renames.
        (WebView::updateActiveState): Only change the active state here. Focus
        is handled inside WM_SETFOCUS and WM_KILLFOCUS message handlers.

WebKit/wx:

        Updated for WebCore method renames.

        Reviewed by Darin.

        * WebView.cpp:
        (wxWebView::OnSetFocus):
        (wxWebView::OnKillFocus):
        (wxWebView::OnActivate):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@29581 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
WebCore/ChangeLog
WebCore/WebCore.base.exp
WebCore/css/CSSStyleSelector.cpp
WebCore/editing/SelectionController.cpp
WebCore/editing/SelectionController.h
WebCore/page/FocusController.cpp
WebCore/page/FocusController.h
WebCore/page/Frame.cpp
WebCore/page/Frame.h
WebCore/page/FramePrivate.h
WebCore/page/mac/WebCoreFrameBridge.h
WebCore/page/mac/WebCoreFrameBridge.mm
WebCore/rendering/RenderListBox.cpp
WebCore/rendering/RenderObject.cpp
WebCore/rendering/RenderTextControl.cpp
WebCore/rendering/RenderTheme.cpp
WebKit/mac/ChangeLog
WebKit/mac/Plugins/WebPluginController.mm
WebKit/mac/WebView/WebHTMLView.mm
WebKit/win/ChangeLog
WebKit/win/WebView.cpp
WebKit/wx/ChangeLog
WebKit/wx/WebView.cpp