| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org> | 2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org> |
| 3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. |
| 4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 26 */ | 26 */ |
| 27 | 27 |
| 28 #include "config.h" | 28 #include "config.h" |
| 29 | 29 |
| 30 #include "core/svg/graphics/SVGImage.h" | 30 #include "core/svg/graphics/SVGImage.h" |
| 31 | 31 |
| 32 #include "core/animation/AnimationTimeline.h" | 32 #include "core/animation/AnimationTimeline.h" |
| 33 #include "core/dom/NoEventDispatchAssertion.h" | |
| 34 #include "core/dom/NodeTraversal.h" | 33 #include "core/dom/NodeTraversal.h" |
| 35 #include "core/dom/shadow/ComposedTreeWalker.h" | 34 #include "core/dom/shadow/ComposedTreeWalker.h" |
| 36 #include "core/frame/FrameView.h" | 35 #include "core/frame/FrameView.h" |
| 37 #include "core/frame/LocalFrame.h" | 36 #include "core/frame/LocalFrame.h" |
| 38 #include "core/frame/Settings.h" | 37 #include "core/frame/Settings.h" |
| 39 #include "core/loader/FrameLoadRequest.h" | 38 #include "core/loader/FrameLoadRequest.h" |
| 40 #include "core/page/Chrome.h" | 39 #include "core/page/Chrome.h" |
| 41 #include "core/rendering/style/RenderStyle.h" | 40 #include "core/rendering/style/RenderStyle.h" |
| 42 #include "core/rendering/svg/RenderSVGRoot.h" | 41 #include "core/rendering/svg/RenderSVGRoot.h" |
| 43 #include "core/svg/SVGDocumentExtensions.h" | 42 #include "core/svg/SVGDocumentExtensions.h" |
| 44 #include "core/svg/SVGFEImageElement.h" | 43 #include "core/svg/SVGFEImageElement.h" |
| 45 #include "core/svg/SVGImageElement.h" | 44 #include "core/svg/SVGImageElement.h" |
| 46 #include "core/svg/SVGSVGElement.h" | 45 #include "core/svg/SVGSVGElement.h" |
| 47 #include "core/svg/animation/SMILTimeContainer.h" | 46 #include "core/svg/animation/SMILTimeContainer.h" |
| 48 #include "core/svg/graphics/SVGImageChromeClient.h" | 47 #include "core/svg/graphics/SVGImageChromeClient.h" |
| 48 #include "platform/EventDispatchForbiddenScope.h" |
| 49 #include "platform/LengthFunctions.h" | 49 #include "platform/LengthFunctions.h" |
| 50 #include "platform/TraceEvent.h" | 50 #include "platform/TraceEvent.h" |
| 51 #include "platform/geometry/IntRect.h" | 51 #include "platform/geometry/IntRect.h" |
| 52 #include "platform/graphics/GraphicsContextStateSaver.h" | 52 #include "platform/graphics/GraphicsContextStateSaver.h" |
| 53 #include "platform/graphics/ImageBuffer.h" | 53 #include "platform/graphics/ImageBuffer.h" |
| 54 #include "platform/graphics/ImageObserver.h" | 54 #include "platform/graphics/ImageObserver.h" |
| 55 #include "wtf/PassRefPtr.h" | 55 #include "wtf/PassRefPtr.h" |
| 56 | 56 |
| 57 namespace blink { | 57 namespace blink { |
| 58 | 58 |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 | 379 |
| 380 // Don't do anything if is an empty image. | 380 // Don't do anything if is an empty image. |
| 381 if (!data()->size()) | 381 if (!data()->size()) |
| 382 return true; | 382 return true; |
| 383 | 383 |
| 384 if (allDataReceived) { | 384 if (allDataReceived) { |
| 385 // SVGImage will fire events (and the default C++ handlers run) but does
n't | 385 // SVGImage will fire events (and the default C++ handlers run) but does
n't |
| 386 // actually allow script to run so it's fine to call into it. We allow t
his | 386 // actually allow script to run so it's fine to call into it. We allow t
his |
| 387 // since it means an SVG data url can synchronously load like other imag
e | 387 // since it means an SVG data url can synchronously load like other imag
e |
| 388 // types. | 388 // types. |
| 389 NoEventDispatchAssertion::AllowUserAgentEvents allowUserAgentEvents; | 389 EventDispatchForbiddenScope::AllowUserAgentEvents allowUserAgentEvents; |
| 390 | 390 |
| 391 static FrameLoaderClient* dummyFrameLoaderClient = new EmptyFrameLoaderC
lient; | 391 static FrameLoaderClient* dummyFrameLoaderClient = new EmptyFrameLoaderC
lient; |
| 392 | 392 |
| 393 Page::PageClients pageClients; | 393 Page::PageClients pageClients; |
| 394 fillWithEmptyClients(pageClients); | 394 fillWithEmptyClients(pageClients); |
| 395 m_chromeClient = adoptPtr(new SVGImageChromeClient(this)); | 395 m_chromeClient = adoptPtr(new SVGImageChromeClient(this)); |
| 396 pageClients.chromeClient = m_chromeClient.get(); | 396 pageClients.chromeClient = m_chromeClient.get(); |
| 397 | 397 |
| 398 // FIXME: If this SVG ends up loading itself, we might leak the world. | 398 // FIXME: If this SVG ends up loading itself, we might leak the world. |
| 399 // The Cache code does not know about ImageResources holding Frames and | 399 // The Cache code does not know about ImageResources holding Frames and |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 | 435 |
| 436 return m_page; | 436 return m_page; |
| 437 } | 437 } |
| 438 | 438 |
| 439 String SVGImage::filenameExtension() const | 439 String SVGImage::filenameExtension() const |
| 440 { | 440 { |
| 441 return "svg"; | 441 return "svg"; |
| 442 } | 442 } |
| 443 | 443 |
| 444 } | 444 } |
| OLD | NEW |