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 2540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2551 { | 2551 { |
2552 visitor->trace(m_parentOrShadowHostNode); | 2552 visitor->trace(m_parentOrShadowHostNode); |
2553 visitor->trace(m_previous); | 2553 visitor->trace(m_previous); |
2554 visitor->trace(m_next); | 2554 visitor->trace(m_next); |
2555 if (hasRareData()) | 2555 if (hasRareData()) |
2556 visitor->trace(rareData()); | 2556 visitor->trace(rareData()); |
2557 visitor->trace(m_treeScope); | 2557 visitor->trace(m_treeScope); |
2558 EventTarget::trace(visitor); | 2558 EventTarget::trace(visitor); |
2559 } | 2559 } |
2560 | 2560 |
| 2561 unsigned Node::lengthOfContents() const |
| 2562 { |
| 2563 // This switch statement must be consistent with that of Range::processConte
ntsBetweenOffsets. |
| 2564 switch (nodeType()) { |
| 2565 case Node::TEXT_NODE: |
| 2566 case Node::CDATA_SECTION_NODE: |
| 2567 case Node::COMMENT_NODE: |
| 2568 return toCharacterData(this)->length(); |
| 2569 case Node::PROCESSING_INSTRUCTION_NODE: |
| 2570 return toProcessingInstruction(this)->data().length(); |
| 2571 case Node::ELEMENT_NODE: |
| 2572 case Node::ATTRIBUTE_NODE: |
| 2573 case Node::DOCUMENT_NODE: |
| 2574 case Node::DOCUMENT_FRAGMENT_NODE: |
| 2575 return toContainerNode(this)->countChildren(); |
| 2576 case Node::DOCUMENT_TYPE_NODE: |
| 2577 return 0; |
| 2578 } |
| 2579 ASSERT_NOT_REACHED(); |
| 2580 return 0; |
| 2581 } |
| 2582 |
2561 } // namespace WebCore | 2583 } // namespace WebCore |
2562 | 2584 |
2563 #ifndef NDEBUG | 2585 #ifndef NDEBUG |
2564 | 2586 |
2565 void showNode(const WebCore::Node* node) | 2587 void showNode(const WebCore::Node* node) |
2566 { | 2588 { |
2567 if (node) | 2589 if (node) |
2568 node->showNode(""); | 2590 node->showNode(""); |
2569 } | 2591 } |
2570 | 2592 |
2571 void showTree(const WebCore::Node* node) | 2593 void showTree(const WebCore::Node* node) |
2572 { | 2594 { |
2573 if (node) | 2595 if (node) |
2574 node->showTreeForThis(); | 2596 node->showTreeForThis(); |
2575 } | 2597 } |
2576 | 2598 |
2577 void showNodePath(const WebCore::Node* node) | 2599 void showNodePath(const WebCore::Node* node) |
2578 { | 2600 { |
2579 if (node) | 2601 if (node) |
2580 node->showNodePathForThis(); | 2602 node->showNodePathForThis(); |
2581 } | 2603 } |
2582 | 2604 |
2583 #endif | 2605 #endif |
OLD | NEW |