| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005 Frerich Raabe <raabe@kde.org> | 2 * Copyright (C) 2005 Frerich Raabe <raabe@kde.org> |
| 3 * Copyright (C) 2006, 2009 Apple Inc. | 3 * Copyright (C) 2006, 2009 Apple Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 case Node::COMMENT_NODE: | 47 case Node::COMMENT_NODE: |
| 48 case Node::TEXT_NODE: | 48 case Node::TEXT_NODE: |
| 49 case Node::CDATA_SECTION_NODE: | 49 case Node::CDATA_SECTION_NODE: |
| 50 case Node::XPATH_NAMESPACE_NODE: | 50 case Node::XPATH_NAMESPACE_NODE: |
| 51 return node->nodeValue(); | 51 return node->nodeValue(); |
| 52 default: | 52 default: |
| 53 if (isRootDomNode(node) || node->nodeType() == Node::ELEMENT_NODE) { | 53 if (isRootDomNode(node) || node->nodeType() == Node::ELEMENT_NODE) { |
| 54 StringBuilder result; | 54 StringBuilder result; |
| 55 result.reserveCapacity(1024); | 55 result.reserveCapacity(1024); |
| 56 | 56 |
| 57 for (Node* n = node->firstChild(); n; n = NodeTraversal::next(n,
node)) { | 57 for (Node* n = node->firstChild(); n; n = NodeTraversal::next(*n
, node)) { |
| 58 if (n->isTextNode()) { | 58 if (n->isTextNode()) { |
| 59 const String& nodeValue = n->nodeValue(); | 59 const String& nodeValue = n->nodeValue(); |
| 60 result.append(nodeValue); | 60 result.append(nodeValue); |
| 61 } | 61 } |
| 62 } | 62 } |
| 63 | 63 |
| 64 return result.toString(); | 64 return result.toString(); |
| 65 } | 65 } |
| 66 } | 66 } |
| 67 | 67 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 88 return false; | 88 return false; |
| 89 case Node::TEXT_NODE: | 89 case Node::TEXT_NODE: |
| 90 return !(node->parentNode() && node->parentNode()->isAttributeNode()
); | 90 return !(node->parentNode() && node->parentNode()->isAttributeNode()
); |
| 91 } | 91 } |
| 92 ASSERT_NOT_REACHED(); | 92 ASSERT_NOT_REACHED(); |
| 93 return false; | 93 return false; |
| 94 } | 94 } |
| 95 | 95 |
| 96 } | 96 } |
| 97 } | 97 } |
| OLD | NEW |