shadowAncestorNode() should be renamed to deprecatedShadowAncestorNode()
authorshinyak@chromium.org <shinyak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Jan 2013 18:04:07 +0000 (18:04 +0000)
committershinyak@chromium.org <shinyak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Jan 2013 18:04:07 +0000 (18:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=107624

Reviewed by Dimitri Glazkov.

Since Node::shadowAncestorNode() is deprecated, we would like to rename it to prevent from further use.

Source/WebCore:

No new tests, simple refactoring.

* WebCore.order:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::accessibilityHitTest):
* dom/Document.cpp:
(WebCore::Document::handleZeroPadding):
* dom/Node.cpp:
(WebCore::Node::deprecatedShadowAncestorNode):
* dom/Node.h:
(Node):
* editing/Editor.cpp:
(WebCore::Editor::rangeOfString):
(WebCore::Editor::countMatchesForText):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplacementFragment::ReplacementFragment):
* page/DragController.cpp:
(WebCore::elementUnderMouse):
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMouseReleaseEvent):
(WebCore::EventHandler::bestClickableNodeForTouchPoint):
* page/FocusController.cpp:
(WebCore::clearSelectionIfNeeded):
* platform/blackberry/RenderThemeBlackBerry.cpp:
(WebCore::RenderThemeBlackBerry::paintSearchFieldCancelButton):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::setToNonShadowAncestor):
(WebCore::HitTestResult::addNodeToRectBasedTestResult):

Source/WebKit/blackberry:

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::webContext):
* WebKitSupport/FatFingers.h:
(BlackBerry::WebKit::FatFingersResult::node):
* WebKitSupport/InPageSearchManager.cpp:
(BlackBerry::WebKit::InPageSearchManager::scopeStringMatches):

Source/WebKit/chromium:

* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::scopeStringMatches):
(WebKit::WebFrameImpl::setFindEndstateFocusAndSelection):

Source/WebKit/qt:

* WebCoreSupport/QWebPageAdapter.cpp:
(QWebPageAdapter::inputMethodEvent):
(QWebPageAdapter::inputMethodQuery):

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

21 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.order
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/Node.h
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/ReplaceSelectionCommand.cpp
Source/WebCore/page/DragController.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/FocusController.cpp
Source/WebCore/platform/blackberry/RenderThemeBlackBerry.cpp
Source/WebCore/rendering/HitTestResult.cpp
Source/WebKit/blackberry/Api/WebPage.cpp
Source/WebKit/blackberry/ChangeLog
Source/WebKit/blackberry/WebKitSupport/FatFingers.h
Source/WebKit/blackberry/WebKitSupport/InPageSearchManager.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebFrameImpl.cpp
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp

index c6959f7..e044787 100644 (file)
@@ -1,3 +1,41 @@
+2013-01-23  Shinya Kawanaka  <shinyak@chromium.org>
+
+        shadowAncestorNode() should be renamed to deprecatedShadowAncestorNode()
+        https://bugs.webkit.org/show_bug.cgi?id=107624
+
+        Reviewed by Dimitri Glazkov.
+
+        Since Node::shadowAncestorNode() is deprecated, we would like to rename it to prevent from further use.
+
+        No new tests, simple refactoring.
+
+        * WebCore.order:
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::accessibilityHitTest):
+        * dom/Document.cpp:
+        (WebCore::Document::handleZeroPadding):
+        * dom/Node.cpp:
+        (WebCore::Node::deprecatedShadowAncestorNode):
+        * dom/Node.h:
+        (Node):
+        * editing/Editor.cpp:
+        (WebCore::Editor::rangeOfString):
+        (WebCore::Editor::countMatchesForText):
+        * editing/ReplaceSelectionCommand.cpp:
+        (WebCore::ReplacementFragment::ReplacementFragment):
+        * page/DragController.cpp:
+        (WebCore::elementUnderMouse):
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::handleMouseReleaseEvent):
+        (WebCore::EventHandler::bestClickableNodeForTouchPoint):
+        * page/FocusController.cpp:
+        (WebCore::clearSelectionIfNeeded):
+        * platform/blackberry/RenderThemeBlackBerry.cpp:
+        (WebCore::RenderThemeBlackBerry::paintSearchFieldCancelButton):
+        * rendering/HitTestResult.cpp:
+        (WebCore::HitTestResult::setToNonShadowAncestor):
+        (WebCore::HitTestResult::addNodeToRectBasedTestResult):
+
 2013-01-22  Pavel Feldman  <pfeldman@chromium.org>
 
         Web Inspector: only allow evaluateForTestInFrontend for front-ends under test.
index 9a1210f..db63474 100644 (file)
@@ -841,7 +841,7 @@ __ZN7WebCore11RenderLayer19insertOnlyThisLayerEv
 __ZN7WebCore11RenderLayer34clearClipRectsIncludingDescendantsEv
 __ZN7WebCore11RenderLayer12styleChangedENS_15StyleDifferenceEPKNS_11RenderStyleE
 __ZN7WebCore11RenderLayer23updateScrollCornerStyleEv
-__ZN7WebCore4Node18shadowAncestorNodeEv
+__ZN7WebCore4Node28deprecatedShadowAncestorNodeEv
 __ZNK7WebCore4Node15isSVGShadowRootEv
 __ZN7WebCore11RenderLayer18updateResizerStyleEv
 __ZN7WebCore11RenderLayer15updateTransformEv
index 6a9eb3f..fba36ce 100644 (file)
@@ -2194,7 +2194,7 @@ AccessibilityObject* AccessibilityRenderObject::accessibilityHitTest(const IntPo
     layer->hitTest(request, hitTestResult);
     if (!hitTestResult.innerNode())
         return 0;
-    Node* node = hitTestResult.innerNode()->shadowAncestorNode();
+    Node* node = hitTestResult.innerNode()->deprecatedShadowAncestorNode();
 
     if (node->hasTagName(areaTag)) 
         return accessibilityImageMapHitTest(static_cast<HTMLAreaElement*>(node), point);
index 1d615d7..ea02811 100644 (file)
@@ -1395,7 +1395,7 @@ PassRefPtr<NodeList> Document::handleZeroPadding(const HitTestRequest& request,
     if (!node)
         return 0;
 
-    node = node->shadowAncestorNode();
+    node = node->deprecatedShadowAncestorNode();
     ListHashSet<RefPtr<Node> > list;
     list.add(node);
     return StaticHashSetNodeList::adopt(list);
index 9bd8f2c..7310fc3 100644 (file)
@@ -1229,7 +1229,7 @@ Element* Node::shadowHost() const
     return 0;
 }
 
-Node* Node::shadowAncestorNode() const
+Node* Node::deprecatedShadowAncestorNode() const
 {
     if (ShadowRoot* root = containingShadowRoot())
         return root->host();
index a3d4eff..16ec873 100644 (file)
@@ -267,7 +267,7 @@ public:
     Element* shadowHost() const;
     // If this node is in a shadow tree, returns its shadow host. Otherwise, returns this.
     // Deprecated. Should use shadowHost() and check the return value.
-    Node* shadowAncestorNode() const;
+    Node* deprecatedShadowAncestorNode() const;
     ShadowRoot* containingShadowRoot() const;
     ShadowRoot* youngestShadowRoot() const;
 
index 3221467..2e1d5ec 100644 (file)
@@ -2709,9 +2709,9 @@ PassRefPtr<Range> Editor::rangeOfString(const String& target, Range* referenceRa
     if (resultRange->collapsed() && shadowTreeRoot) {
         searchRange = rangeOfContents(m_frame->document());
         if (forward)
-            searchRange->setStartAfter(shadowTreeRoot->shadowAncestorNode());
+            searchRange->setStartAfter(shadowTreeRoot->deprecatedShadowAncestorNode());
         else
-            searchRange->setEndBefore(shadowTreeRoot->shadowAncestorNode());
+            searchRange->setEndBefore(shadowTreeRoot->deprecatedShadowAncestorNode());
 
         resultRange = findPlainText(searchRange.get(), target, options);
     }
@@ -2768,7 +2768,7 @@ unsigned Editor::countMatchesForText(const String& target, Range* range, FindOpt
             if (!resultRange->startContainer()->isInShadowTree())
                 break;
 
-            searchRange->setStartAfter(resultRange->startContainer()->shadowAncestorNode(), exception);
+            searchRange->setStartAfter(resultRange->startContainer()->deprecatedShadowAncestorNode(), exception);
             searchRange->setEnd(originalEndContainer, originalEndOffset, exception);
             continue;
         }
index 871e3ac..4ade68a 100644 (file)
@@ -156,7 +156,7 @@ ReplacementFragment::ReplacementFragment(Document* document, DocumentFragment* f
     if (!editableRoot)
         return;
     
-    Node* shadowAncestorNode = editableRoot->shadowAncestorNode();
+    Node* shadowAncestorNode = editableRoot->deprecatedShadowAncestorNode();
     
     if (!editableRoot->getAttributeEventListener(eventNames().webkitBeforeTextInsertedEvent) &&
         // FIXME: Remove these checks once textareas and textfields actually register an event handler.
index 206a8af..1032283 100644 (file)
@@ -302,7 +302,7 @@ static Element* elementUnderMouse(Document* documentUnderMouse, const IntPoint&
     while (n && !n->isElementNode())
         n = n->parentNode();
     if (n)
-        n = n->shadowAncestorNode();
+        n = n->deprecatedShadowAncestorNode();
 
     return static_cast<Element*>(n);
 }
index 0e4a4a3..04f2ac2 100644 (file)
@@ -1817,8 +1817,8 @@ bool EventHandler::handleMouseReleaseEvent(const PlatformMouseEvent& mouseEvent)
 
     Node* clickTarget = mev.targetNode();
     if (clickTarget)
-        clickTarget = clickTarget->shadowAncestorNode();
-    Node* adjustedClickNode = m_clickNode ? m_clickNode->shadowAncestorNode() : 0;
+        clickTarget = clickTarget->deprecatedShadowAncestorNode();
+    Node* adjustedClickNode = m_clickNode ? m_clickNode->deprecatedShadowAncestorNode() : 0;
 
     bool contextMenuEvent = mouseEvent.button() == RightButton;
 #if PLATFORM(CHROMIUM) && OS(DARWIN)
@@ -2723,7 +2723,7 @@ bool EventHandler::bestClickableNodeForTouchPoint(const IntPoint& touchCenter, c
     // handle targetNode being a shadow DOM node. 
     bool success = findBestClickableCandidate(targetNode, targetPoint, touchCenter, touchRect, *nodeList.get());
     if (success && targetNode)
-        targetNode = targetNode->shadowAncestorNode();
+        targetNode = targetNode->deprecatedShadowAncestorNode();
     return success;
 }
 
index 1653df6..7179b79 100644 (file)
@@ -558,7 +558,7 @@ static void clearSelectionIfNeeded(Frame* oldFocusedFrame, Frame* newFocusedFram
         return;
 
     Node* selectionStartNode = s->selection().start().deprecatedNode();
-    if (selectionStartNode == newFocusedNode || selectionStartNode->isDescendantOf(newFocusedNode) || selectionStartNode->shadowAncestorNode() == newFocusedNode)
+    if (selectionStartNode == newFocusedNode || selectionStartNode->isDescendantOf(newFocusedNode) || selectionStartNode->deprecatedShadowAncestorNode() == newFocusedNode)
         return;
         
     if (Node* mousePressNode = newFocusedFrame->eventHandler()->mousePressNode()) {
@@ -568,7 +568,7 @@ static void clearSelectionIfNeeded(Frame* oldFocusedFrame, Frame* newFocusedFram
             if (!root)
                 return;
 
-            if (Node* shadowAncestorNode = root->shadowAncestorNode()) {
+            if (Node* shadowAncestorNode = root->deprecatedShadowAncestorNode()) {
                 if (!shadowAncestorNode->hasTagName(inputTag) && !shadowAncestorNode->hasTagName(textareaTag))
                     return;
             }
index cd8608e..c7525db 100644 (file)
@@ -441,7 +441,7 @@ IntRect RenderThemeBlackBerry::convertToPaintingRect(RenderObject* inputRenderer
 
 bool RenderThemeBlackBerry::paintSearchFieldCancelButton(RenderObject* cancelButtonObject, const PaintInfo& paintInfo, const IntRect& r)
 {
-    Node* input = cancelButtonObject->node()->shadowAncestorNode();
+    Node* input = cancelButtonObject->node()->deprecatedShadowAncestorNode();
     if (!input->renderer()->isBox())
         return false;
 
index 633bddf..b5bfd83 100644 (file)
@@ -257,11 +257,11 @@ void HitTestResult::setToNonShadowAncestor()
 {
     Node* node = innerNode();
     if (node)
-        node = node->shadowAncestorNode();
+        node = node->deprecatedShadowAncestorNode();
     setInnerNode(node);
     node = innerNonSharedNode();
     if (node)
-        node = node->shadowAncestorNode();
+        node = node->deprecatedShadowAncestorNode();
     setInnerNonSharedNode(node);
 }
 
@@ -699,7 +699,7 @@ bool HitTestResult::addNodeToRectBasedTestResult(Node* node, const HitTestReques
         return true;
 
     if (!request.allowsShadowContent())
-        node = node->shadowAncestorNode();
+        node = node->deprecatedShadowAncestorNode();
 
     mutableRectBasedTestResult().add(node);
 
@@ -719,7 +719,7 @@ bool HitTestResult::addNodeToRectBasedTestResult(Node* node, const HitTestReques
         return true;
 
     if (!request.allowsShadowContent())
-        node = node->shadowAncestorNode();
+        node = node->deprecatedShadowAncestorNode();
 
     mutableRectBasedTestResult().add(node);
 
index 430886a..c563e2e 100644 (file)
@@ -2346,7 +2346,7 @@ Platform::WebContext WebPagePrivate::webContext(TargetDetectionStrategy strategy
     bool canStartSelection = node->canStartSelection();
 
     if (node->isElementNode()) {
-        Element* element = static_cast<Element*>(node->shadowAncestorNode());
+        Element* element = static_cast<Element*>(node->deprecatedShadowAncestorNode());
 
         if (DOMSupport::isTextBasedContentEditableElement(element)) {
             if (!canStartSelection) {
@@ -2381,7 +2381,7 @@ Platform::WebContext WebPagePrivate::webContext(TargetDetectionStrategy strategy
     // Walk up the node tree looking for our custom webworks context attribute.
     while (node) {
         if (node->isElementNode()) {
-            Element* element = static_cast<Element*>(node->shadowAncestorNode());
+            Element* element = static_cast<Element*>(node->deprecatedShadowAncestorNode());
             String webWorksContext(DOMSupport::webWorksContext(element));
             if (!webWorksContext.stripWhiteSpace().isEmpty()) {
                 context.setFlag(Platform::WebContext::IsWebWorksContext);
index 9ce117e..002edd5 100644 (file)
@@ -1,3 +1,19 @@
+2013-01-23  Shinya Kawanaka  <shinyak@chromium.org>
+
+        shadowAncestorNode() should be renamed to deprecatedShadowAncestorNode()
+        https://bugs.webkit.org/show_bug.cgi?id=107624
+
+        Reviewed by Dimitri Glazkov.
+
+        Since Node::shadowAncestorNode() is deprecated, we would like to rename it to prevent from further use.
+
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPagePrivate::webContext):
+        * WebKitSupport/FatFingers.h:
+        (BlackBerry::WebKit::FatFingersResult::node):
+        * WebKitSupport/InPageSearchManager.cpp:
+        (BlackBerry::WebKit::InPageSearchManager::scopeStringMatches):
+
 2013-01-22  Andrew Lo  <anlo@rim.com>
 
         [BlackBerry] GIF & RAF animations sometimes don't resume after zoom
index f4a6362..f8df963 100644 (file)
@@ -159,7 +159,7 @@ public:
 
         // Shadow trees can be nested.
         while (result->isInShadowTree())
-            result = toElement(result->shadowAncestorNode());
+            result = toElement(result->deprecatedShadowAncestorNode());
 
         if (!shouldUseRootEditableElement || !result->isElementNode())
             return result;
index e673b1a..271c334 100644 (file)
@@ -313,7 +313,7 @@ void InPageSearchManager::scopeStringMatches(const String& text, bool reset, boo
         if (resultRange->collapsed(ec)) {
             if (!resultRange->startContainer()->isInShadowTree())
                 break;
-            searchRange->setStartAfter(resultRange->startContainer()->shadowAncestorNode(), ec);
+            searchRange->setStartAfter(resultRange->startContainer()->deprecatedShadowAncestorNode(), ec);
             searchRange->setEnd(originalEndContainer, originalEndOffset, ec);
             continue;
         }
index 035982a..a23609b 100644 (file)
@@ -1,3 +1,16 @@
+2013-01-23  Shinya Kawanaka  <shinyak@chromium.org>
+
+        shadowAncestorNode() should be renamed to deprecatedShadowAncestorNode()
+        https://bugs.webkit.org/show_bug.cgi?id=107624
+
+        Reviewed by Dimitri Glazkov.
+
+        Since Node::shadowAncestorNode() is deprecated, we would like to rename it to prevent from further use.
+
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::scopeStringMatches):
+        (WebKit::WebFrameImpl::setFindEndstateFocusAndSelection):
+
 2013-01-22  Pavel Feldman  <pfeldman@chromium.org>
 
         Web Inspector: only allow evaluateForTestInFrontend for front-ends under test.
index 6cb1926..88ed3b6 100644 (file)
@@ -1682,7 +1682,7 @@ void WebFrameImpl::scopeStringMatches(int identifier, const WebString& searchTex
                 break;
 
             searchRange->setStartAfter(
-                resultRange->startContainer()->shadowAncestorNode(), ec);
+                resultRange->startContainer()->deprecatedShadowAncestorNode(), ec);
             searchRange->setEnd(originalEndContainer, originalEndOffset, ec);
             continue;
         }
@@ -2336,7 +2336,7 @@ void WebFrameImpl::setFindEndstateFocusAndSelection()
         // example, focus links if we have found text within the link.
         Node* node = m_activeMatch->firstNode();
         if (node && node->isInShadowTree()) {
-            Node* host = node->shadowAncestorNode();
+            Node* host = node->deprecatedShadowAncestorNode();
             if (host->hasTagName(HTMLNames::inputTag) || host->hasTagName(HTMLNames::textareaTag))
                 node = host;
         }
index c3de8f8..973eb80 100644 (file)
@@ -1,3 +1,16 @@
+2013-01-23  Shinya Kawanaka  <shinyak@chromium.org>
+
+        shadowAncestorNode() should be renamed to deprecatedShadowAncestorNode()
+        https://bugs.webkit.org/show_bug.cgi?id=107624
+
+        Reviewed by Dimitri Glazkov.
+
+        Since Node::shadowAncestorNode() is deprecated, we would like to rename it to prevent from further use.
+
+        * WebCoreSupport/QWebPageAdapter.cpp:
+        (QWebPageAdapter::inputMethodEvent):
+        (QWebPageAdapter::inputMethodQuery):
+
 2013-01-22  Anders Carlsson  <andersca@apple.com>
 
         Use a platforom strategy for local storage
index 63f442a..c0390bf 100644 (file)
@@ -647,7 +647,7 @@ void QWebPageAdapter::inputMethodEvent(QInputMethodEvent *ev)
 
     Node* node = 0;
     if (frame->selection()->rootEditableElement())
-        node = frame->selection()->rootEditableElement()->shadowAncestorNode();
+        node = frame->selection()->rootEditableElement()->deprecatedShadowAncestorNode();
 
     Vector<CompositionUnderline> underlines;
     bool hasSelection = false;
@@ -727,7 +727,7 @@ QVariant QWebPageAdapter::inputMethodQuery(Qt::InputMethodQuery property) const
     RenderTextControl* renderTextControl = 0;
 
     if (frame->selection()->rootEditableElement())
-        renderer = frame->selection()->rootEditableElement()->shadowAncestorNode()->renderer();
+        renderer = frame->selection()->rootEditableElement()->deprecatedShadowAncestorNode()->renderer();
 
     if (renderer && renderer->isTextControl())
         renderTextControl = toRenderTextControl(renderer);