Index: Source/core/dom/DOMImplementation.cpp |
diff --git a/Source/core/dom/DOMImplementation.cpp b/Source/core/dom/DOMImplementation.cpp |
index 3b49baf78eaeb1f4d65c970054503a8665542a2d..8d766b7baaad357172280e8a564818440e43ea0d 100644 |
--- a/Source/core/dom/DOMImplementation.cpp |
+++ b/Source/core/dom/DOMImplementation.cpp |
@@ -36,12 +36,15 @@ |
#include "core/dom/DocumentType.h" |
#include "core/dom/Element.h" |
#include "core/dom/ExceptionCode.h" |
+#include "core/dom/Text.h" |
#include "core/dom/XMLDocument.h" |
#include "core/dom/custom/CustomElementRegistrationContext.h" |
#include "core/frame/LocalFrame.h" |
#include "core/frame/UseCounter.h" |
#include "core/html/HTMLDocument.h" |
+#include "core/html/HTMLHeadElement.h" |
#include "core/html/HTMLMediaElement.h" |
+#include "core/html/HTMLTitleElement.h" |
#include "core/html/HTMLViewSourceDocument.h" |
#include "core/html/ImageDocument.h" |
#include "core/html/MediaDocument.h" |
@@ -324,9 +327,14 @@ PassRefPtrWillBeRawPtr<HTMLDocument> DOMImplementation::createHTMLDocument(const |
.withRegistrationContext(document().registrationContext()); |
RefPtrWillBeRawPtr<HTMLDocument> d = HTMLDocument::create(init); |
d->open(); |
- d->write("<!doctype html><html><body></body></html>"); |
- if (!title.isNull()) |
- d->setTitle(title); |
+ d->write("<!doctype html><html><head></head><body></body></html>"); |
+ if (!title.isNull()) { |
+ HTMLHeadElement* headElement = d->head(); |
+ ASSERT(headElement); |
+ RefPtrWillBeRawPtr<HTMLTitleElement> titleElement = HTMLTitleElement::create(*d); |
+ headElement->appendChild(titleElement); |
+ titleElement->appendChild(d->createTextNode(title), IGNORE_EXCEPTION); |
tkent
2014/07/04 01:18:27
IGNORE_EXCEPTION -> ASSERT_NO_EXCEPTION
We should
kangil_
2014/07/04 02:06:55
I will make a patch on this. Thanks!
|
+ } |
d->setSecurityOrigin(document().securityOrigin()->isolatedCopy()); |
d->setContextFeatures(document().contextFeatures()); |
return d.release(); |