⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 136198 in webkit


Ignore:
Timestamp:
Nov 29, 2012, 7:26:09 PM (14 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by Elliott Sprehn <​esprehn@chromium.org> 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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r136197 r136198  
     12012-11-29  Elliott Sprehn  <esprehn@chromium.org>
     2
     3        Node::isDescendantOf contains logic that duplicates isDocumentNode
     4        https://bugs.webkit.org/show_bug.cgi?id=103698
     5
     6        Reviewed by Hajime Morita.
     7
     8        Instead of checking for documents with node->document() == node just
     9        use node->isDocumentNode().
     10
     11        * dom/Node.cpp:
     12        (WebCore::Node::isDescendantOf):
     13
    1142012-11-29  Alexey Proskuryakov  <ap@apple.com>
    215
  • trunk/Source/WebCore/dom/Node.cpp

    r136087 r136198  
    11581158    if (!other || !other->hasChildNodes() || inDocument() != other->inDocument())
    11591159        return false;
    1160     if (other == other->document())
    1161         return document() == other && this != document() && inDocument();
     1160    if (other->isDocumentNode())
     1161        return document() == other && !isDocumentNode() && inDocument();
    11621162    for (const ContainerNode* n = parentNode(); n; n = n->parentNode()) {
    11631163        if (n == other)
Note: See TracChangeset for help on using the changeset viewer.