Reviewed by Geoff.
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Nov 2007 19:38:03 +0000 (19:38 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Nov 2007 19:38:03 +0000 (19:38 +0000)
        Fix for <rdar://problem/5620151> Disable JavaScript for SVG as
        image for <img> and CSS images

        * platform/graphics/svg/SVGImage.cpp:
        (WebCore::SVGImage::dataChanged): When we create the empty clients,
        explicitly disable JavaScript in the settings.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28193 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/graphics/svg/SVGImage.cpp

index edfc655d80ac5b8b1dac6a3c5d403f95646c8c90..f36ce04551c70fb11065300aeefd11edf21fbc57 100644 (file)
@@ -1,3 +1,14 @@
+2007-11-29  Beth Dakin  <bdakin@apple.com>
+
+        Reviewed by Geoff.
+
+        Fix for <rdar://problem/5620151> Disable JavaScript for SVG as 
+        image for <img> and CSS images
+
+        * platform/graphics/svg/SVGImage.cpp:
+        (WebCore::SVGImage::dataChanged): When we create the empty clients, 
+        explicitly disable JavaScript in the settings.
+
 2007-11-29  Brady Eidson  <beidson@apple.com>
 
         Reviewed by Anders
 2007-11-29  Brady Eidson  <beidson@apple.com>
 
         Reviewed by Anders
index 39425fc60909e53c74001474ad8ca977437d5801..1bd658d8d0530f6b4ca2c40401de41fde2578085 100644 (file)
@@ -43,6 +43,7 @@
 #include "SVGLength.h"
 #include "SVGRenderSupport.h"
 #include "SVGSVGElement.h"
 #include "SVGLength.h"
 #include "SVGRenderSupport.h"
 #include "SVGSVGElement.h"
+#include "Settings.h"
 
 #include "SVGImageEmptyClients.h"
 
 
 #include "SVGImageEmptyClients.h"
 
@@ -148,6 +149,8 @@ bool SVGImage::dataChanged(bool allDataReceived)
         // FIXME: If this SVG ends up loading itself, we'll leak this Frame (and associated DOM & render trees).
         // 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));
         // FIXME: If this SVG ends up loading itself, we'll leak this Frame (and associated DOM & render trees).
         // 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_frame = new Frame(m_page.get(), 0, dummyFrameLoaderClient);
         m_frame->init();
         m_frameView = new FrameView(m_frame.get());
         m_frame = new Frame(m_page.get(), 0, dummyFrameLoaderClient);
         m_frame->init();
         m_frameView = new FrameView(m_frame.get());