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

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

Issue 1515963005: SVGImage: check requestCount() to check all subresources are loaded (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: auto-Rebase Created 4 years, 9 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
index 1c22bec45ca7cb9a4b9dc8c3df7b08688c4daafc..f357ee57bcf8c6b29600ecd33a357d6887e35354 100644
--- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
+++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
@@ -37,11 +37,11 @@
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/Settings.h"
-#include "core/style/ComputedStyle.h"
#include "core/layout/svg/LayoutSVGRoot.h"
#include "core/loader/FrameLoadRequest.h"
#include "core/paint/FloatClipRecorder.h"
#include "core/paint/TransformRecorder.h"
+#include "core/style/ComputedStyle.h"
#include "core/svg/SVGDocumentExtensions.h"
#include "core/svg/SVGFEImageElement.h"
#include "core/svg/SVGImageElement.h"
@@ -99,14 +99,20 @@ bool SVGImage::isInSVGImage(const Node* node)
return page->chromeClient().isSVGImageChromeClient();
}
+void SVGImage::assertSubresourcesLoaded() const
+{
+ RELEASE_ASSERT(m_page);
+ LocalFrame* frame = toLocalFrame(m_page->mainFrame());
+ RELEASE_ASSERT(frame->document()->fetcher()->requestCount() == 0);
+}
+
bool SVGImage::currentFrameHasSingleSecurityOrigin() const
{
if (!m_page)
return true;
LocalFrame* frame = toLocalFrame(m_page->mainFrame());
-
- RELEASE_ASSERT(frame->document()->loadEventFinished());
+ assertSubresourcesLoaded();
SVGSVGElement* rootElement = frame->document()->accessSVGExtensions().rootElement();
if (!rootElement)
« 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