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

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

Issue 1699323002: [Closed][SVG 4/4] Finish font subresource loading of SVG synchronously in SVGImage::dataChanged() (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/LayoutTests/svg/as-image/resources/data-font-in-css-invalid-font.svg ('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 b1141564d2424c0a8a97b91a158ab1d1b222863c..9c752ac4191827d6a255f0fecee7787d2be28b1b 100644
--- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
+++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
@@ -28,8 +28,11 @@
#include "core/svg/graphics/SVGImage.h"
#include "core/animation/AnimationTimeline.h"
+#include "core/css/CSSFontSelector.h"
#include "core/dom/NodeTraversal.h"
+#include "core/dom/StyleEngine.h"
#include "core/dom/shadow/FlatTreeTraversal.h"
+#include "core/fetch/ResourceFetcher.h"
#include "core/frame/Deprecation.h"
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
@@ -536,6 +539,11 @@ bool SVGImage::dataChanged(bool allDataReceived)
// Set the concrete object size before a container size is available.
m_concreteObjectSize = roundedIntSize(calculateConcreteObjectSize(FloatSize(300, 150)));
+
+ // Forces pending font loading to start (and we assume loading completes sychronously here).
+ toLocalFrame(m_page->mainFrame())->document()->styleEngine().fontSelector()->fontLoader()->loadPendingFonts();
+ // Forces SVG's document's load completion.
+ loader.checkCompleted();
}
return m_page;
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/as-image/resources/data-font-in-css-invalid-font.svg ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698