Title: [136198] trunk/Source/WebCore
Revision
136198
Author
[email protected]
Date
2012-11-29 19:26:09 -0800 (Thu, 29 Nov 2012)

Log Message

Node::isDescendantOf contains logic that duplicates isDocumentNode
https://bugs.webkit.org/show_bug.cgi?id=103698

Patch by Elliott Sprehn <[email protected]> on 2012-11-29
Reviewed by Hajime Morita.

Instead of checking for documents with node->document() == node just
use node->isDocumentNode().

* dom/Node.cpp:
(WebCore::Node::isDescendantOf):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (136197 => 136198)


--- trunk/Source/WebCore/ChangeLog	2012-11-30 02:32:51 UTC (rev 136197)
+++ trunk/Source/WebCore/ChangeLog	2012-11-30 03:26:09 UTC (rev 136198)
@@ -1,3 +1,16 @@
+2012-11-29  Elliott Sprehn  <[email protected]>
+
+        Node::isDescendantOf contains logic that duplicates isDocumentNode
+        https://bugs.webkit.org/show_bug.cgi?id=103698
+
+        Reviewed by Hajime Morita.
+
+        Instead of checking for documents with node->document() == node just
+        use node->isDocumentNode().
+
+        * dom/Node.cpp:
+        (WebCore::Node::isDescendantOf):
+
 2012-11-29  Alexey Proskuryakov  <[email protected]>
 
         [WK2] Forward cookie jar calls to NetworkProcess

Modified: trunk/Source/WebCore/dom/Node.cpp (136197 => 136198)


--- trunk/Source/WebCore/dom/Node.cpp	2012-11-30 02:32:51 UTC (rev 136197)
+++ trunk/Source/WebCore/dom/Node.cpp	2012-11-30 03:26:09 UTC (rev 136198)
@@ -1157,8 +1157,8 @@
     // Return true if other is an ancestor of this, otherwise false
     if (!other || !other->hasChildNodes() || inDocument() != other->inDocument())
         return false;
-    if (other == other->document())
-        return document() == other && this != document() && inDocument();
+    if (other->isDocumentNode())
+        return document() == other && !isDocumentNode() && inDocument();
     for (const ContainerNode* n = parentNode(); n; n = n->parentNode()) {
         if (n == other)
             return true;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to