| 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 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1424 ASSERT_NOT_REACHED(); | 1424 ASSERT_NOT_REACHED(); |
| 1425 } | 1425 } |
| 1426 | 1426 |
| 1427 bool Node::offsetInCharacters() const | 1427 bool Node::offsetInCharacters() const |
| 1428 { | 1428 { |
| 1429 return isCharacterDataNode(); | 1429 return isCharacterDataNode(); |
| 1430 } | 1430 } |
| 1431 | 1431 |
| 1432 unsigned short Node::compareDocumentPosition(const Node* otherNode, ShadowTreesT
reatment treatment) const | 1432 unsigned short Node::compareDocumentPosition(const Node* otherNode, ShadowTreesT
reatment treatment) const |
| 1433 { | 1433 { |
| 1434 // It is not clear what should be done if |otherNode| is nullptr. | |
| 1435 if (!otherNode) | |
| 1436 return DOCUMENT_POSITION_DISCONNECTED; | |
| 1437 | |
| 1438 if (otherNode == this) | 1434 if (otherNode == this) |
| 1439 return DOCUMENT_POSITION_EQUIVALENT; | 1435 return DOCUMENT_POSITION_EQUIVALENT; |
| 1440 | 1436 |
| 1441 const Attr* attr1 = nodeType() == ATTRIBUTE_NODE ? toAttr(this) : nullptr; | 1437 const Attr* attr1 = nodeType() == ATTRIBUTE_NODE ? toAttr(this) : nullptr; |
| 1442 const Attr* attr2 = otherNode->nodeType() == ATTRIBUTE_NODE ? toAttr(otherNo
de) : nullptr; | 1438 const Attr* attr2 = otherNode->nodeType() == ATTRIBUTE_NODE ? toAttr(otherNo
de) : nullptr; |
| 1443 | 1439 |
| 1444 const Node* start1 = attr1 ? attr1->ownerElement() : this; | 1440 const Node* start1 = attr1 ? attr1->ownerElement() : this; |
| 1445 const Node* start2 = attr2 ? attr2->ownerElement() : otherNode; | 1441 const Node* start2 = attr2 ? attr2->ownerElement() : otherNode; |
| 1446 | 1442 |
| 1447 // If either of start1 or start2 is null, then we are disconnected, since on
e of the nodes is | 1443 // If either of start1 or start2 is null, then we are disconnected, since on
e of the nodes is |
| (...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2456 node->showTreeForThis(); | 2452 node->showTreeForThis(); |
| 2457 } | 2453 } |
| 2458 | 2454 |
| 2459 void showNodePath(const blink::Node* node) | 2455 void showNodePath(const blink::Node* node) |
| 2460 { | 2456 { |
| 2461 if (node) | 2457 if (node) |
| 2462 node->showNodePathForThis(); | 2458 node->showNodePathForThis(); |
| 2463 } | 2459 } |
| 2464 | 2460 |
| 2465 #endif | 2461 #endif |
| OLD | NEW |