Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(678)

Side by Side Diff: third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp

Issue 1544473004: Revert of SVGImage: check requestCount() to check all subresources are loaded (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/svg/graphics/SVGImage.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 14 matching lines...) Expand all
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/NodeTraversal.h" 33 #include "core/dom/NodeTraversal.h"
34 #include "core/dom/shadow/ComposedTreeTraversal.h" 34 #include "core/dom/shadow/ComposedTreeTraversal.h"
35 #include "core/fetch/ResourceFetcher.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"
38 #include "core/style/ComputedStyle.h"
39 #include "core/layout/svg/LayoutSVGRoot.h" 39 #include "core/layout/svg/LayoutSVGRoot.h"
40 #include "core/loader/FrameLoadRequest.h" 40 #include "core/loader/FrameLoadRequest.h"
41 #include "core/paint/CompositingRecorder.h" 41 #include "core/paint/CompositingRecorder.h"
42 #include "core/paint/FloatClipRecorder.h" 42 #include "core/paint/FloatClipRecorder.h"
43 #include "core/paint/TransformRecorder.h" 43 #include "core/paint/TransformRecorder.h"
44 #include "core/style/ComputedStyle.h"
45 #include "core/svg/SVGDocumentExtensions.h" 44 #include "core/svg/SVGDocumentExtensions.h"
46 #include "core/svg/SVGFEImageElement.h" 45 #include "core/svg/SVGFEImageElement.h"
47 #include "core/svg/SVGImageElement.h" 46 #include "core/svg/SVGImageElement.h"
48 #include "core/svg/SVGSVGElement.h" 47 #include "core/svg/SVGSVGElement.h"
49 #include "core/svg/animation/SMILTimeContainer.h" 48 #include "core/svg/animation/SMILTimeContainer.h"
50 #include "core/svg/graphics/SVGImageChromeClient.h" 49 #include "core/svg/graphics/SVGImageChromeClient.h"
51 #include "platform/EventDispatchForbiddenScope.h" 50 #include "platform/EventDispatchForbiddenScope.h"
52 #include "platform/LengthFunctions.h" 51 #include "platform/LengthFunctions.h"
53 #include "platform/TraceEvent.h" 52 #include "platform/TraceEvent.h"
54 #include "platform/geometry/IntRect.h" 53 #include "platform/geometry/IntRect.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 { 91 {
93 ASSERT(node); 92 ASSERT(node);
94 93
95 Page* page = node->document().page(); 94 Page* page = node->document().page();
96 if (!page) 95 if (!page)
97 return false; 96 return false;
98 97
99 return page->chromeClient().isSVGImageChromeClient(); 98 return page->chromeClient().isSVGImageChromeClient();
100 } 99 }
101 100
102 void SVGImage::assertSubresourcesLoaded() const
103 {
104 RELEASE_ASSERT(m_page);
105 LocalFrame* frame = toLocalFrame(m_page->mainFrame());
106 RELEASE_ASSERT(frame->document()->fetcher()->requestCount() == 0);
107 }
108
109 bool SVGImage::currentFrameHasSingleSecurityOrigin() const 101 bool SVGImage::currentFrameHasSingleSecurityOrigin() const
110 { 102 {
111 if (!m_page) 103 if (!m_page)
112 return true; 104 return true;
113 105
114 LocalFrame* frame = toLocalFrame(m_page->mainFrame()); 106 LocalFrame* frame = toLocalFrame(m_page->mainFrame());
115 assertSubresourcesLoaded(); 107
108 RELEASE_ASSERT(frame->document()->loadEventFinished());
116 109
117 SVGSVGElement* rootElement = frame->document()->accessSVGExtensions().rootEl ement(); 110 SVGSVGElement* rootElement = frame->document()->accessSVGExtensions().rootEl ement();
118 if (!rootElement) 111 if (!rootElement)
119 return true; 112 return true;
120 113
121 // Don't allow foreignObject elements or images that are not known to be 114 // Don't allow foreignObject elements or images that are not known to be
122 // single-origin since these can leak cross-origin information. 115 // single-origin since these can leak cross-origin information.
123 for (Node* node = rootElement; node; node = ComposedTreeTraversal::next(*nod e)) { 116 for (Node* node = rootElement; node; node = ComposedTreeTraversal::next(*nod e)) {
124 if (isSVGForeignObjectElement(*node)) 117 if (isSVGForeignObjectElement(*node))
125 return false; 118 return false;
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 515
523 return m_page; 516 return m_page;
524 } 517 }
525 518
526 String SVGImage::filenameExtension() const 519 String SVGImage::filenameExtension() const
527 { 520 {
528 return "svg"; 521 return "svg";
529 } 522 }
530 523
531 } 524 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/graphics/SVGImage.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698