| Index: sky/engine/core/dom/Node.cpp
|
| diff --git a/sky/engine/core/dom/Node.cpp b/sky/engine/core/dom/Node.cpp
|
| index ff75c2de139219cda67a0027696cecb83a8b8f9b..2944c93a46fd6c2008664efc8d1bb60a5c60f75f 100644
|
| --- a/sky/engine/core/dom/Node.cpp
|
| +++ b/sky/engine/core/dom/Node.cpp
|
| @@ -906,22 +906,13 @@ ContainerNode* Node::ownerScope() const
|
| return 0;
|
| }
|
|
|
| -static void appendTextContent(const Node* node, bool convertBRsToNewlines, StringBuilder& content)
|
| -{
|
| - if (node->nodeType() == Node::TEXT_NODE) {
|
| - content.append(toCharacterData(node)->data());
|
| - return;
|
| - }
|
| -
|
| - for (Node* child = toContainerNode(node)->firstChild(); child; child = child->nextSibling()) {
|
| - appendTextContent(child, convertBRsToNewlines, content);
|
| - }
|
| -}
|
| -
|
| -String Node::textContent(bool convertBRsToNewlines) const
|
| +String Node::textContent() const
|
| {
|
| StringBuilder content;
|
| - appendTextContent(this, convertBRsToNewlines, content);
|
| + for (const Node* node = this; node; node = NodeTraversal::next(*node, this)) {
|
| + if (node->isTextNode())
|
| + content.append(toText(node)->data());
|
| + }
|
| return content.toString();
|
| }
|
|
|
|
|