Document::setFocusedNode() should be setFocusedElement().
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 May 2013 12:46:31 +0000 (12:46 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 May 2013 12:46:31 +0000 (12:46 +0000)
commit3af0c8137ec93fc9026eb105f254429d95561152
tree6a403c6d12dd0e709f10b3c547f1c959cc4fd48f
parent1983f61df85dedbd229704eda677566065f50576
Document::setFocusedNode() should be setFocusedElement().
<http://webkit.org/b/116857>

Reviewed by Antti Koivisto.

Source/WebCore:

Only Elements can be focused, so tighten Document's idea of what's focused.

Most of this patch is just updating call sites for the new names and removing
now-unnecessary isElementNode() checks and casts.

* WebCore.exp.in:
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::focusedUIElementForPage):
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::canSetFocusAttribute):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::isFocused):
(WebCore::AccessibilityRenderObject::setFocused):
(WebCore::AccessibilityRenderObject::handleActiveDescendantChanged):
* bindings/objc/DOM.mm:
(-[DOMElement isFocused]):
* dom/Document.cpp:
(WebCore::Document::dispose):
(WebCore::Document::detach):
(WebCore::Document::focusedNodeRemoved):
(WebCore::Document::removeFocusedNodeOfSubtree):
(WebCore::Document::setFocusedElement):
(WebCore::Document::updateFocusAppearanceTimerFired):
(WebCore::eventTargetNodeForDocument):
* dom/Document.h:
(Document):
(WebCore::Document::focusedElement):
* dom/Element.cpp:
(WebCore::Element::attach):
(WebCore::Element::focus):
(WebCore::Element::blur):
(WebCore::Element::cancelFocusAppearanceUpdate):
* dom/Node.cpp:
(WebCore::Node::rendererIsEditable):
* dom/TreeScope.cpp:
(WebCore::TreeScope::focusedElement):
* dom/UserTypingGestureIndicator.cpp:
(WebCore::UserTypingGestureIndicator::UserTypingGestureIndicator):
* editing/Editor.cpp:
(WebCore::Editor::setBaseWritingDirection):
(WebCore::Editor::setComposition):
(WebCore::Editor::guessesForMisspelledOrUngrammatical):
* editing/EditorCommand.cpp:
(WebCore::verticalScrollDistance):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::selectAll):
(WebCore::FrameSelection::focusedOrActiveStateChanged):
(WebCore::FrameSelection::setFocusedElementIfNeeded):
(WebCore::FrameSelection::currentForm):
* history/CachedPage.cpp:
(WebCore::CachedPage::restore):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::updateType):
(WebCore::HTMLInputElement::attach):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::setValueCommon):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::placeholderShouldBeVisible):
(WebCore::HTMLTextFormControlElement::selectionStart):
(WebCore::HTMLTextFormControlElement::selectionEnd):
(WebCore::HTMLTextFormControlElement::selectionDirection):
* html/RadioInputType.cpp:
(WebCore::RadioInputType::handleKeydownEvent):
(WebCore::RadioInputType::isKeyboardFocusable):
* html/shadow/DateTimeEditElement.cpp:
(WebCore::DateTimeEditElement::focusedFieldIndex):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::stopLoading):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::focus):
* page/EventHandler.cpp:
(WebCore::EventHandler::scrollOverflow):
(WebCore::EventHandler::logicalScrollOverflow):
(WebCore::EventHandler::dispatchMouseEvent):
(WebCore::EventHandler::sendContextMenuEventForKey):
(WebCore::EventHandler::capsLockStateMayHaveChanged):
* page/FocusController.cpp:
(WebCore::dispatchEventsOnWindowAndFocusedNode):
(WebCore::FocusController::advanceFocusInDocumentOrder):
(WebCore::FocusController::setFocusedElement):
(WebCore::FocusController::findFocusCandidateInContainer):
(WebCore::FocusController::advanceFocusDirectionallyInContainer):
(WebCore::FocusController::advanceFocusDirectionally):
* page/FrameView.cpp:
(WebCore::FrameView::scrollToAnchor):
* plugins/PluginView.cpp:
(WebCore::PluginView::focusPluginElement):
* plugins/efl/PluginViewEfl.cpp:
(WebCore::PluginView::setFocus):
* plugins/mac/PluginViewMac.mm:
(WebCore::PluginView::platformStart):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintAreaElementFocusRing):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::paintItemForeground):
(WebCore::RenderListBox::paintItemBackground):
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::capsLockStateMayHaveChanged):
(WebCore::RenderTextControlSingleLine::textShouldBeTruncated):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::isFocused):

Source/WebKit/blackberry:

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::focusNodeRect):
(BlackBerry::WebKit::WebPagePrivate::contextNode):
(BlackBerry::WebKit::WebPagePrivate::clearFocusNode):
(BlackBerry::WebKit::WebPage::setNodeFocus):
* WebCoreSupport/EditorClientBlackBerry.cpp:
(WebCore::EditorClientBlackBerry::shouldSpellCheckFocusedField):
(WebCore::EditorClientBlackBerry::shouldChangeSelectedRange):
* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::InputHandler::focusedNodeChanged):
* WebKitSupport/SelectionHandler.cpp:
(BlackBerry::WebKit::SelectionHandler::setCaretPosition):
(BlackBerry::WebKit::SelectionHandler::extendSelectionToFieldBoundary):
(BlackBerry::WebKit::SelectionHandler::updateOrHandleInputSelection):
(BlackBerry::WebKit::SelectionHandler::clipPointToVisibleContainer):
(BlackBerry::WebKit::SelectionHandler::inputNodeOverridesTouch):
(BlackBerry::WebKit::SelectionHandler::selectionPositionChanged):

Source/WebKit/efl:

* ewk/ewk_frame.cpp:
(ewk_frame_focused_element_geometry_get):
* ewk/ewk_view.cpp:
(ewk_view_input_method_state_set):

Source/WebKit/gtk:

* webkit/webkitwebview.cpp:
(getFocusedNode):

Source/WebKit/mac:

* WebView/WebHTMLView.mm:
(-[WebHTMLView clearFocus]):
(-[WebHTMLView becomeFirstResponder]):

Source/WebKit/qt:

* Api/qwebelement.cpp:
(QWebElement::hasFocus):
(QWebElement::setFocus):
* WebCoreSupport/EditorClientQt.cpp:
(WebCore::EditorClientQt::setInputMethodState):
* WebCoreSupport/QWebPageAdapter.cpp:
(QWebPageAdapter::mousePressEvent):
(QWebPageAdapter::handleSoftwareInputPanel):
(QWebPageAdapter::inputMethodQuery):
(QWebPageAdapter::hasFocusedNode):

Source/WebKit/win:

* DOMCoreClasses.cpp:
(DOMElement::isFocused):
* WebView.cpp:
(WebView::setInitialFocus):

Source/WebKit2:

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::focusPluginElement):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::focusedPluginViewForFrame):
(WebKit::WebPage::setInitialFocus):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@150796 268f45cc-cd09-0410-ab3c-d52691b4dbfc
55 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/accessibility/AXObjectCache.cpp
Source/WebCore/accessibility/AccessibilityNodeObject.cpp
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/bindings/objc/DOM.mm
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/TreeScope.cpp
Source/WebCore/dom/UserTypingGestureIndicator.cpp
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/EditorCommand.cpp
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/history/CachedPage.cpp
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/HTMLTextAreaElement.cpp
Source/WebCore/html/HTMLTextFormControlElement.cpp
Source/WebCore/html/RadioInputType.cpp
Source/WebCore/html/shadow/DateTimeEditElement.cpp
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/FocusController.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/plugins/PluginView.cpp
Source/WebCore/plugins/efl/PluginViewEfl.cpp
Source/WebCore/plugins/mac/PluginViewMac.mm
Source/WebCore/rendering/RenderImage.cpp
Source/WebCore/rendering/RenderListBox.cpp
Source/WebCore/rendering/RenderTextControlSingleLine.cpp
Source/WebCore/rendering/RenderTheme.cpp
Source/WebKit/blackberry/Api/WebPage.cpp
Source/WebKit/blackberry/ChangeLog
Source/WebKit/blackberry/WebCoreSupport/EditorClientBlackBerry.cpp
Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp
Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/ewk/ewk_frame.cpp
Source/WebKit/efl/ewk/ewk_view.cpp
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/webkit/webkitwebview.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebHTMLView.mm
Source/WebKit/qt/Api/qwebelement.cpp
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
Source/WebKit/win/ChangeLog
Source/WebKit/win/DOMCoreClasses.cpp
Source/WebKit/win/WebView.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/Plugins/PluginView.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp