Index: Source/core/loader/cache/CachedDocument.cpp |
diff --git a/Source/core/loader/cache/CachedDocument.cpp b/Source/core/loader/cache/CachedDocument.cpp |
index ea724499c9fb54d5ba10864010752746875150b3..a34e225761acb88a37b655c1230edd05fd1cace2 100644 |
--- a/Source/core/loader/cache/CachedDocument.cpp |
+++ b/Source/core/loader/cache/CachedDocument.cpp |
@@ -24,6 +24,7 @@ |
#include "core/loader/cache/CachedDocument.h" |
+#include "core/html/HTMLDocument.h" |
#include "core/loader/cache/CachedResourceClient.h" |
#include "core/loader/cache/CachedResourceHandle.h" |
#include "core/platform/SharedBuffer.h" |
@@ -34,10 +35,17 @@ namespace WebCore { |
CachedDocument::CachedDocument(const ResourceRequest& request, Type type) |
: CachedResource(request, type) |
- , m_decoder(TextResourceDecoder::create("application/xml")) |
{ |
- // FIXME: We'll support more types to support HTMLImports. |
- ASSERT(type == SVGDocumentResource); |
+ switch (type) { |
+ case SVGDocumentResource: |
+ m_decoder = TextResourceDecoder::create("application/xml"); |
+ break; |
+ case HTMLDocumentResource: |
+ m_decoder = TextResourceDecoder::create("text/html"); |
+ break; |
+ default: |
+ ASSERT_NOT_REACHED(); |
+ } |
} |
CachedDocument::~CachedDocument() |
@@ -72,6 +80,8 @@ PassRefPtr<Document> CachedDocument::createDocument(const KURL& url) |
switch (type()) { |
case SVGDocumentResource: |
return SVGDocument::create(0, url); |
+ case HTMLDocumentResource: |
+ return HTMLDocument::create(0, url); |
default: |
// FIXME: We'll add more types to support HTMLImports. |
ASSERT_NOT_REACHED(); |