summaryrefslogtreecommitdiff
path: root/Source/WebCore/dom/TextNodeTraversal.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/dom/TextNodeTraversal.cpp
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/dom/TextNodeTraversal.cpp')
-rw-r--r--Source/WebCore/dom/TextNodeTraversal.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/Source/WebCore/dom/TextNodeTraversal.cpp b/Source/WebCore/dom/TextNodeTraversal.cpp
index 1f30afeca..112a28486 100644
--- a/Source/WebCore/dom/TextNodeTraversal.cpp
+++ b/Source/WebCore/dom/TextNodeTraversal.cpp
@@ -32,25 +32,25 @@
namespace WebCore {
namespace TextNodeTraversal {
-void appendContents(const ContainerNode* root, StringBuilder& result)
+void appendContents(const ContainerNode& root, StringBuilder& result)
{
- for (Text* text = TextNodeTraversal::firstWithin(root); text; text = TextNodeTraversal::next(text, root))
+ for (Text* text = TextNodeTraversal::firstWithin(root); text; text = TextNodeTraversal::next(*text, &root))
result.append(text->data());
}
-String contentsAsString(const ContainerNode* root)
+String contentsAsString(const ContainerNode& root)
{
StringBuilder result;
appendContents(root, result);
return result.toString();
}
-String contentsAsString(const Node* root)
+String contentsAsString(const Node& root)
{
- if (root->isTextNode())
- return toText(root)->data();
- if (root->isContainerNode())
- return contentsAsString(toContainerNode(root));
+ if (is<Text>(root))
+ return downcast<Text>(root).data();
+ if (is<ContainerNode>(root))
+ return contentsAsString(downcast<ContainerNode>(root));
return String();
}