WebCore:
authorggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Dec 2006 04:15:19 +0000 (04:15 +0000)
committerggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Dec 2006 04:15:19 +0000 (04:15 +0000)
        Rubber Stamped by Anders Carlsson.

        Global rename of Document::focusNode to Document::focusedNode. 'focusNode'
        suggested a command, and conflicted with a different meaning for 'focusNode'
        in the Mozilla selection API.

WebKit:

        Rubber Stamped by Anders Carlsson.

        Global rename of Document::focusNode to Document::focusedNode. 'focusNode'
        suggested a command, and conflicted with a different meaning for 'focusNode'
        in the Mozilla selection API.

        * WebView/WebHTMLView.m:
        (-[NSArray clearFocus]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17958 268f45cc-cd09-0410-ab3c-d52691b4dbfc

24 files changed:
WebCore/ChangeLog
WebCore/WebCore.exp
WebCore/bindings/objc/DOM.mm
WebCore/bridge/mac/WebCoreAXObject.mm
WebCore/bridge/mac/WebCoreFrameBridge.mm
WebCore/dom/Document.cpp
WebCore/dom/Document.h
WebCore/dom/Element.cpp
WebCore/editing/SelectionController.cpp
WebCore/html/HTMLGenericFormElement.cpp
WebCore/html/HTMLInputElement.cpp
WebCore/html/HTMLTextAreaElement.cpp
WebCore/loader/FrameLoader.cpp
WebCore/page/EventHandler.cpp
WebCore/page/Frame.cpp
WebCore/page/Frame.h
WebCore/page/mac/EventHandlerMac.mm
WebCore/platform/mac/WidgetMac.mm
WebCore/rendering/RenderListBox.cpp
WebCore/rendering/RenderTheme.cpp
WebCore/rendering/RenderThemeMac.mm
WebCore/rendering/RenderWidget.cpp
WebKit/ChangeLog
WebKit/WebView/WebHTMLView.m

index 76d04d38cb7e3f5f5e12ae800887bae8f3623edc..e4b39a6d6542ffecb0b4c759d89cdefd5bf416af 100644 (file)
@@ -1,3 +1,11 @@
+2006-11-30  Geoffrey Garen  <ggaren@apple.com>
+
+        Rubber Stamped by Anders Carlsson.
+
+        Global rename of Document::focusNode to Document::focusedNode. 'focusNode'
+        suggested a command, and conflicted with a different meaning for 'focusNode'
+        in the Mozilla selection API.
+
 2006-11-30  John Sullivan  <sullivan@apple.com>
 
         Reviewed by Justin
index 3a52a01f40d6fc31fd316e0bffcbcffc0eae78f2..d38d5fe07496e51f34eee254c749eca4ec03743b 100644 (file)
@@ -244,10 +244,20 @@ __ZN7WebCore5RangeC1EPNS_8DocumentEPNS_4NodeEiS4_i
 __ZN7WebCore5RangeD1Ev
 __ZN7WebCore5cacheEv
 __ZN7WebCore6Editor10applyStyleEPNS_19CSSStyleDeclarationENS_10EditActionE
+__ZN7WebCore6Editor11canDHTMLCutEv
 __ZN7WebCore6Editor11execCommandERKNS_6StringE
+__ZN7WebCore6Editor11tryDHTMLCutEv
+__ZN7WebCore6Editor12canDHTMLCopyEv
+__ZN7WebCore6Editor12tryDHTMLCopyEv
+__ZN7WebCore6Editor13canDHTMLPasteEv
+__ZN7WebCore6Editor13performDeleteEv
+__ZN7WebCore6Editor13tryDHTMLPasteEv
 __ZN7WebCore6Editor21applyStyleToSelectionEPNS_19CSSStyleDeclarationENS_10EditActionE
 __ZN7WebCore6Editor30applyParagraphStyleToSelectionEPNS_19CSSStyleDeclarationENS_10EditActionE
 __ZN7WebCore6Editor30deleteSelectionWithSmartDeleteEb
+__ZN7WebCore6Editor3cutEv
+__ZN7WebCore6Editor4copyEv
+__ZN7WebCore6Editor5pasteEv
 __ZN7WebCore6Editor6indentEv
 __ZN7WebCore6Editor7outdentEv
 __ZN7WebCore6StringC1EP8NSString
@@ -256,8 +266,8 @@ __ZN7WebCore6StringC1ERKNS_16DeprecatedStringE
 __ZN7WebCore7IntSizeC1ERK7_NSSize
 __ZN7WebCore7nsColorERKNS_5ColorE
 __ZN7WebCore8Document11completeURLERKNS_16DeprecatedStringE
-__ZN7WebCore8Document12setFocusNodeEN3WTF10PassRefPtrINS_4NodeEEE
 __ZN7WebCore8Document13removeMarkersENS_14DocumentMarker10MarkerTypeE
+__ZN7WebCore8Document14setFocusedNodeEN3WTF10PassRefPtrINS_4NodeEEE
 __ZN7WebCore8Document4bodyEv
 __ZN7WebCore8FrameMac11shouldCloseEv
 __ZN7WebCore8FrameMac18windowScriptObjectEv
@@ -379,19 +389,9 @@ __ZNK7WebCore5Range12endContainerERi
 __ZNK7WebCore5Range19boundaryPointsValidEv
 __ZNK7WebCore5Range9endOffsetERi
 __ZNK7WebCore5Range9startNodeEv
-__ZN7WebCore6Editor3cutEv
-__ZN7WebCore6Editor4copyEv
-__ZN7WebCore6Editor5pasteEv
-__ZN7WebCore6Editor13performDeleteEv
 __ZNK7WebCore6Editor13canEditRichlyEv
 __ZNK7WebCore6Editor17shouldDeleteRangeEPNS_5RangeE
 __ZNK7WebCore6Editor22selectionStartHasStyleEPNS_19CSSStyleDeclarationE
-__ZN7WebCore6Editor11canDHTMLCutEv
-__ZN7WebCore6Editor12canDHTMLCopyEv
-__ZN7WebCore6Editor13canDHTMLPasteEv
-__ZN7WebCore6Editor11tryDHTMLCutEv
-__ZN7WebCore6Editor12tryDHTMLCopyEv
-__ZN7WebCore6Editor13tryDHTMLPasteEv
 __ZNK7WebCore6Editor6canCutEv
 __ZNK7WebCore6Editor7canCopyEv
 __ZNK7WebCore6Editor7canEditEv
index 669c2de614fde92b70439872aa351b1d4b3c3d23..716e8770855685de199137a409ad4d6a4690b1a3 100644 (file)
@@ -528,7 +528,7 @@ static NSArray *kit(const Vector<IntRect>& rects)
 - (BOOL)isFocused
 {
     WebCore::Element* impl = [self _element];
-    if (impl->document()->focusNode() == impl)
+    if (impl->document()->focusedNode() == impl)
         return YES;
     return NO;
 }
index ac0755aeb8bfcea3a5cc128b077c55c39d1283d9..7006a5983e74c1b263ca3ac748d9aa67ff791360 100644 (file)
@@ -1070,7 +1070,7 @@ static IntRect boundingBoxRect(RenderObject* obj)
         return [self helpText];
     
     if ([attributeName isEqualToString: NSAccessibilityFocusedAttribute])
-        return [NSNumber numberWithBool: (m_renderer->element() && m_renderer->document()->focusNode() == m_renderer->element())];
+        return [NSNumber numberWithBool: (m_renderer->element() && m_renderer->document()->focusedNode() == m_renderer->element())];
 
     if ([attributeName isEqualToString: NSAccessibilityEnabledAttribute])
         return [NSNumber numberWithBool: m_renderer->element() ? m_renderer->element()->isEnabled() : YES];
@@ -2378,11 +2378,11 @@ static VisiblePosition endOfStyleRange (const VisiblePosition visiblePos)
 - (id)accessibilityFocusedUIElement
 {
     // NOTE: BUG support nested WebAreas
-    Node* focusNode = m_renderer->document()->focusNode();
-    if (!focusNode || !focusNode->renderer())
+    Node* focusedNode = m_renderer->document()->focusedNode();
+    if (!focusedNode || !focusedNode->renderer())
         return nil;
 
-    WebCoreAXObject* obj = focusNode->renderer()->document()->axObjectCache()->get(focusNode->renderer());
+    WebCoreAXObject* obj = focusedNode->renderer()->document()->axObjectCache()->get(focusedNode->renderer());
     
     // the HTML element, for example, is focusable but has an AX object that is ignored
     if ([obj accessibilityIsIgnored])
@@ -2410,8 +2410,8 @@ static VisiblePosition endOfStyleRange (const VisiblePosition visiblePos)
 
 - (BOOL)canSetFocusAttribute
 {
-    // NOTE: It would be more accurate to ask the document whether setFocusNode() would 
-    // do anything.  For example, it setFocusNode() will do nothing if the current focused
+    // NOTE: It would be more accurate to ask the document whether setFocusedNode() would 
+    // do anything.  For example, it setFocusedNode() will do nothing if the current focused
     // node will not relinquish the focus.
     if (!m_renderer->element() || !m_renderer->element()->isEnabled())
         return NO;
@@ -2487,12 +2487,12 @@ static VisiblePosition endOfStyleRange (const VisiblePosition visiblePos)
         ASSERT(number);
         if ([self canSetFocusAttribute] && number) {
             if ([number intValue] == 0)
-                m_renderer->document()->setFocusNode(0);
+                m_renderer->document()->setFocusedNode(0);
             else {
                 if (m_renderer->element()->isElementNode())
                     static_cast<Element*>(m_renderer->element())->focus();
                 else
-                    m_renderer->document()->setFocusNode(m_renderer->element());
+                    m_renderer->document()->setFocusedNode(m_renderer->element());
             }
         }
     } else if ([attributeName isEqualToString: NSAccessibilityValueAttribute]) {
index fee7d23dbb5a8ffe92b0261d131dd84e131525ee..59d7d35e4bbf9df12c46b6a59129a0abed22fc3e 100644 (file)
@@ -763,7 +763,7 @@ static HTMLFormElement *formElementFromDOMElement(DOMElement *element)
     Document *doc = m_frame->document();
     if (!doc)
         return nil;
-    return m_frame->eventHandler()->nextKeyView(doc->focusNode(), SelectingNext);
+    return m_frame->eventHandler()->nextKeyView(doc->focusedNode(), SelectingNext);
 }
 
 - (NSView *)previousKeyView
@@ -771,7 +771,7 @@ static HTMLFormElement *formElementFromDOMElement(DOMElement *element)
     Document *doc = m_frame->document();
     if (!doc)
         return nil;
-    return m_frame->eventHandler()->nextKeyView(doc->focusNode(), SelectingPrevious);
+    return m_frame->eventHandler()->nextKeyView(doc->focusedNode(), SelectingPrevious);
 }
 
 - (NSView *)nextKeyViewInsideWebFrameViews
@@ -779,7 +779,7 @@ static HTMLFormElement *formElementFromDOMElement(DOMElement *element)
     Document *doc = m_frame->document();
     if (!doc)
         return nil;
-    return m_frame->eventHandler()->nextKeyViewInFrameHierarchy(doc->focusNode(), SelectingNext);
+    return m_frame->eventHandler()->nextKeyViewInFrameHierarchy(doc->focusedNode(), SelectingNext);
 }
 
 - (NSView *)previousKeyViewInsideWebFrameViews
@@ -787,7 +787,7 @@ static HTMLFormElement *formElementFromDOMElement(DOMElement *element)
     Document *doc = m_frame->document();
     if (!doc)
         return nil;
-    return m_frame->eventHandler()->nextKeyViewInFrameHierarchy(doc->focusNode(), SelectingPrevious);
+    return m_frame->eventHandler()->nextKeyViewInFrameHierarchy(doc->focusedNode(), SelectingPrevious);
 }
 
 - (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)string
index 596aeae19eae323ab51ad9ff42708b0607cf53e8..d2eb40096f85c04000c7591c3ae6087d2d0f5294 100644 (file)
@@ -307,7 +307,7 @@ void Document::removedLastRef()
         // we must make sure not to be retaining any of our children through
         // these extra pointers or we will create a reference cycle
         m_docType = 0;
-        m_focusNode = 0;
+        m_focusedNode = 0;
         m_hoverNode = 0;
         m_activeNode = 0;
         m_titleElement = 0;
@@ -1021,7 +1021,7 @@ void Document::detach()
     m_imageLoadEventDispatchingList.clear();
     
     m_hoverNode = 0;
-    m_focusNode = 0;
+    m_focusedNode = 0;
     m_activeNode = 0;
 
     ContainerNode::detach();
@@ -1442,7 +1442,7 @@ void Document::determineParseMode(const String&)
     hMode = XHtml;
 }
 
-Node* Document::nextFocusNode(Node* fromNode, KeyboardEvent* event)
+Node* Document::nextFocusedNode(Node* fromNode, KeyboardEvent* event)
 {
     unsigned short fromTabIndex;
 
@@ -1519,7 +1519,7 @@ Node* Document::nextFocusNode(Node* fromNode, KeyboardEvent* event)
     return 0;
 }
 
-Node* Document::previousFocusNode(Node* fromNode, KeyboardEvent* event)
+Node* Document::previousFocusedNode(Node* fromNode, KeyboardEvent* event)
 {
     Node* lastNode;
     for (lastNode = this; lastNode->lastChild(); lastNode = lastNode->lastChild());
@@ -2027,110 +2027,110 @@ void Document::setDashboardRegions(const Vector<DashboardRegionValue>& regions)
 }
 #endif
 
-static Widget *widgetForNode(Node *focusNode)
+static Widget *widgetForNode(Node *focusedNode)
 {
-    if (!focusNode)
+    if (!focusedNode)
         return 0;
-    RenderObject *renderer = focusNode->renderer();
+    RenderObject *renderer = focusedNode->renderer();
     if (!renderer || !renderer->isWidget())
         return 0;
     return static_cast<RenderWidget*>(renderer)->widget();
 }
 
-bool Document::setFocusNode(PassRefPtr<Node> newFocusNode)
+bool Document::setFocusedNode(PassRefPtr<Node> newFocusedNode)
 {    
-    // Make sure newFocusNode is actually in this document
-    if (newFocusNode && (newFocusNode->document() != this))
+    // Make sure newFocusedNode is actually in this document
+    if (newFocusedNode && (newFocusedNode->document() != this))
         return true;
 
-    if (m_focusNode == newFocusNode)
+    if (m_focusedNode == newFocusedNode)
         return true;
 
-    if (m_focusNode && m_focusNode.get() == m_focusNode->rootEditableElement() && !relinquishesEditingFocus(m_focusNode.get()))
+    if (m_focusedNode && m_focusedNode.get() == m_focusedNode->rootEditableElement() && !relinquishesEditingFocus(m_focusedNode.get()))
         return false;
         
     bool focusChangeBlocked = false;
-    RefPtr<Node> oldFocusNode = m_focusNode;
-    m_focusNode = 0;
-    clearSelectionIfNeeded(newFocusNode.get());
+    RefPtr<Node> oldFocusedNode = m_focusedNode;
+    m_focusedNode = 0;
+    clearSelectionIfNeeded(newFocusedNode.get());
 
     // Remove focus from the existing focus node (if any)
-    if (oldFocusNode && !oldFocusNode->m_inDetach) { 
-        if (oldFocusNode->active())
-            oldFocusNode->setActive(false);
+    if (oldFocusedNode && !oldFocusedNode->m_inDetach) { 
+        if (oldFocusedNode->active())
+            oldFocusedNode->setActive(false);
 
-        oldFocusNode->setFocus(false);
+        oldFocusedNode->setFocus(false);
                 
         // Dispatch a change event for text fields or textareas that have been edited
-        RenderObject *r = static_cast<RenderObject*>(oldFocusNode.get()->renderer());
+        RenderObject *r = static_cast<RenderObject*>(oldFocusedNode.get()->renderer());
         if (r && (r->isTextArea() || r->isTextField()) && r->isEdited()) {
-            EventTargetNodeCast(oldFocusNode.get())->dispatchHTMLEvent(changeEvent, true, false);
-            if ((r = static_cast<RenderObject*>(oldFocusNode.get()->renderer())))
+            EventTargetNodeCast(oldFocusedNode.get())->dispatchHTMLEvent(changeEvent, true, false);
+            if ((r = static_cast<RenderObject*>(oldFocusedNode.get()->renderer())))
                 r->setEdited(false);
         }
 
         // Dispatch the blur event and let the node do any other blur related activities (important for text fields)
-        EventTargetNodeCast(oldFocusNode.get())->dispatchBlurEvent();
+        EventTargetNodeCast(oldFocusedNode.get())->dispatchBlurEvent();
 
-        if (m_focusNode) {
+        if (m_focusedNode) {
             // handler shifted focus
             focusChangeBlocked = true;
-            newFocusNode = 0;
+            newFocusedNode = 0;
         }
-        clearSelectionIfNeeded(newFocusNode.get());
-        EventTargetNodeCast(oldFocusNode.get())->dispatchUIEvent(DOMFocusOutEvent);
-        if (m_focusNode) {
+        clearSelectionIfNeeded(newFocusedNode.get());
+        EventTargetNodeCast(oldFocusedNode.get())->dispatchUIEvent(DOMFocusOutEvent);
+        if (m_focusedNode) {
             // handler shifted focus
             focusChangeBlocked = true;
-            newFocusNode = 0;
+            newFocusedNode = 0;
         }
-        clearSelectionIfNeeded(newFocusNode.get());
-        if ((oldFocusNode.get() == this) && oldFocusNode->hasOneRef())
+        clearSelectionIfNeeded(newFocusedNode.get());
+        if ((oldFocusedNode.get() == this) && oldFocusedNode->hasOneRef())
             return true;
             
-        if (oldFocusNode.get() == oldFocusNode->rootEditableElement())
+        if (oldFocusedNode.get() == oldFocusedNode->rootEditableElement())
             frame()->editor()->didEndEditing();
     }
 
-    if (newFocusNode) {
-        if (newFocusNode == newFocusNode->rootEditableElement() && !acceptsEditingFocus(newFocusNode.get())) {
+    if (newFocusedNode) {
+        if (newFocusedNode == newFocusedNode->rootEditableElement() && !acceptsEditingFocus(newFocusedNode.get())) {
             // delegate blocks focus change
             focusChangeBlocked = true;
-            goto SetFocusNodeDone;
+            goto SetFocusedNodeDone;
         }
         // Set focus on the new node
-        m_focusNode = newFocusNode.get();
+        m_focusedNode = newFocusedNode.get();
 
         // Dispatch the focus event and let the node do any other focus related activities (important for text fields)
-        EventTargetNodeCast(m_focusNode.get())->dispatchFocusEvent();
+        EventTargetNodeCast(m_focusedNode.get())->dispatchFocusEvent();
 
-        if (m_focusNode != newFocusNode) {
+        if (m_focusedNode != newFocusedNode) {
             // handler shifted focus
             focusChangeBlocked = true;
-            goto SetFocusNodeDone;
+            goto SetFocusedNodeDone;
         }
-        EventTargetNodeCast(m_focusNode.get())->dispatchUIEvent(DOMFocusInEvent);
-        if (m_focusNode != newFocusNode) { 
+        EventTargetNodeCast(m_focusedNode.get())->dispatchUIEvent(DOMFocusInEvent);
+        if (m_focusedNode != newFocusedNode) { 
             // handler shifted focus
             focusChangeBlocked = true;
-            goto SetFocusNodeDone;
+            goto SetFocusedNodeDone;
         }
-        m_focusNode->setFocus();
+        m_focusedNode->setFocus();
         
-        if (m_focusNode.get() == m_focusNode->rootEditableElement())
+        if (m_focusedNode.get() == m_focusedNode->rootEditableElement())
             frame()->editor()->didBeginEditing();
         
         // eww, I suck. set the qt focus correctly
         // ### find a better place in the code for this
         if (view()) {
-            Widget *focusWidget = widgetForNode(m_focusNode.get());
+            Widget *focusWidget = widgetForNode(m_focusedNode.get());
             if (focusWidget) {
                 // Make sure a widget has the right size before giving it focus.
                 // Otherwise, we are testing edge cases of the Widget code.
                 // Specifically, in WebCore this does not work well for text fields.
                 updateLayout();
                 // Re-get the widget in case updating the layout changed things.
-                focusWidget = widgetForNode(m_focusNode.get());
+                focusWidget = widgetForNode(m_focusedNode.get());
             }
             if (focusWidget)
                 focusWidget->setFocus();
@@ -2140,16 +2140,16 @@ bool Document::setFocusNode(PassRefPtr<Node> newFocusNode)
    }
 
 #if PLATFORM(MAC)
-    if (!focusChangeBlocked && m_focusNode && AXObjectCache::accessibilityEnabled())
+    if (!focusChangeBlocked && m_focusedNode && AXObjectCache::accessibilityEnabled())
         axObjectCache()->handleFocusedUIElementChanged();
 #endif
 
-SetFocusNodeDone:
+SetFocusedNodeDone:
     updateRendering();
     return !focusChangeBlocked;
 }
 
-void Document::clearSelectionIfNeeded(Node *newFocusNode)
+void Document::clearSelectionIfNeeded(Node *newFocusedNode)
 {
     if (!frame())
         return;
@@ -2157,7 +2157,7 @@ void Document::clearSelectionIfNeeded(Node *newFocusNode)
     // Clear the selection when changing the focus node to null or to a node that is not 
     // contained by the current selection.
     Node *startContainer = frame()->selectionController()->start().node();
-    if (!newFocusNode || (startContainer && startContainer != newFocusNode && !(startContainer->isDescendantOf(newFocusNode)) && startContainer->shadowAncestorNode() != newFocusNode))
+    if (!newFocusedNode || (startContainer && startContainer != newFocusedNode && !(startContainer->isDescendantOf(newFocusedNode)) && startContainer->shadowAncestorNode() != newFocusedNode))
         frame()->selectionController()->clear();
 }
 
index a6c2a6b6090d79664d35598b735b10f3fbce113e..eaf27281686236f34e5c179be78e1dee8394ff45 100644 (file)
@@ -402,8 +402,8 @@ public:
     String selectedStylesheetSet() const;
     void setSelectedStylesheetSet(const String&);
 
-    Node* focusNode() const { return m_focusNode.get(); }
-    bool setFocusNode(PassRefPtr<Node>);
+    Node* focusedNode() const { return m_focusedNode.get(); }
+    bool setFocusedNode(PassRefPtr<Node>);
     void clearSelectionIfNeeded(Node*);
 
     Node* hoverNode() const { return m_hoverNode.get(); }
@@ -469,7 +469,7 @@ public:
      *
      * See http://www.w3.org/TR/html4/interact/forms.html#h-17.11.1
      */
-    Node* nextFocusNode(Node* fromNode, KeyboardEvent*);
+    Node* nextFocusedNode(Node* fromNode, KeyboardEvent*);
 
     /**
      * Searches through the document, starting from fromNode, for the previous selectable element (that comes _before_)
@@ -482,7 +482,7 @@ public:
      *
      * See http://www.w3.org/TR/html4/interact/forms.html#h-17.11.1
      */
-    Node* previousFocusNode(Node* fromNode, KeyboardEvent*);
+    Node* previousFocusedNode(Node* fromNode, KeyboardEvent*);
 
     int nodeAbsIndex(Node*);
     Node* nodeWithAbsIndex(int absIndex);
@@ -650,7 +650,7 @@ protected:
 
     Color m_textColor;
 
-    RefPtr<Node> m_focusNode;
+    RefPtr<Node> m_focusedNode;
     RefPtr<Node> m_hoverNode;
     RefPtr<Node> m_activeNode;
     mutable RefPtr<Element> m_documentElement;
index 89e5600e65eb443bd12feca69b780e15d13fbd53..1f0bb906ed028c319aee632c4be632019351cb65 100644 (file)
@@ -560,7 +560,7 @@ void Element::attach()
     createRendererIfNeeded();
 #endif
     ContainerNode::attach();
-    if (needsFocusAppearanceUpdate() && !m_updateFocusAppearanceTimer.isActive() && document()->focusNode() == this)
+    if (needsFocusAppearanceUpdate() && !m_updateFocusAppearanceTimer.isActive() && document()->focusedNode() == this)
         m_updateFocusAppearanceTimer.startOneShot(0);
 }
 
@@ -869,7 +869,7 @@ void Element::focus()
     if (!supportsFocus())
         return;                
         
-    doc->setFocusNode(this);
+    doc->setFocusedNode(this);
 
     if (!isFocusable()) {
         setNeedsFocusAppearanceUpdate(true);
@@ -910,8 +910,8 @@ void Element::blur()
 {
     stopUpdateFocusAppearanceTimer();
     Document* doc = document();
-    if (doc->focusNode() == this)
-        doc->setFocusNode(0);
+    if (doc->focusedNode() == this)
+        doc->setFocusedNode(0);
 }
 
 void Element::stopUpdateFocusAppearanceTimer()
index 2396ca5ef7c1dca220b99b9c54fea8615241660a..9cd41f80971f7bb5c03df9ab1a4d822d08c8b6dd 100644 (file)
@@ -125,7 +125,7 @@ void SelectionController::setSelection(const Selection& s, bool closeTyping, boo
     m_needsLayout = true;
     
     if (!s.isNone())
-        m_frame->setFocusNodeIfNeeded();
+        m_frame->setFocusedNodeIfNeeded();
     
     m_frame->selectionLayoutChanged();
     // Always clear the x position used for vertical arrow navigation.
index d9467bd9b1c7b92be515aa2c8bc4c79410bc4ea1..e1e4c98587a3ec8e04f3bdaa5985d0dde06010c3 100644 (file)
@@ -94,10 +94,10 @@ void HTMLGenericFormElement::attach()
     
         // Delayed attachment in order to prevent FOUC can result in an object being
         // programmatically focused before it has a render object.  If we have been focused
-        // (i.e., if we are the focusNode) then go ahead and focus our corresponding native widget.
+        // (i.e., if we are the focusedNode) then go ahead and focus our corresponding native widget.
         // (Attach/detach can also happen as a result of display type changes, e.g., making a widget
         // block instead of inline, and focus should be restored in that case as well.)
-        if (document()->focusNode() == this && renderer()->isWidget() && 
+        if (document()->focusedNode() == this && renderer()->isWidget() && 
             static_cast<RenderWidget*>(renderer())->widget())
             static_cast<RenderWidget*>(renderer())->widget()->setFocus();
     }
index 5f332c3ba277f97a11e389a5959fafb500d553a5..5415a3aa245a687902361ed238b05de3d6341353 100644 (file)
@@ -152,9 +152,9 @@ bool HTMLInputElement::isKeyboardFocusable(KeyboardEvent* event) const
 
         // Never allow keyboard tabbing to leave you in the same radio group.  Always
         // skip any other elements in the group.
-        Node* currentFocusNode = document()->focusNode();
-        if (currentFocusNode && currentFocusNode->hasTagName(inputTag)) {
-            HTMLInputElement* focusedInput = static_cast<HTMLInputElement*>(currentFocusNode);
+        Node* currentFocusedNode = document()->focusedNode();
+        if (currentFocusedNode && currentFocusedNode->hasTagName(inputTag)) {
+            HTMLInputElement* focusedInput = static_cast<HTMLInputElement*>(currentFocusedNode);
             if (focusedInput->inputType() == RADIO && focusedInput->form() == form() &&
                 focusedInput->name() == name())
                 return false;
@@ -178,12 +178,12 @@ void HTMLInputElement::focus()
 {
     if (isNonWidgetTextField()) {
         Document* doc = document();
-        if (doc->focusNode() == this)
+        if (doc->focusedNode() == this)
             return;
         doc->updateLayout();
         if (!supportsFocus())
             return;
-        doc->setFocusNode(this);
+        doc->setFocusedNode(this);
         // FIXME: Should isFocusable do the updateLayout?
         if (!isFocusable()) {
             setNeedsFocusAppearanceUpdate(true);
@@ -485,7 +485,7 @@ int HTMLInputElement::selectionStart() const
         case ISINDEX:
         case PASSWORD:
         case TEXT:
-            if (document()->focusNode() != this && cachedSelStart >= 0)
+            if (document()->focusedNode() != this && cachedSelStart >= 0)
                 return cachedSelStart;
             return static_cast<RenderTextControl*>(renderer())->selectionStart();
     }
@@ -513,7 +513,7 @@ int HTMLInputElement::selectionEnd() const
         case ISINDEX:
         case PASSWORD:
         case TEXT:
-            if (document()->focusNode() != this && cachedSelEnd >= 0)
+            if (document()->focusedNode() != this && cachedSelEnd >= 0)
                 return cachedSelEnd;
             return static_cast<RenderTextControl*>(renderer())->selectionEnd();
     }
@@ -1103,7 +1103,7 @@ void HTMLInputElement::setValue(const String& value)
     
     // Restore a caret at the starting point of the old selection.
     // This matches Safari 2.0 behavior.
-    if (isNonWidgetTextField() && document()->focusNode() == this && cachedSelStart >= 0) {
+    if (isNonWidgetTextField() && document()->focusedNode() == this && cachedSelStart >= 0) {
         ASSERT(cachedSelEnd >= 0);
         setSelectionRange(cachedSelStart, cachedSelStart);
     }
@@ -1355,7 +1355,7 @@ void HTMLInputElement::defaultEventHandler(Event *evt)
                         if (inputElt->inputType() == RADIO && inputElt->name() == name() &&
                             inputElt->isFocusable()) {
                             inputElt->setChecked(true);
-                            document()->setFocusNode(inputElt);
+                            document()->setFocusedNode(inputElt);
                             inputElt->click(false, false);
                             evt->setDefaultHandled();
                             break;
index 139097a8739fdd95b61def13c2013e3aa37ca28d..7c00c1541264a57b35afd0a8fba13ad876a364d0 100644 (file)
@@ -78,7 +78,7 @@ void HTMLTextAreaElement::restoreState(const String& state)
 int HTMLTextAreaElement::selectionStart()
 {
     if (renderer()) {
-        if (document()->focusNode() != this && cachedSelStart >= 0)
+        if (document()->focusedNode() != this && cachedSelStart >= 0)
             return cachedSelStart;
         return static_cast<RenderTextControl *>(renderer())->selectionStart();
     }
@@ -88,7 +88,7 @@ int HTMLTextAreaElement::selectionStart()
 int HTMLTextAreaElement::selectionEnd()
 {
     if (renderer()) {
-        if (document()->focusNode() != this && cachedSelEnd >= 0)
+        if (document()->focusedNode() != this && cachedSelEnd >= 0)
             return cachedSelEnd;
         return static_cast<RenderTextControl *>(renderer())->selectionEnd();
     }
@@ -196,12 +196,12 @@ bool HTMLTextAreaElement::isMouseFocusable() const
 void HTMLTextAreaElement::focus()
 {
     Document* doc = document();
-    if (doc->focusNode() == this)
+    if (doc->focusedNode() == this)
         return;
     doc->updateLayout();
     if (!supportsFocus())
         return;
-    doc->setFocusNode(this);
+    doc->setFocusedNode(this);
     // FIXME: Should isFocusable do the updateLayout?
     if (!isFocusable()) {
         setNeedsFocusAppearanceUpdate(true);
@@ -271,7 +271,7 @@ void HTMLTextAreaElement::setValue(const String& value)
         
     // Restore a caret at the starting point of the old selection.
     // This matches Safari 2.0 behavior.
-    if (document()->focusNode() == this && cachedSelStart >= 0) {
+    if (document()->focusedNode() == this && cachedSelStart >= 0) {
         ASSERT(cachedSelEnd >= 0);
         setSelectionRange(cachedSelStart, cachedSelStart);
     }
index 8ef010c7b94e4974bc5918f1b0f39bcb46e71e78..d9c747890f95e27c8b9806261cdac3e0f6649ca1 100644 (file)
@@ -516,9 +516,9 @@ void FrameLoader::stopLoading(bool sendUnload)
     if (sendUnload) {
         if (m_frame->document()) {
             if (m_wasLoadEventEmitted && !m_wasUnloadEventEmitted) {
-                Node* currentFocusNode = m_frame->document()->focusNode();
-                if (currentFocusNode)
-                    currentFocusNode->aboutToUnload();
+                Node* currentFocusedNode = m_frame->document()->focusedNode();
+                if (currentFocusedNode)
+                    currentFocusedNode->aboutToUnload();
                 m_frame->document()->dispatchWindowEvent(unloadEvent, false, false);
                 if (m_frame->document())
                     m_frame->document()->updateRendering();
index 166582c9084feba6fc0f2b2b32b9c701496b922e..8409d220edf0068730507fc90bc2da681314282c 100644 (file)
@@ -484,7 +484,7 @@ bool EventHandler::scrollOverflow(ScrollDirection direction, ScrollGranularity g
     if (!m_frame->document())
         return false;
     
-    Node* node = m_frame->document()->focusNode();
+    Node* node = m_frame->document()->focusedNode();
     if (!node)
         node = m_mousePressNode.get();
     
@@ -966,8 +966,8 @@ bool EventHandler::advanceFocus(KeyboardEvent* event)
         return false;
 
     Node* node = event->shiftKey()
-        ? document->previousFocusNode(document->focusNode(), event)
-        : document->nextFocusNode(document->focusNode(), event);
+        ? document->previousFocusedNode(document->focusedNode(), event)
+        : document->nextFocusedNode(document->focusedNode(), event);
 
     if (!node)
         // FIXME: Need to support tabbing out of the document to the UI.
@@ -1046,10 +1046,10 @@ bool EventHandler::dispatchMouseEvent(const AtomicString& eventType, Node* targe
         // If focus shift is blocked, we eat the event.  Note we should never clear swallowEvent
         // if the page already set it (e.g., by canceling default behavior).
         if (node && node->isMouseFocusable()) {
-            if (!m_frame->document()->setFocusNode(node))
+            if (!m_frame->document()->setFocusedNode(node))
                 swallowEvent = true;
         } else if (!node || !node->focused()) {
-            if (!m_frame->document()->setFocusNode(0))
+            if (!m_frame->document()->setFocusedNode(0))
                 swallowEvent = true;
         }
 
index 487ee6a74b4ad05ebdf098b70e15e4554f02c5d7..6983f31a5c112ea14e396a8e3fb1abf6ea788202 100644 (file)
@@ -391,7 +391,7 @@ void Frame::setCaretVisible(bool flag)
         return;
     clearCaretRectIfNeeded();
     if (flag)
-        setFocusNodeIfNeeded();
+        setFocusedNodeIfNeeded();
     d->m_caretVisible = flag;
     selectionLayoutChanged();
 }
@@ -418,7 +418,7 @@ static bool isFrameElement(const Node *n)
     return widget && widget->isFrameView();
 }
 
-void Frame::setFocusNodeIfNeeded()
+void Frame::setFocusedNodeIfNeeded()
 {
     if (!document() || selectionController()->isNone() || !d->m_isActive)
         return;
@@ -434,14 +434,14 @@ void Frame::setFocusNodeIfNeeded()
             // so add the !isFrameElement check here. There's probably a better way to make this
             // work in the long term, but this is the safest fix at this time.
             if (target && target->isMouseFocusable() && !isFrameElement(target)) {
-                document()->setFocusNode(target);
+                document()->setFocusedNode(target);
                 return;
             }
             renderer = renderer->parent();
             if (renderer)
                 target = renderer->element();
         }
-        document()->setFocusNode(0);
+        document()->setFocusedNode(0);
     }
 }
 
@@ -968,7 +968,7 @@ static HTMLFormElement *scanForForm(Node *start)
 HTMLFormElement *Frame::currentForm() const
 {
     // start looking either at the active (first responder) node, or where the selection is
-    Node *start = d->m_doc ? d->m_doc->focusNode() : 0;
+    Node *start = d->m_doc ? d->m_doc->focusedNode() : 0;
     if (!start)
         start = selectionController()->start().node();
     
@@ -1254,7 +1254,7 @@ void Frame::setIsActive(bool flag)
     // 3. The drawing of a focus ring around links in web pages.
     Document *doc = document();
     if (doc) {
-        Node *node = doc->focusNode();
+        Node *node = doc->focusedNode();
         if (node) {
             node->setChanged();
             if (node->renderer() && node->renderer()->style()->hasAppearance())
@@ -1274,8 +1274,8 @@ void Frame::setIsActive(bool flag)
     }
    
     // 5. Enable or disable secure keyboard entry
-    if ((flag && !isSecureKeyboardEntry() && doc && doc->focusNode() && doc->focusNode()->hasTagName(inputTag) && 
-            static_cast<HTMLInputElement*>(doc->focusNode())->inputType() == HTMLInputElement::PASSWORD) ||
+    if ((flag && !isSecureKeyboardEntry() && doc && doc->focusedNode() && doc->focusedNode()->hasTagName(inputTag) && 
+            static_cast<HTMLInputElement*>(doc->focusedNode())->inputType() == HTMLInputElement::PASSWORD) ||
         (!flag && isSecureKeyboardEntry()))
             setSecureKeyboardEntry(flag);
 }
index c63013165791ecfa32cf426bd7b51799dbe270e6..16d2e22424b9bf8dccdae7ba7586c7b1cc6ea4e9 100644 (file)
@@ -298,7 +298,7 @@ public:
     bool shouldChangeSelection(const Selection&) const;
     virtual bool shouldDeleteSelection(const Selection&) const;
     void clearCaretRectIfNeeded();
-    void setFocusNodeIfNeeded();
+    void setFocusedNodeIfNeeded();
     void selectionLayoutChanged();
     void notifyRendererOfSelectionChange(bool userTriggered);
 
index 3bc27ec0259e68c4b4a6d2e21081ebb2da45b913..317520ca3416b1df73b3682b3e266b5ab607a0ad 100644 (file)
@@ -112,8 +112,8 @@ NSView* EventHandler::nextKeyViewInFrame(Node* n, SelectionDirection direction,
     RefPtr<Node> node = n;
     for (;;) {
         node = direction == SelectingNext
-            ? doc->nextFocusNode(node.get(), event.get())
-            : doc->previousFocusNode(node.get(), event.get());
+            ? doc->nextFocusedNode(node.get(), event.get())
+            : doc->previousFocusedNode(node.get(), event.get());
         if (!node)
             return nil;
         
@@ -161,7 +161,7 @@ NSView *EventHandler::nextKeyViewInFrameHierarchy(Node* node, SelectionDirection
     // have been made native.
     if (next && (next != [Mac(m_frame)->bridge() documentView] && !focusCallResultedInViewBeingCreated))
         if (Document* doc = m_frame->document())
-            doc->setFocusNode(0);
+            doc->setFocusedNode(0);
 
     // The common case where a view was created is when an <input> element changed from native 
     // to non-native. When this happens, HTMLGenericFormElement::attach() method will call setFocus()
@@ -306,7 +306,7 @@ bool EventHandler::keyEvent(NSEvent *event)
     Document* doc = m_frame->document();
     if (!doc)
         return false;
-    Node* node = doc->focusNode();
+    Node* node = doc->focusedNode();
     if (!node) {
         if (doc->isHTMLDocument())
             node = doc->body();
index cd196171b736f5532f5ce717c061d2a9644d127c..05eb24fa1bad30c6141cca1f063d9f3de9e74e89 100644 (file)
@@ -182,7 +182,7 @@ void Widget::clearFocus()
     Frame* frame = Frame::frameForWidget(this);
     if (!frame)
         return;
-    frame->document()->setFocusNode(0);
+    frame->document()->setFocusedNode(0);
 }
 
 Widget::FocusPolicy Widget::focusPolicy() const
index 9ecd843ef4bea305f9cd578ecfcf63e706245232..bca4b01317560cf00d19a65961108987904c7b1f 100644 (file)
@@ -286,7 +286,7 @@ void RenderListBox::paintItemForeground(PaintInfo& paintInfo, int tx, int ty, in
     
     Color textColor = element->renderStyle() ? element->renderStyle()->color() : style()->color();
     if (element->hasTagName(optionTag) && static_cast<HTMLOptionElement*>(element)->selected()) {
-        if (document()->frame()->isActive() && document()->focusNode() == node())
+        if (document()->frame()->isActive() && document()->focusedNode() == node())
             textColor = theme()->activeListBoxSelectionForegroundColor();
         // Honor the foreground color for disabled items
         else if (!element->disabled())
@@ -317,7 +317,7 @@ void RenderListBox::paintItemBackground(PaintInfo& paintInfo, int tx, int ty, in
 
     Color backColor;
     if (element->hasTagName(optionTag) && static_cast<HTMLOptionElement*>(element)->selected()) {
-        if (document()->frame()->isActive() && document()->focusNode() == node())
+        if (document()->frame()->isActive() && document()->focusedNode() == node())
             backColor = theme()->activeListBoxSelectionBackgroundColor();
         else
             backColor = theme()->inactiveListBoxSelectionBackgroundColor();
index b5b4d44f42b899d610e5271238c5ffb6c19c23b3..9babd0507c150a839758ec2a8ed3d0fbaae3cf99 100644 (file)
@@ -326,7 +326,7 @@ bool RenderTheme::isFocused(const RenderObject* o) const
 {
     if (!o->element())
         return false;
-    return o->element() == o->element()->document()->focusNode();
+    return o->element() == o->element()->document()->focusedNode();
 }
 
 bool RenderTheme::isPressed(const RenderObject* o) const
index 8eb72a0e4c19c2b00f81a9f5704a319172b7c02f..a0350c9f9f1b0bfdd2865cf589fa88bc1f7f9bdb 100644 (file)
@@ -258,7 +258,7 @@ void RenderThemeMac::updateFocusedState(NSCell* cell, const RenderObject* o)
     // FIXME: Need to add a key window test here, or the element will look
     // focused even when in the background.
     bool oldFocused = [cell showsFirstResponder];
-    bool focused = (o->element() && o->document()->focusNode() == o->element()) && (o->style()->outlineStyleIsAuto());
+    bool focused = (o->element() && o->document()->focusedNode() == o->element()) && (o->style()->outlineStyleIsAuto());
     if (focused != oldFocused)
         [cell setShowsFirstResponder:focused];
 }
index 5a755dca0c5ba2626d63e1ad3214ffd61bbc23a0..946481365f312dbc429f281cfc40699d94e0becb 100644 (file)
@@ -206,7 +206,7 @@ void RenderWidget::focusIn(Widget*)
     RenderArena* arena = ref();
     RefPtr<Node> elem = element();
     if (elem)
-        elem->document()->setFocusNode(elem);
+        elem->document()->setFocusedNode(elem);
     deref(arena);
 }
 
@@ -214,8 +214,8 @@ void RenderWidget::focusOut(Widget*)
 {
     RenderArena* arena = ref();
     RefPtr<Node> elem = element();
-    if (elem && elem == elem->document()->focusNode())
-        elem->document()->setFocusNode(0);
+    if (elem && elem == elem->document()->focusedNode())
+        elem->document()->setFocusedNode(0);
     deref(arena);
 }
 
index b321b0c1900d5feaea8e18f65c959a604e36d830..794e80bf8216528e0265aaaae6ff79674ed53b8e 100644 (file)
@@ -1,3 +1,14 @@
+2006-11-30  Geoffrey Garen  <ggaren@apple.com>
+
+        Rubber Stamped by Anders Carlsson.
+
+        Global rename of Document::focusNode to Document::focusedNode. 'focusNode'
+        suggested a command, and conflicted with a different meaning for 'focusNode'
+        in the Mozilla selection API.
+
+        * WebView/WebHTMLView.m:
+        (-[NSArray clearFocus]):
+
 2006-11-30  Matt Lilek  <pewtermoose@gmail.com>
 
         Reviewed by Mitz.
index bbc7acecfbc5f05129bf6b0cca446d3a34553140..5b4a1fa2644057a32622ce2f7bee5e460492023b 100644 (file)
@@ -2688,7 +2688,7 @@ static WebHTMLView *lastHitView = nil;
     if (!document)
         return;
     
-    document->setFocusNode(0);
+    document->setFocusedNode(0);
 }
 
 - (BOOL)isOpaque