| 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 11 matching lines...) Expand all Loading... |
| 22 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 22 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 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 "core/svg/graphics/SVGImage.h" | 28 #include "core/svg/graphics/SVGImage.h" |
| 29 | 29 |
| 30 #include "core/animation/AnimationTimeline.h" | 30 #include "core/animation/AnimationTimeline.h" |
| 31 #include "core/dom/NodeTraversal.h" | 31 #include "core/dom/NodeTraversal.h" |
| 32 #include "core/dom/shadow/ComposedTreeTraversal.h" | 32 #include "core/dom/shadow/FlatTreeTraversal.h" |
| 33 #include "core/frame/FrameView.h" | 33 #include "core/frame/FrameView.h" |
| 34 #include "core/frame/LocalFrame.h" | 34 #include "core/frame/LocalFrame.h" |
| 35 #include "core/frame/Settings.h" | 35 #include "core/frame/Settings.h" |
| 36 #include "core/style/ComputedStyle.h" | 36 #include "core/style/ComputedStyle.h" |
| 37 #include "core/layout/svg/LayoutSVGRoot.h" | 37 #include "core/layout/svg/LayoutSVGRoot.h" |
| 38 #include "core/loader/FrameLoadRequest.h" | 38 #include "core/loader/FrameLoadRequest.h" |
| 39 #include "core/paint/FloatClipRecorder.h" | 39 #include "core/paint/FloatClipRecorder.h" |
| 40 #include "core/paint/TransformRecorder.h" | 40 #include "core/paint/TransformRecorder.h" |
| 41 #include "core/svg/SVGDocumentExtensions.h" | 41 #include "core/svg/SVGDocumentExtensions.h" |
| 42 #include "core/svg/SVGFEImageElement.h" | 42 #include "core/svg/SVGFEImageElement.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 LocalFrame* frame = toLocalFrame(m_page->mainFrame()); | 103 LocalFrame* frame = toLocalFrame(m_page->mainFrame()); |
| 104 | 104 |
| 105 RELEASE_ASSERT(frame->document()->loadEventFinished()); | 105 RELEASE_ASSERT(frame->document()->loadEventFinished()); |
| 106 | 106 |
| 107 SVGSVGElement* rootElement = frame->document()->accessSVGExtensions().rootEl
ement(); | 107 SVGSVGElement* rootElement = frame->document()->accessSVGExtensions().rootEl
ement(); |
| 108 if (!rootElement) | 108 if (!rootElement) |
| 109 return true; | 109 return true; |
| 110 | 110 |
| 111 // Don't allow foreignObject elements or images that are not known to be | 111 // Don't allow foreignObject elements or images that are not known to be |
| 112 // single-origin since these can leak cross-origin information. | 112 // single-origin since these can leak cross-origin information. |
| 113 for (Node* node = rootElement; node; node = ComposedTreeTraversal::next(*nod
e)) { | 113 for (Node* node = rootElement; node; node = FlatTreeTraversal::next(*node))
{ |
| 114 if (isSVGForeignObjectElement(*node)) | 114 if (isSVGForeignObjectElement(*node)) |
| 115 return false; | 115 return false; |
| 116 if (isSVGImageElement(*node)) { | 116 if (isSVGImageElement(*node)) { |
| 117 if (!toSVGImageElement(*node).currentFrameHasSingleSecurityOrigin()) | 117 if (!toSVGImageElement(*node).currentFrameHasSingleSecurityOrigin()) |
| 118 return false; | 118 return false; |
| 119 } else if (isSVGFEImageElement(*node)) { | 119 } else if (isSVGFEImageElement(*node)) { |
| 120 if (!toSVGFEImageElement(*node).currentFrameHasSingleSecurityOrigin(
)) | 120 if (!toSVGFEImageElement(*node).currentFrameHasSingleSecurityOrigin(
)) |
| 121 return false; | 121 return false; |
| 122 } | 122 } |
| 123 } | 123 } |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 | 501 |
| 502 return m_page; | 502 return m_page; |
| 503 } | 503 } |
| 504 | 504 |
| 505 String SVGImage::filenameExtension() const | 505 String SVGImage::filenameExtension() const |
| 506 { | 506 { |
| 507 return "svg"; | 507 return "svg"; |
| 508 } | 508 } |
| 509 | 509 |
| 510 } // namespace blink | 510 } // namespace blink |
| OLD | NEW |