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 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 if (node == this) | 512 if (node == this) |
513 break; | 513 break; |
514 | 514 |
515 if (node->nodeType() == TEXT_NODE) | 515 if (node->nodeType() == TEXT_NODE) |
516 node = toText(node)->mergeNextSiblingNodesIfPossible(); | 516 node = toText(node)->mergeNextSiblingNodesIfPossible(); |
517 else | 517 else |
518 node = NodeTraversal::nextPostOrder(*node); | 518 node = NodeTraversal::nextPostOrder(*node); |
519 } | 519 } |
520 } | 520 } |
521 | 521 |
522 const AtomicString& Node::localName() const | |
523 { | |
524 return nullAtom; | |
525 } | |
526 | |
527 const AtomicString& Node::namespaceURI() const | |
528 { | |
529 return nullAtom; | |
530 } | |
531 | |
532 bool Node::isContentEditable(UserSelectAllTreatment treatment) | 522 bool Node::isContentEditable(UserSelectAllTreatment treatment) |
533 { | 523 { |
534 document().updateLayoutTreeIfNeeded(); | 524 document().updateLayoutTreeIfNeeded(); |
535 return hasEditableStyle(Editable, treatment); | 525 return hasEditableStyle(Editable, treatment); |
536 } | 526 } |
537 | 527 |
538 bool Node::isContentRichlyEditable() | 528 bool Node::isContentRichlyEditable() |
539 { | 529 { |
540 document().updateLayoutTreeIfNeeded(); | 530 document().updateLayoutTreeIfNeeded(); |
541 return hasEditableStyle(RichlyEditable, UserSelectAllIsAlwaysNonEditable); | 531 return hasEditableStyle(RichlyEditable, UserSelectAllIsAlwaysNonEditable); |
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1093 if (!other) | 1083 if (!other) |
1094 return false; | 1084 return false; |
1095 | 1085 |
1096 NodeType nodeType = this->nodeType(); | 1086 NodeType nodeType = this->nodeType(); |
1097 if (nodeType != other->nodeType()) | 1087 if (nodeType != other->nodeType()) |
1098 return false; | 1088 return false; |
1099 | 1089 |
1100 if (nodeName() != other->nodeName()) | 1090 if (nodeName() != other->nodeName()) |
1101 return false; | 1091 return false; |
1102 | 1092 |
1103 if (localName() != other->localName()) | |
1104 return false; | |
1105 | |
1106 if (namespaceURI() != other->namespaceURI()) | |
1107 return false; | |
1108 | |
1109 if (nodeValue() != other->nodeValue()) | 1093 if (nodeValue() != other->nodeValue()) |
1110 return false; | 1094 return false; |
1111 | 1095 |
1112 if (isElementNode() && !toElement(this)->hasEquivalentAttributes(toElement(o
ther))) | 1096 if (isAttributeNode()) { |
1113 return false; | 1097 if (toAttr(this)->localName() != toAttr(other)->localName()) |
| 1098 return false; |
| 1099 |
| 1100 if (toAttr(this)->namespaceURI() != toAttr(other)->namespaceURI()) |
| 1101 return false; |
| 1102 } else if (isElementNode()) { |
| 1103 if (toElement(this)->localName() != toElement(other)->localName()) |
| 1104 return false; |
| 1105 |
| 1106 if (toElement(this)->namespaceURI() != toElement(other)->namespaceURI()) |
| 1107 return false; |
| 1108 |
| 1109 if (!toElement(this)->hasEquivalentAttributes(toElement(other))) |
| 1110 return false; |
| 1111 } |
1114 | 1112 |
1115 Node* child = firstChild(); | 1113 Node* child = firstChild(); |
1116 Node* otherChild = other->firstChild(); | 1114 Node* otherChild = other->firstChild(); |
1117 | 1115 |
1118 while (child) { | 1116 while (child) { |
1119 if (!child->isEqualNode(otherChild)) | 1117 if (!child->isEqualNode(otherChild)) |
1120 return false; | 1118 return false; |
1121 | 1119 |
1122 child = child->nextSibling(); | 1120 child = child->nextSibling(); |
1123 otherChild = otherChild->nextSibling(); | 1121 otherChild = otherChild->nextSibling(); |
(...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2391 | 2389 |
2392 void showNodePath(const blink::Node* node) | 2390 void showNodePath(const blink::Node* node) |
2393 { | 2391 { |
2394 if (node) | 2392 if (node) |
2395 node->showNodePathForThis(); | 2393 node->showNodePathForThis(); |
2396 else | 2394 else |
2397 fprintf(stderr, "Cannot showNodePath for (nil)\n"); | 2395 fprintf(stderr, "Cannot showNodePath for (nil)\n"); |
2398 } | 2396 } |
2399 | 2397 |
2400 #endif | 2398 #endif |
OLD | NEW |