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

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

Issue 2509813002: DOMParser: handle use from contexts without an "active document". (Closed)
Patch Set: Created 4 years, 1 month 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 | « third_party/WebKit/LayoutTests/fast/dom/DOMParser-detached-no-crash.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/xml/DOMParser.cpp
diff --git a/third_party/WebKit/Source/core/xml/DOMParser.cpp b/third_party/WebKit/Source/core/xml/DOMParser.cpp
index 9bec141914aff5f4600b4304165c26f4243d8bb0..98a2a5bef7479c35e59885685210654957238ccc 100644
--- a/third_party/WebKit/Source/core/xml/DOMParser.cpp
+++ b/third_party/WebKit/Source/core/xml/DOMParser.cpp
@@ -28,7 +28,8 @@ Document* DOMParser::parseFromString(const String& str, const String& type) {
Document* doc = DOMImplementation::createDocument(
type, DocumentInit(KURL(), nullptr, m_contextDocument), false);
doc->setContent(str);
- doc->setSecurityOrigin(m_contextDocument->getSecurityOrigin());
+ if (m_contextDocument)
+ doc->setSecurityOrigin(m_contextDocument->getSecurityOrigin());
return doc;
}
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/dom/DOMParser-detached-no-crash.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698