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

Unified Diff: third_party/WebKit/Source/core/dom/StyleEngine.cpp

Issue 2370283002: Revert of Rendering text to a canvas in a frame-less document. (Closed)
Patch Set: Manual patch revert. Created 4 years, 3 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
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()

Powered by Google App Engine
This is Rietveld 408576698