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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 #include "platform/Partitions.h" | 89 #include "platform/Partitions.h" |
90 #include "platform/TraceEvent.h" | 90 #include "platform/TraceEvent.h" |
91 #include "platform/TracedValue.h" | 91 #include "platform/TracedValue.h" |
92 #include "wtf/HashSet.h" | 92 #include "wtf/HashSet.h" |
93 #include "wtf/PassOwnPtr.h" | 93 #include "wtf/PassOwnPtr.h" |
94 #include "wtf/RefCountedLeakCounter.h" | 94 #include "wtf/RefCountedLeakCounter.h" |
95 #include "wtf/Vector.h" | 95 #include "wtf/Vector.h" |
96 #include "wtf/text/CString.h" | 96 #include "wtf/text/CString.h" |
97 #include "wtf/text/StringBuilder.h" | 97 #include "wtf/text/StringBuilder.h" |
98 | 98 |
| 99 using namespace std; |
| 100 |
99 namespace WebCore { | 101 namespace WebCore { |
100 | 102 |
101 using namespace HTMLNames; | 103 using namespace HTMLNames; |
102 | 104 |
103 #if !ENABLE(OILPAN) | 105 #if !ENABLE(OILPAN) |
104 void* Node::operator new(size_t size) | 106 void* Node::operator new(size_t size) |
105 { | 107 { |
106 ASSERT(isMainThread()); | 108 ASSERT(isMainThread()); |
107 return partitionAlloc(Partitions::getObjectModelPartition(), size); | 109 return partitionAlloc(Partitions::getObjectModelPartition(), size); |
108 } | 110 } |
(...skipping 1504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1613 | 1615 |
1614 // If the two elements don't have a common root, they're not in the same tre
e. | 1616 // If the two elements don't have a common root, they're not in the same tre
e. |
1615 if (chain1[index1 - 1] != chain2[index2 - 1]) { | 1617 if (chain1[index1 - 1] != chain2[index2 - 1]) { |
1616 unsigned short direction = (this > otherNode) ? DOCUMENT_POSITION_PRECED
ING : DOCUMENT_POSITION_FOLLOWING; | 1618 unsigned short direction = (this > otherNode) ? DOCUMENT_POSITION_PRECED
ING : DOCUMENT_POSITION_FOLLOWING; |
1617 return DOCUMENT_POSITION_DISCONNECTED | DOCUMENT_POSITION_IMPLEMENTATION
_SPECIFIC | direction; | 1619 return DOCUMENT_POSITION_DISCONNECTED | DOCUMENT_POSITION_IMPLEMENTATION
_SPECIFIC | direction; |
1618 } | 1620 } |
1619 | 1621 |
1620 unsigned connection = start1->treeScope() != start2->treeScope() ? DOCUMENT_
POSITION_DISCONNECTED | DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC : 0; | 1622 unsigned connection = start1->treeScope() != start2->treeScope() ? DOCUMENT_
POSITION_DISCONNECTED | DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC : 0; |
1621 | 1623 |
1622 // Walk the two chains backwards and look for the first difference. | 1624 // Walk the two chains backwards and look for the first difference. |
1623 for (unsigned i = std::min(index1, index2); i; --i) { | 1625 for (unsigned i = min(index1, index2); i; --i) { |
1624 const Node* child1 = chain1[--index1]; | 1626 const Node* child1 = chain1[--index1]; |
1625 const Node* child2 = chain2[--index2]; | 1627 const Node* child2 = chain2[--index2]; |
1626 if (child1 != child2) { | 1628 if (child1 != child2) { |
1627 // If one of the children is an attribute, it wins. | 1629 // If one of the children is an attribute, it wins. |
1628 if (child1->nodeType() == ATTRIBUTE_NODE) | 1630 if (child1->nodeType() == ATTRIBUTE_NODE) |
1629 return DOCUMENT_POSITION_FOLLOWING | connection; | 1631 return DOCUMENT_POSITION_FOLLOWING | connection; |
1630 if (child2->nodeType() == ATTRIBUTE_NODE) | 1632 if (child2->nodeType() == ATTRIBUTE_NODE) |
1631 return DOCUMENT_POSITION_PRECEDING | connection; | 1633 return DOCUMENT_POSITION_PRECEDING | connection; |
1632 | 1634 |
1633 // If one of the children is a shadow root, | 1635 // If one of the children is a shadow root, |
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2594 node->showTreeForThis(); | 2596 node->showTreeForThis(); |
2595 } | 2597 } |
2596 | 2598 |
2597 void showNodePath(const WebCore::Node* node) | 2599 void showNodePath(const WebCore::Node* node) |
2598 { | 2600 { |
2599 if (node) | 2601 if (node) |
2600 node->showNodePathForThis(); | 2602 node->showNodePathForThis(); |
2601 } | 2603 } |
2602 | 2604 |
2603 #endif | 2605 #endif |
OLD | NEW |