Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(739)

Unified Diff: Source/core/xml/XMLSerializer.cpp

Issue 23532055: XMLSerializer.serializeToString() should throw exception for invalid node value. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/dom/xmlserializer-serialize-to-string-exception-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/xml/XMLSerializer.cpp
diff --git a/Source/core/xml/XMLSerializer.cpp b/Source/core/xml/XMLSerializer.cpp
index 74be0eac04d0ad7be681906498fadc422cf5efa2..eb17e920b3afb86731b4fb9914cee6aafd3ef487 100644
--- a/Source/core/xml/XMLSerializer.cpp
+++ b/Source/core/xml/XMLSerializer.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2003, 2006 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig (sam@webkit.org)
+ * Copyright (C) 2013 Samsung Electronics. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -30,8 +31,10 @@ namespace WebCore {
String XMLSerializer::serializeToString(Node* node, ExceptionState& es)
{
- if (!node)
+ if (!node) {
+ es.throwDOMException(TypeError, "Invalid node value.");
return String();
+ }
return createMarkup(node);
}
« no previous file with comments | « LayoutTests/fast/dom/xmlserializer-serialize-to-string-exception-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698