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 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1114 | 1114 |
1115 bool Node::isEqualNode(Node* other) const | 1115 bool Node::isEqualNode(Node* other) const |
1116 { | 1116 { |
1117 if (!other) | 1117 if (!other) |
1118 return false; | 1118 return false; |
1119 | 1119 |
1120 NodeType nodeType = this->getNodeType(); | 1120 NodeType nodeType = this->getNodeType(); |
1121 if (nodeType != other->getNodeType()) | 1121 if (nodeType != other->getNodeType()) |
1122 return false; | 1122 return false; |
1123 | 1123 |
1124 if (nodeName() != other->nodeName()) | |
1125 return false; | |
1126 | |
1127 if (nodeValue() != other->nodeValue()) | 1124 if (nodeValue() != other->nodeValue()) |
1128 return false; | 1125 return false; |
1129 | 1126 |
1130 if (isAttributeNode()) { | 1127 if (isAttributeNode()) { |
1131 if (toAttr(this)->localName() != toAttr(other)->localName()) | 1128 if (toAttr(this)->localName() != toAttr(other)->localName()) |
1132 return false; | 1129 return false; |
1133 | 1130 |
1134 if (toAttr(this)->namespaceURI() != toAttr(other)->namespaceURI()) | 1131 if (toAttr(this)->namespaceURI() != toAttr(other)->namespaceURI()) |
1135 return false; | 1132 return false; |
1136 } else if (isElementNode()) { | 1133 } else if (isElementNode()) { |
1137 if (toElement(this)->localName() != toElement(other)->localName()) | 1134 if (toElement(this)->tagQName() != toElement(other)->tagQName()) |
1138 return false; | |
1139 | |
1140 if (toElement(this)->namespaceURI() != toElement(other)->namespaceURI()) | |
1141 return false; | 1135 return false; |
1142 | 1136 |
1143 if (!toElement(this)->hasEquivalentAttributes(toElement(other))) | 1137 if (!toElement(this)->hasEquivalentAttributes(toElement(other))) |
1144 return false; | 1138 return false; |
| 1139 } else if (nodeName() != other->nodeName()) { |
| 1140 return false; |
1145 } | 1141 } |
1146 | 1142 |
1147 Node* child = firstChild(); | 1143 Node* child = firstChild(); |
1148 Node* otherChild = other->firstChild(); | 1144 Node* otherChild = other->firstChild(); |
1149 | 1145 |
1150 while (child) { | 1146 while (child) { |
1151 if (!child->isEqualNode(otherChild)) | 1147 if (!child->isEqualNode(otherChild)) |
1152 return false; | 1148 return false; |
1153 | 1149 |
1154 child = child->nextSibling(); | 1150 child = child->nextSibling(); |
(...skipping 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2441 | 2437 |
2442 void showNodePath(const blink::Node* node) | 2438 void showNodePath(const blink::Node* node) |
2443 { | 2439 { |
2444 if (node) | 2440 if (node) |
2445 node->showNodePathForThis(); | 2441 node->showNodePathForThis(); |
2446 else | 2442 else |
2447 fprintf(stderr, "Cannot showNodePath for (nil)\n"); | 2443 fprintf(stderr, "Cannot showNodePath for (nil)\n"); |
2448 } | 2444 } |
2449 | 2445 |
2450 #endif | 2446 #endif |
OLD | NEW |