Commit 647f4529 authored by hausmann@webkit.org's avatar hausmann@webkit.org

2008-06-26 Holger Hans Peter Freyther <zecke@selfish.org>

        Reviewed by Simon.

        [svg] Disable plugins for SVG images
        The Qt platform allows to have a plugin factory per Page. Now SVG Images
        are using a Page and dummy/empty clients for Chrome. The only way to get
        the kit from the WebCore::Page is to go through the ChromeClient but this
        is not possible when the ChromeClient is an empty client. This leads to a
        crash in PluginDataQt.cpp. One way to avoid this would have been the
        addition of a rtti like field to ChromeClient to see if it is an empty
        client. The other possibility is to not enable plugins for images.

        The SVGImage relies on the fact that the document is a SVGDocument and
        that the rootElement is a SVGSVGElement. If plugins are used we could
        end up with a PluginDocument and crash badly. Do not try to use plugins
        if plugins are disabled for the WebCore::Page.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34808 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent e6ad55ae
2008-06-26 Holger Hans Peter Freyther <zecke@selfish.org>
Reviewed by Simon.
[svg] Disable plugins for SVG images
The Qt platform allows to have a plugin factory per Page. Now SVG Images
are using a Page and dummy/empty clients for Chrome. The only way to get
the kit from the WebCore::Page is to go through the ChromeClient but this
is not possible when the ChromeClient is an empty client. This leads to a
crash in PluginDataQt.cpp. One way to avoid this would have been the
addition of a rtti like field to ChromeClient to see if it is an empty
client. The other possibility is to not enable plugins for images.
The SVGImage relies on the fact that the document is a SVGDocument and
that the rootElement is a SVGSVGElement. If plugins are used we could
end up with a PluginDocument and crash badly. Do not try to use plugins
if plugins are disabled for the WebCore::Page.
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::dataChanged):
2008-06-25 Holger Hans Peter Freyther <zecke@selfish.org>
Reviewed by Simon.
......@@ -316,7 +316,7 @@ PassRefPtr<Document> DOMImplementation::createDocument(const String& type, Frame
#endif
PluginData* pluginData = 0;
if (frame && frame->page())
if (frame && frame->page() && frame->page()->settings()->arePluginsEnabled())
pluginData = frame->page()->pluginData();
// PDF is one image type for which a plugin can override built-in support.
......
......@@ -205,6 +205,7 @@ bool SVGImage::dataChanged(bool allDataReceived)
// The Cache code does not know about CachedImages holding Frames and won't know to break the cycle.
m_page.set(new Page(dummyChromeClient, dummyContextMenuClient, dummyEditorClient, dummyDragClient, dummyInspectorClient));
m_page->settings()->setJavaScriptEnabled(false);
m_page->settings()->setPluginsEnabled(false);
m_frame = Frame::create(m_page.get(), 0, dummyFrameLoaderClient);
m_frameView = new FrameView(m_frame.get());
......
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