Index: Source/core/html/MediaDocument.cpp |
diff --git a/Source/core/html/MediaDocument.cpp b/Source/core/html/MediaDocument.cpp |
index f913bf7f376091205aeb5a56f1ab7c476385c43f..874a45e7779f561e1ca012eaf47fa8ae4116a0fc 100644 |
--- a/Source/core/html/MediaDocument.cpp |
+++ b/Source/core/html/MediaDocument.cpp |
@@ -72,25 +72,26 @@ private: |
void MediaDocumentParser::createDocumentStructure() |
{ |
- RefPtr<HTMLHtmlElement> rootElement = HTMLHtmlElement::create(document()); |
+ ASSERT(document()); |
+ RefPtr<HTMLHtmlElement> rootElement = HTMLHtmlElement::create(*document()); |
rootElement->insertedByParser(); |
document()->appendChild(rootElement); |
if (document()->frame()) |
document()->frame()->loader()->dispatchDocumentElementAvailable(); |
- RefPtr<HTMLHeadElement> head = HTMLHeadElement::create(document()); |
- RefPtr<HTMLMetaElement> meta = HTMLMetaElement::create(document()); |
+ RefPtr<HTMLHeadElement> head = HTMLHeadElement::create(*document()); |
+ RefPtr<HTMLMetaElement> meta = HTMLMetaElement::create(*document()); |
meta->setAttribute(nameAttr, "viewport"); |
meta->setAttribute(contentAttr, "width=device-width"); |
head->appendChild(meta.release()); |
- RefPtr<HTMLVideoElement> media = HTMLVideoElement::create(document()); |
+ RefPtr<HTMLVideoElement> media = HTMLVideoElement::create(*document()); |
media->setAttribute(controlsAttr, ""); |
media->setAttribute(autoplayAttr, ""); |
media->setAttribute(nameAttr, "media"); |
- RefPtr<HTMLSourceElement> source = HTMLSourceElement::create(document()); |
+ RefPtr<HTMLSourceElement> source = HTMLSourceElement::create(*document()); |
source->setSrc(document()->url()); |
if (DocumentLoader* loader = document()->loader()) |
@@ -98,7 +99,7 @@ void MediaDocumentParser::createDocumentStructure() |
media->appendChild(source.release()); |
- RefPtr<HTMLBodyElement> body = HTMLBodyElement::create(document()); |
+ RefPtr<HTMLBodyElement> body = HTMLBodyElement::create(*document()); |
body->appendChild(media.release()); |
rootElement->appendChild(head.release()); |