OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 } | 876 } |
877 | 877 |
878 void Node::clearNodeLists() | 878 void Node::clearNodeLists() |
879 { | 879 { |
880 rareData()->clearNodeLists(); | 880 rareData()->clearNodeLists(); |
881 } | 881 } |
882 | 882 |
883 bool Node::isDescendantOf(const Node *other) const | 883 bool Node::isDescendantOf(const Node *other) const |
884 { | 884 { |
885 // Return true if other is an ancestor of this, otherwise false | 885 // Return true if other is an ancestor of this, otherwise false |
886 if (!other || !other->hasChildNodes() || inDocument() != other->inDocument()
) | 886 if (!other || !other->hasChildren() || inDocument() != other->inDocument()) |
887 return false; | 887 return false; |
888 if (other->treeScope() != treeScope()) | 888 if (other->treeScope() != treeScope()) |
889 return false; | 889 return false; |
890 if (other->isTreeScope()) | 890 if (other->isTreeScope()) |
891 return !isTreeScope(); | 891 return !isTreeScope(); |
892 for (const ContainerNode* n = parentNode(); n; n = n->parentNode()) { | 892 for (const ContainerNode* n = parentNode(); n; n = n->parentNode()) { |
893 if (n == other) | 893 if (n == other) |
894 return true; | 894 return true; |
895 } | 895 } |
896 return false; | 896 return false; |
(...skipping 13 matching lines...) Expand all Loading... |
910 | 910 |
911 if (this == node) | 911 if (this == node) |
912 return true; | 912 return true; |
913 | 913 |
914 if (document() != node->document()) | 914 if (document() != node->document()) |
915 return false; | 915 return false; |
916 | 916 |
917 if (inDocument() != node->inDocument()) | 917 if (inDocument() != node->inDocument()) |
918 return false; | 918 return false; |
919 | 919 |
920 bool hasChildren = isContainerNode() && toContainerNode(this)->hasChildNodes
(); | 920 bool hasChildren = isContainerNode() && toContainerNode(this)->hasChildren()
; |
921 bool hasShadow = isElementNode() && toElement(this)->shadow(); | 921 bool hasShadow = isElementNode() && toElement(this)->shadow(); |
922 if (!hasChildren && !hasShadow) | 922 if (!hasChildren && !hasShadow) |
923 return false; | 923 return false; |
924 | 924 |
925 for (; node; node = node->shadowHost()) { | 925 for (; node; node = node->shadowHost()) { |
926 if (treeScope() == node->treeScope()) | 926 if (treeScope() == node->treeScope()) |
927 return contains(node); | 927 return contains(node); |
928 } | 928 } |
929 | 929 |
930 return false; | 930 return false; |
(...skipping 1623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2554 node->showTreeForThis(); | 2554 node->showTreeForThis(); |
2555 } | 2555 } |
2556 | 2556 |
2557 void showNodePath(const WebCore::Node* node) | 2557 void showNodePath(const WebCore::Node* node) |
2558 { | 2558 { |
2559 if (node) | 2559 if (node) |
2560 node->showNodePathForThis(); | 2560 node->showNodePathForThis(); |
2561 } | 2561 } |
2562 | 2562 |
2563 #endif | 2563 #endif |
OLD | NEW |