2011-01-11 Nicolas Dufresne <nicolas.dufresne@collabora.co.uk>

        Reviewed by Adam Barth.

        Use plug-in DB for extensions to MIME type convertion

        Plugins extension to MIME type conversion was not used in the
        frameLoader. This was causing some fallback to be use which as the side
        effect of loosing all the <OBJECT> parameters or <EMBED> attributes.
        This patch ensure that we try to convert the extension to MIME type
        using the plugin database beofre using this fallback.

        Attribute lost with Flash plugin without mime type set
        https://bugs.webkit.org/show_bug.cgi?id=50657

        * plugins/no-mime-with-valid-extension.html: Added.
        * plugins/no-mime-with-valid-extension-expected.txt: Added.
2011-01-11  Nicolas Dufresne  <nicolas.dufresne@collabora.co.uk>

        Reviewed by Adam Barth.

        Use plug-in DB for extensions to MIME type convertion

        Plugins extension to MIME type conversion was not used in the
        frameLoader. This was causing some fallback to be use which as the side
        effect of loosing all the <OBJECT> parameters or <EMBED> attributes.
        This patch ensure that we try to convert the extension to MIME type
        using the plugin database beofre using this fallback.

        Attribute lost with Flash plugin without mime type set
        https://bugs.webkit.org/show_bug.cgi?id=50657

        Test: plugins/no-mime-with-valid-extension.html

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::defaultObjectContentType): Use PluginDatabase for MIME

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75567 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 8369a241
2011-01-11 Nicolas Dufresne <nicolas.dufresne@collabora.co.uk>
Reviewed by Adam Barth.
Use plug-in DB for extensions to MIME type convertion
Plugins extension to MIME type conversion was not used in the
frameLoader. This was causing some fallback to be use which as the side
effect of loosing all the <OBJECT> parameters or <EMBED> attributes.
This patch ensure that we try to convert the extension to MIME type
using the plugin database beofre using this fallback.
Attribute lost with Flash plugin without mime type set
https://bugs.webkit.org/show_bug.cgi?id=50657
* plugins/no-mime-with-valid-extension.html: Added.
* plugins/no-mime-with-valid-extension-expected.txt: Added.
2011-01-11 Justin Schuh <jschuh@chromium.org>
Unreviewed, test expectations update.
......
CONSOLE MESSAGE: line 0: PLUGIN: src: resources/test.testnetscape
This test checks that bug 50568 is fixed. It runs logSrc test as found in the test plugin which prints the src attribute to stdout. If the bug is present, the logSrc attrbitute that triggers the test will be lost and nothing will be displayed on screen. Upon success, this test should display the src attribute.
<script>
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
}
</script>
<p>
This test checks that <a href="https://bugs.webkit.org/show_bug.cgi?id=50657">bug 50568</a>
is fixed. It runs logSrc test as found in the test plugin which prints the src attribute
to stdout. If the bug is present, the logSrc attrbitute that triggers the test will be lost
and nothing will be displayed on screen. Upon success, this test should display the src
attribute.
</p>
<!-- Embed tag with missing type="" parameter -->
<embed id="plugin" name="plugin" src="resources/test.testnetscape" logSrc="1">
<script>
if (window.layoutTestController)
layoutTestController.notifyDone();
</script>
2011-01-11 Nicolas Dufresne <nicolas.dufresne@collabora.co.uk>
Reviewed by Adam Barth.
Use plug-in DB for extensions to MIME type convertion
Plugins extension to MIME type conversion was not used in the
frameLoader. This was causing some fallback to be use which as the side
effect of loosing all the <OBJECT> parameters or <EMBED> attributes.
This patch ensure that we try to convert the extension to MIME type
using the plugin database beofre using this fallback.
Attribute lost with Flash plugin without mime type set
https://bugs.webkit.org/show_bug.cgi?id=50657
Test: plugins/no-mime-with-valid-extension.html
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::defaultObjectContentType): Use PluginDatabase for MIME
2011-01-11 James Simonsen <simonjam@chromium.org>
Reviewed by Eric Seidel.
......
......@@ -960,9 +960,16 @@ void FrameLoader::loadArchive(PassRefPtr<Archive> prpArchive)
ObjectContentType FrameLoader::defaultObjectContentType(const KURL& url, const String& mimeTypeIn)
{
String mimeType = mimeTypeIn;
String extension = url.path().substring(url.path().reverseFind('.') + 1);
// We don't use MIMETypeRegistry::getMIMETypeForPath() because it returns "application/octet-stream" upon failure
if (mimeType.isEmpty())
mimeType = MIMETypeRegistry::getMIMETypeForExtension(url.path().substring(url.path().reverseFind('.') + 1));
mimeType = MIMETypeRegistry::getMIMETypeForExtension(extension);
#if !PLATFORM(MAC) && !PLATFORM(CHROMIUM) && !PLATFORM(EFL) // Mac has no PluginDatabase, nor does Chromium or EFL
if (mimeType.isEmpty())
mimeType = PluginDatabase::installedPlugins()->MIMETypeForExtension(extension);
#endif
if (mimeType.isEmpty())
return ObjectContentFrame; // Go ahead and hope that we can display the content.
......
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