Refactoring: Fold Document::focusedNodeRemoved into Document::removeFocusedNodeOfSubtree
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Jun 2013 07:24:13 +0000 (07:24 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Jun 2013 07:24:13 +0000 (07:24 +0000)
https://bugs.webkit.org/show_bug.cgi?id=118036

Reviewed by Kent Tamura.

Merge https://chromium.googlesource.com/chromium/blink/+/3391beabe75548cc638a6c88982f913621a4410f.

* dom/Document.cpp:
(WebCore::Document::removeFocusedNodeOfSubtree):
* dom/Document.h:

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

Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h

index a29473cec2f825e637d6c8f56e9133f782a02ac6..50ba8a3ee5ee8d18a118fac2fa96673187f13691 100644 (file)
@@ -1,3 +1,16 @@
+2013-06-26  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Refactoring: Fold Document::focusedNodeRemoved into Document::removeFocusedNodeOfSubtree
+        https://bugs.webkit.org/show_bug.cgi?id=118036
+
+        Reviewed by Kent Tamura.
+
+        Merge https://chromium.googlesource.com/chromium/blink/+/3391beabe75548cc638a6c88982f913621a4410f.
+
+        * dom/Document.cpp:
+        (WebCore::Document::removeFocusedNodeOfSubtree):
+        * dom/Document.h:
+
 2013-06-25  Ryosuke Niwa  <rniwa@webkit.org>
 
         JSString should remember AtomicString
index 1f4a37c4835940257af4b07444bfc1bf43037022..36ca3446c7816e06a721acf0c5132e3c4c9b5f4a 100644 (file)
@@ -3221,11 +3221,6 @@ void Document::setActiveElement(PassRefPtr<Element> newActiveElement)
     m_activeElement = newActiveElement;
 }
 
-void Document::focusedNodeRemoved()
-{
-    setFocusedElement(0);
-}
-
 void Document::removeFocusedNodeOfSubtree(Node* node, bool amongChildrenOnly)
 {
     if (!m_focusedElement || this->inPageCache()) // If the document is in the page cache, then we don't need to clear out the focused node.
@@ -3242,7 +3237,7 @@ void Document::removeFocusedNodeOfSubtree(Node* node, bool amongChildrenOnly)
         nodeInSubtree = (focusedElement == node) || focusedElement->isDescendantOf(node);
     
     if (nodeInSubtree)
-        document()->focusedNodeRemoved();
+        setFocusedElement(0);
 }
 
 void Document::hoveredElementDidDetach(Element* element)
index e06f7ff6377c274fa70c8e03202de013a485637e..6f4abeec32cb002573cc5deceff4a88e0a924dc6 100644 (file)
@@ -681,7 +681,6 @@ public:
     void setActiveElement(PassRefPtr<Element>);
     Element* activeElement() const { return m_activeElement.get(); }
 
-    void focusedNodeRemoved();
     void removeFocusedNodeOfSubtree(Node*, bool amongChildrenOnly = false);
     void hoveredElementDidDetach(Element*);
     void elementInActiveChainDidDetach(Element*);