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