Commit 3d8fcbf7 authored by andersca's avatar andersca
Browse files

Reviewed by Geoff.

        <rdar://problem/5211677>
        -[WebPreferences setJavaEnabled:] only disables java inside <applet>, not <object>
        
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::requestObject):
        If the object is a Java MIME type and Java is disabled, don't load the plug-in.
        
        * platform/MimeTypeRegistry.cpp:
        (WebCore::MimeTypeRegistry::isJavaAppletMIMEType):
        Clean this up and add another applet MIME type.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@23529 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 5a566224
2007-06-14 Anders Carlsson <andersca@apple.com>
Reviewed by Geoff.
<rdar://problem/5211677>
-[WebPreferences setJavaEnabled:] only disables java inside <applet>, not <object>
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::requestObject):
If the object is a Java MIME type and Java is disabled, don't load the plug-in.
* platform/MimeTypeRegistry.cpp:
(WebCore::MimeTypeRegistry::isJavaAppletMIMEType):
Clean this up and add another applet MIME type.
2007-06-14 George Staikos <staikos@kde.org> 2007-06-14 George Staikos <staikos@kde.org>
   
Reviewed by Lars. Reviewed by Lars.
...@@ -62,6 +62,7 @@ ...@@ -62,6 +62,7 @@
#include "IconLoader.h" #include "IconLoader.h"
#include "Logging.h" #include "Logging.h"
#include "MainResourceLoader.h" #include "MainResourceLoader.h"
#include "MimeTypeRegistry.h"
#include "Page.h" #include "Page.h"
#include "PageCache.h" #include "PageCache.h"
#include "ProgressTracker.h" #include "ProgressTracker.h"
...@@ -1443,7 +1444,8 @@ bool FrameLoader::requestObject(RenderPart* renderer, const String& url, const A ...@@ -1443,7 +1444,8 @@ bool FrameLoader::requestObject(RenderPart* renderer, const String& url, const A
bool useFallback; bool useFallback;
if (shouldUsePlugin(completedURL, mimeType, renderer->hasFallbackContent(), useFallback)) { if (shouldUsePlugin(completedURL, mimeType, renderer->hasFallbackContent(), useFallback)) {
Settings* settings = m_frame->settings(); Settings* settings = m_frame->settings();
if (!settings || !settings->arePluginsEnabled()) if (!settings || !settings->arePluginsEnabled() ||
(!settings->isJavaEnabled() && MimeTypeRegistry::isJavaAppletMIMEType(mimeType)))
return false; return false;
return loadPlugin(renderer, completedURL, mimeType, paramNames, paramValues, useFallback); return loadPlugin(renderer, completedURL, mimeType, paramNames, paramValues, useFallback);
} }
......
...@@ -174,12 +174,12 @@ bool MimeTypeRegistry::isSupportedNonImageMIMEType(const String& mimeType) ...@@ -174,12 +174,12 @@ bool MimeTypeRegistry::isSupportedNonImageMIMEType(const String& mimeType)
bool MimeTypeRegistry::isJavaAppletMIMEType(const String& mimeType) bool MimeTypeRegistry::isJavaAppletMIMEType(const String& mimeType)
{ {
// Since this set is very limited and is likely to remain so we won't bother with the overhead // Since this set is very limited and is likely to remain so we won't bother with the overhead
// of using a Hashset. // of using a hash set.
// Note - "application/x-java-applet" may be followed by any number of specific versions of the JVM, // Any of the MIME types below may be followed by any number of specific versions of the JVM,
// which is why we use startsWith() // which is why we use startsWith()
return mimeType.startsWith("application/x-java-applet", false)
String lower = mimeType.lower(); || mimeType.startsWith("application/x-java-bean", false)
return lower.startsWith("application/x-java-applet") || lower == "application/x-java-vm"; || mimeType.startsWith("application/x-java-vm", false);
} }
const HashSet<String> &MimeTypeRegistry::getSupportedImageMIMETypes() const HashSet<String> &MimeTypeRegistry::getSupportedImageMIMETypes()
......
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