[Webkit-unassigned] [Bug 15766] [GTK] WebKit spews flash/etc.. as text/plain into iframe if plugin missing

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Nov 2 18:07:51 PDT 2007


http://bugs.webkit.org/show_bug.cgi?id=15766


alp at atoker.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #16997|review?                     |review-
               Flag|                            |




------- Comment #6 from alp at atoker.com  2007-11-02 18:07 PDT -------
(From update of attachment 16997)
>Index: WebKit/gtk/ChangeLog
>===================================================================
>--- WebKit/gtk/ChangeLog	(revision 27376)
>+++ WebKit/gtk/ChangeLog	(working copy)
>@@ -1,3 +1,11 @@
>+2007-11-02  Rodney Dawes  <dobey at wayofthemonkey.com>
>+
>+	Do some MIME type comparisons to avoid spewing flash/etc... into
>+	an iframe as text/plain because the HTTP connection told us it was
>+
>+	* WebCoreSupport/FrameLoaderClientGtk.cpp:
>+	(FrameLoaderClient::objectContentType):
>+
> 2007-10-29  Alp Toker  <alp at atoker.com>
> 
>         Reviewed by Maciej.
>Index: WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
>===================================================================
>--- WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp	(revision 27376)
>+++ WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp	(working copy)
>@@ -226,14 +247,23 @@ Widget* FrameLoaderClient::createJavaApp
> 
> ObjectContentType FrameLoaderClient::objectContentType(const KURL& url, const String& mimeType)
> {
>-    if (url.isEmpty())
>-        return ObjectContentType();
>+    String type = mimeType;
>+    if (type.isEmpty())
>+        type = MIMETypeRegistry::getMIMETypeForExtension(url.path().mid(url.path().findRev('.')+1));
>+
>+    if (type.isEmpty())
>+        return WebCore::ObjectContentFrame; // Match win32/OSX behavior for now

I guess we can't use MIMETypeRegistry::getMIMETypeForPath() because it returns
"application/octet-stream" instead of an error status? That would explain why
Win did the path parsing themselves.

> 
>-    // TODO: use more than just the extension to determine the content type?
>-    String rtype = MIMETypeRegistry::getMIMETypeForPath(url.path());
>-    if (!rtype.isEmpty())
>-        return ObjectContentFrame;
>-    return ObjectContentType();
>+    if (MIMETypeRegistry::isSupportedImageMIMEType(type))
>+        return WebCore::ObjectContentImage;
>+
>+    if (PluginDatabaseGtk::installedPlugins()->isMIMETypeRegistered(mimeType))
>+        return WebCore::ObjectContentNetscapePlugin;

Careful. There is no PluginDatabaseGtk yet, so this will break the build. I
appreciate that you're juggling a lot of changes. Perhaps it'll be OK to
comment this out along with a TODO.

>+
>+    if (MIMETypeRegistry::isSupportedNonImageMIMEType(type))
>+        return WebCore::ObjectContentFrame;
>+
>+    return WebCore::ObjectContentNone;
> }
> 
> String FrameLoaderClient::overrideMediaType() const


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list