summaryrefslogtreecommitdiff
path: root/Source/WebCore/xml/XMLSerializer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/xml/XMLSerializer.cpp')
-rw-r--r--Source/WebCore/xml/XMLSerializer.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/Source/WebCore/xml/XMLSerializer.cpp b/Source/WebCore/xml/XMLSerializer.cpp
index dfc0f56c0..9a9f9a392 100644
--- a/Source/WebCore/xml/XMLSerializer.cpp
+++ b/Source/WebCore/xml/XMLSerializer.cpp
@@ -29,20 +29,11 @@ namespace WebCore {
String XMLSerializer::serializeToString(Node* node, ExceptionCode& ec)
{
- if (!node)
- return String();
-
- if (!node->document()) {
- // Due to the fact that DocumentType nodes are created by the DOMImplementation
- // and not the Document, it is possible for it to not have a Document associated
- // with it. It should be the only type of node where this is possible.
- ASSERT(node->nodeType() == Node::DOCUMENT_TYPE_NODE);
-
- ec = INVALID_ACCESS_ERR;
+ if (!node) {
+ ec = TypeError;
return String();
}
-
- return createMarkup(node, IncludeNode, 0, DoNotResolveURLs, 0, XMLFragmentSerialization);
+ return createMarkup(*node, IncludeNode, 0, DoNotResolveURLs, 0, XMLFragmentSerialization);
}
} // namespace WebCore