2010-05-06 Anders Carlsson <andersca@apple.com>
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 May 2010 23:23:27 +0000 (23:23 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 May 2010 23:23:27 +0000 (23:23 +0000)
commit46847750be8a6744cae20af9a4463b7898839533
treec6e62255d9ee3f89255405fbed11efc165a5c36d
parentc3e2b34f2faf3bc69e9e00b5781cdfe3a90809f3
2010-05-06  Anders Carlsson  <andersca@apple.com>

        Reviewed by Darin Adler and Dan Bernstein..

        REGRESSION (r51617): when plugins are disabled, plugins show up as garbage characters
        https://bugs.webkit.org/show_bug.cgi?id=38698
        <rdar://problem/7942075>

        When the plug-in database is initialized, we will register all the MIME types it supports with the global
        WebView dictionary. When plug-ins are disabled for a single web view, the MIME types still need to be
        in the global mapping (because other web views might still have plug-ins enabled).

        Prior to r51617 we would always look at the plug-in database to determine that the MIME type belongs to a
        plug-in, but now we won't even touch the plug-in database when plug-ins are disabled.

        In order to fix this, a new set of registered MIME types that are known to be plug-ins is added. When
        +[WebView _viewClass:andRepresentationClass:forMIMEType:allowingPlugins:] is called and allowingPlugins is FALSE
        we check if the MIME type is a known plug-in MIME type and return false in that case.

        * Plugins/WebPluginDatabase.mm:
        (-[WebPluginDatabase refresh]):
        (-[WebPluginDatabase _removePlugin:]):
        * WebView/WebView.mm:
        (knownPluginMIMETypes):
        (+[WebView _registerPluginMIMEType:]):
        (+[WebView _unregisterPluginMIMEType:]):
        (+[WebView _viewClass:andRepresentationClass:forMIMEType:allowingPlugins:]):
        * WebView/WebViewInternal.h:
2010-05-06  Anders Carlsson  <andersca@apple.com>

        Reviewed by Darin Adler and Dan Bernstein..

        REGRESSION (r51617): when plugins are disabled, plugins show up as garbage characters
        https://bugs.webkit.org/show_bug.cgi?id=38698
        <rdar://problem/7942075>

        Add tests.

        * platform/mac/plugins/disable-plugins-expected.txt: Added.
        * platform/mac/plugins/disable-plugins.html: Added.
2010-05-06  Anders Carlsson  <andersca@apple.com>

        Reviewed by Darin Adler and Dan Bernstein..

        REGRESSION (r51617): when plugins are disabled, plugins show up as garbage characters
        https://bugs.webkit.org/show_bug.cgi?id=38698
        <rdar://problem/7942075>

        Add a 'setPluginsEnabled' layoutTestController function for disabling plug-ins. This is only implemented on Mac currently
        because the bug that needs this functionality is mac specific.

        * DumpRenderTree/LayoutTestController.cpp:
        (setPluginsEnabledCallback):
        (LayoutTestController::staticFunctions):
        * DumpRenderTree/LayoutTestController.h:
        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
        (LayoutTestController::setPluginsEnabled):
        * DumpRenderTree/mac/DumpRenderTree.mm:
        (resetDefaultsToConsistentValues):
        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
        (LayoutTestController::setPluginsEnabled):
        * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
        (LayoutTestController::setPluginsEnabled):
        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
        (LayoutTestController::setPluginsEnabled):
        * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
        (LayoutTestController::setPluginsEnabled):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@58917 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac/plugins/disable-plugins-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/plugins/disable-plugins.html [new file with mode: 0644]
WebKit/mac/ChangeLog
WebKit/mac/Plugins/WebPluginDatabase.mm
WebKit/mac/WebView/WebView.mm
WebKit/mac/WebView/WebViewInternal.h
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/LayoutTestController.cpp
WebKitTools/DumpRenderTree/LayoutTestController.h
WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp