 Chromium Code Reviews
 Chromium Code Reviews Issue 919473004:
  Make DOMParser create documents with a context document set  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master
    
  
    Issue 919473004:
  Make DOMParser create documents with a context document set  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master| 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 |