Commit ce442dfb authored by mario@webkit.org's avatar mario@webkit.org

[GTK] MHTML files not being loaded due to reported mime type not supported

https://bugs.webkit.org/show_bug.cgi?id=89978

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Make 'message/rfc822' a supported MIME type for MHTML files in GTK.

* loader/MainResourceLoader.cpp:
(WebCore::MainResourceLoader::continueAfterContentPolicy): Add
'message/rfc822' to the list of MIME types to be considered to
avoid them bypasing cross-domain security checks, only for GTK.
* loader/archive/ArchiveFactory.cpp:
(WebCore::archiveMIMETypes): Add 'message/rfc822' to the list of
supported MIME types when MHTML support is enabled in GTK.

LayoutTests:

Move expectations for MHTML tests out of chromium's specific directory.

* mhtml/multi_frames_binary-expected.txt: Renamed from LayoutTests/platform/chromium/mhtml/multi_frames_binary-expected.txt.
* mhtml/multi_frames_ie-expected.txt: Renamed from LayoutTests/platform/chromium/mhtml/multi_frames_ie-expected.txt.
* mhtml/multi_frames_unmht-expected.txt: Renamed from LayoutTests/platform/chromium/mhtml/multi_frames_unmht-expected.txt.
* mhtml/page_with_css_and_js_ie-expected.txt: Renamed from LayoutTests/platform/chromium/mhtml/page_with_css_and_js_ie-expected.txt.
* mhtml/page_with_css_and_js_unmht-expected.txt: Renamed from LayoutTests/platform/chromium/mhtml/page_with_css_and_js_unmht-expected.txt.
* mhtml/page_with_image_ie-expected.txt: Renamed from LayoutTests/platform/chromium/mhtml/page_with_image_ie-expected.txt.
* mhtml/page_with_image_unmht-expected.txt: Renamed from LayoutTests/platform/chromium/mhtml/page_with_image_unmht-expected.txt.
* mhtml/simple_page_ie-expected.txt: Renamed from LayoutTests/platform/chromium/mhtml/simple_page_ie-expected.txt.
* mhtml/simple_page_unmht-expected.txt: Renamed from LayoutTests/platform/chromium/mhtml/simple_page_unmht-expected.txt.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123088 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 976f4e68
2012-07-19 Mario Sanchez Prada <msanchez@igalia.com>
[GTK] MHTML files not being loaded due to reported mime type not supported
https://bugs.webkit.org/show_bug.cgi?id=89978
Reviewed by Carlos Garcia Campos.
Move expectations for MHTML tests out of chromium's specific directory.
* mhtml/multi_frames_binary-expected.txt: Renamed from LayoutTests/platform/chromium/mhtml/multi_frames_binary-expected.txt.
* mhtml/multi_frames_ie-expected.txt: Renamed from LayoutTests/platform/chromium/mhtml/multi_frames_ie-expected.txt.
* mhtml/multi_frames_unmht-expected.txt: Renamed from LayoutTests/platform/chromium/mhtml/multi_frames_unmht-expected.txt.
* mhtml/page_with_css_and_js_ie-expected.txt: Renamed from LayoutTests/platform/chromium/mhtml/page_with_css_and_js_ie-expected.txt.
* mhtml/page_with_css_and_js_unmht-expected.txt: Renamed from LayoutTests/platform/chromium/mhtml/page_with_css_and_js_unmht-expected.txt.
* mhtml/page_with_image_ie-expected.txt: Renamed from LayoutTests/platform/chromium/mhtml/page_with_image_ie-expected.txt.
* mhtml/page_with_image_unmht-expected.txt: Renamed from LayoutTests/platform/chromium/mhtml/page_with_image_unmht-expected.txt.
* mhtml/simple_page_ie-expected.txt: Renamed from LayoutTests/platform/chromium/mhtml/simple_page_ie-expected.txt.
* mhtml/simple_page_unmht-expected.txt: Renamed from LayoutTests/platform/chromium/mhtml/simple_page_unmht-expected.txt.
2012-07-19 Seokju Kwon <seokju.kwon@samsung.com>
[EFL] Inspector tests needs new baselines after r122952
2012-07-19 Mario Sanchez Prada <msanchez@igalia.com>
[GTK] MHTML files not being loaded due to reported mime type not supported
https://bugs.webkit.org/show_bug.cgi?id=89978
Reviewed by Carlos Garcia Campos.
Make 'message/rfc822' a supported MIME type for MHTML files in GTK.
* loader/MainResourceLoader.cpp:
(WebCore::MainResourceLoader::continueAfterContentPolicy): Add
'message/rfc822' to the list of MIME types to be considered to
avoid them bypasing cross-domain security checks, only for GTK.
* loader/archive/ArchiveFactory.cpp:
(WebCore::archiveMIMETypes): Add 'message/rfc822' to the list of
supported MIME types when MHTML support is enabled in GTK.
2012-07-19 Jan Keromnes <janx@linux.com>
Web Inspector: Factor ExtensionView into separate file
......@@ -266,7 +266,11 @@ void MainResourceLoader::continueAfterContentPolicy(PolicyAction contentPolicy,
switch (contentPolicy) {
case PolicyUse: {
// Prevent remote web archives from loading because they can claim to be from any domain and thus avoid cross-domain security checks (4120255).
bool isRemoteWebArchive = (equalIgnoringCase("application/x-webarchive", mimeType) || equalIgnoringCase("multipart/related", mimeType))
bool isRemoteWebArchive = (equalIgnoringCase("application/x-webarchive", mimeType)
#if PLATFORM(GTK)
|| equalIgnoringCase("message/rfc822", mimeType)
#endif
|| equalIgnoringCase("multipart/related", mimeType))
&& !m_substituteData.isValid() && !SchemeRegistry::shouldTreatURLSchemeAsLocal(url.protocol());
if (!frameLoader()->client()->canShowMIMEType(mimeType) || isRemoteWebArchive) {
frameLoader()->policyChecker()->cannotShowMIMEType(r);
......
......@@ -68,6 +68,9 @@ static ArchiveMIMETypesMap& archiveMIMETypes()
#endif
#if ENABLE(MHTML)
mimeTypes.set("multipart/related", archiveFactoryCreate<MHTMLArchive>);
#if PLATFORM(GTK)
mimeTypes.set("message/rfc822", archiveFactoryCreate<MHTMLArchive>);
#endif
#endif
initialized = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment