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

Unified Diff: Source/core/svg/SVGFontFaceElement.cpp

Issue 183743012: SVGFontFaceElement::removedFrom should not use FontSelector when document is not active. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Added comment Created 6 years, 10 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 | « LayoutTests/fast/css/use-incorrect-svg-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGFontFaceElement.cpp
diff --git a/Source/core/svg/SVGFontFaceElement.cpp b/Source/core/svg/SVGFontFaceElement.cpp
index a992e889402ee93c953034532e5b649ee6f9d163..e52ed511c450515e48cde7ed0ba37340d23ee861 100644
--- a/Source/core/svg/SVGFontFaceElement.cpp
+++ b/Source/core/svg/SVGFontFaceElement.cpp
@@ -335,7 +335,11 @@ void SVGFontFaceElement::removedFrom(ContainerNode* rootParent)
if (rootParent->inDocument()) {
m_fontElement = 0;
document().accessSVGExtensions().unregisterSVGFontFaceElement(this);
- document().styleEngine()->fontSelector()->fontFaceCache()->remove(m_fontFaceRule.get());
+ // FIXME: HTMLTemplateElement's document or imported document can be active?
+ // If so, we also need to check whether fontSelector() is nullptr or not.
+ // Otherwise, we will use just document().isActive() here.
+ if (document().isActive() && document().styleEngine()->fontSelector())
+ document().styleEngine()->fontSelector()->fontFaceCache()->remove(m_fontFaceRule.get());
m_fontFaceRule->mutableProperties().clear();
document().styleResolverChanged(RecalcStyleDeferred);
« no previous file with comments | « LayoutTests/fast/css/use-incorrect-svg-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698