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

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

Issue 919473004: Make DOMParser create documents with a context document set (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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
Index: Source/core/xml/DOMParser.cpp
diff --git a/Source/core/xml/DOMParser.cpp b/Source/core/xml/DOMParser.cpp
index a60572e2e5cfeace4f48d641b94b827eae2924dc..4e68739295b28a587ef20a905e48d303e134c628 100644
--- a/Source/core/xml/DOMParser.cpp
+++ b/Source/core/xml/DOMParser.cpp
@@ -27,9 +27,14 @@ namespace blink {
PassRefPtrWillBeRawPtr<Document> DOMParser::parseFromString(const String& str, const String& type)
{
- RefPtrWillBeRawPtr<Document> doc = DOMImplementation::createDocument(type, 0, KURL(), false);
+ RefPtrWillBeRawPtr<Document> doc = DOMImplementation::createDocument(type, DocumentInit(KURL(), nullptr, m_contextDocument), false);
haraken 2015/02/11 08:23:11 What happens if m_contextDocument is already clear
Jens Widell 2015/02/11 08:29:07 Same thing as before, i.e. we crash if we parse a
doc->setContent(str);
return doc.release();
}
+DOMParser::DOMParser(Document& document)
+ : m_contextDocument(document.contextDocument())
+{
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698