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: http://svn.webkit.org/repository/webkit/trunk@150796 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/rendering/RenderImage.cpp b/Source/WebCore/rendering/RenderImage.cpp
index 59541eb..9dfbc07 100644
--- a/Source/WebCore/rendering/RenderImage.cpp
+++ b/Source/WebCore/rendering/RenderImage.cpp
@@ -424,11 +424,11 @@
if (paintInfo.context->paintingDisabled() && !paintInfo.context->updatingControlTints())
return;
- Node* focusedNode = document->focusedNode();
- if (!focusedNode || !focusedNode->hasTagName(areaTag))
+ Element* focusedElement = document->focusedElement();
+ if (!focusedElement || !focusedElement->hasTagName(areaTag))
return;
- HTMLAreaElement* areaElement = static_cast<HTMLAreaElement*>(focusedNode);
+ HTMLAreaElement* areaElement = static_cast<HTMLAreaElement*>(focusedElement);
if (areaElement->imageElement() != node())
return;