| Index: third_party/WebKit/Source/core/dom/StyleEngine.cpp
|
| diff --git a/third_party/WebKit/Source/core/dom/StyleEngine.cpp b/third_party/WebKit/Source/core/dom/StyleEngine.cpp
|
| index c19ca69998809a5f109748fc23b99429542a7d63..3a940d167532603cf46d514d33d39484b8ae1a06 100644
|
| --- a/third_party/WebKit/Source/core/dom/StyleEngine.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/StyleEngine.cpp
|
| @@ -62,9 +62,12 @@ StyleEngine::StyleEngine(Document& document)
|
| : m_document(&document)
|
| , m_isMaster(!document.importsController() || document.importsController()->master() == &document)
|
| , m_documentStyleSheetCollection(DocumentStyleSheetCollection::create(document))
|
| + // We don't need to create CSSFontSelector for imported document or
|
| + // HTMLTemplateElement's document, because those documents have no frame.
|
| + , m_fontSelector(document.frame() ? CSSFontSelector::create(&document) : nullptr)
|
| {
|
| - m_fontSelector = CSSFontSelector::create(m_document);
|
| - m_fontSelector->registerForInvalidationCallbacks(this);
|
| + if (m_fontSelector)
|
| + m_fontSelector->registerForInvalidationCallbacks(this);
|
| }
|
|
|
| StyleEngine::~StyleEngine()
|
|
|