Index: Source/core/html/imports/HTMLImportLoader.cpp |
diff --git a/Source/core/html/imports/HTMLImportLoader.cpp b/Source/core/html/imports/HTMLImportLoader.cpp |
index 4349ebb33cc5a84fb826ba364aebb4a20325c03b..9ef09bead4296cd5dde7a3fea6e098d78014c7ff 100644 |
--- a/Source/core/html/imports/HTMLImportLoader.cpp |
+++ b/Source/core/html/imports/HTMLImportLoader.cpp |
@@ -94,7 +94,11 @@ HTMLImportLoader::State HTMLImportLoader::startWritingAndParsing(const ResourceR |
.withRegistrationContext(m_import->master()->registrationContext()); |
m_importedDocument = HTMLDocument::create(init); |
m_importedDocument->initContentSecurityPolicy(ContentSecurityPolicyResponseHeaders(response)); |
- m_writer = DocumentWriter::create(m_importedDocument.get(), response.mimeType(), response.textEncodingName()); |
+ AtomicString textEncoding = response.textEncodingName(); |
+ // FIXME: Should we test for more than emptiness here? For example, we could require that the encoding be some valid encoding. |
+ if (textEncoding.isEmpty()) |
+ textEncoding = "UTF-8"; |
+ m_writer = DocumentWriter::create(m_importedDocument.get(), response.mimeType(), textEncoding); |
abarth-chromium
2014/02/24 22:30:27
e.g., just pass "UTF-8" unconditionally here
|
return StateLoading; |
} |