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

Side by Side Diff: third_party/WebKit/Source/core/dom/StyleEngine.cpp

Issue 2728513002: Revert of Move the FontFaceCache stored in CSSFontSelector to be stored in Document. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 454
455 void StyleEngine::didDetach() { 455 void StyleEngine::didDetach() {
456 clearResolvers(); 456 clearResolvers();
457 m_globalRuleSet.dispose(); 457 m_globalRuleSet.dispose();
458 m_treeBoundaryCrossingScopes.clear(); 458 m_treeBoundaryCrossingScopes.clear();
459 m_dirtyTreeScopes.clear(); 459 m_dirtyTreeScopes.clear();
460 m_activeTreeScopes.clear(); 460 m_activeTreeScopes.clear();
461 m_viewportResolver = nullptr; 461 m_viewportResolver = nullptr;
462 m_mediaQueryEvaluator = nullptr; 462 m_mediaQueryEvaluator = nullptr;
463 if (m_fontSelector) 463 if (m_fontSelector)
464 m_document->fontFaceCache()->clearAll(); 464 m_fontSelector->fontFaceCache()->clearAll();
465 m_fontSelector = nullptr; 465 m_fontSelector = nullptr;
466 } 466 }
467 467
468 void StyleEngine::clearFontCache() { 468 void StyleEngine::clearFontCache() {
469 if (m_fontSelector) 469 if (m_fontSelector)
470 m_document->fontFaceCache()->clearCSSConnected(); 470 m_fontSelector->fontFaceCache()->clearCSSConnected();
471 if (m_resolver) 471 if (m_resolver)
472 m_resolver->invalidateMatchedPropertiesCache(); 472 m_resolver->invalidateMatchedPropertiesCache();
473 } 473 }
474 474
475 void StyleEngine::updateGenericFontFamilySettings() { 475 void StyleEngine::updateGenericFontFamilySettings() {
476 // FIXME: we should not update generic font family settings when 476 // FIXME: we should not update generic font family settings when
477 // document is inactive. 477 // document is inactive.
478 DCHECK(document().isActive()); 478 DCHECK(document().isActive());
479 479
480 if (!m_fontSelector) 480 if (!m_fontSelector)
481 return; 481 return;
482 482
483 m_fontSelector->updateGenericFontFamilySettings(*m_document); 483 m_fontSelector->updateGenericFontFamilySettings(*m_document);
484 if (m_resolver) 484 if (m_resolver)
485 m_resolver->invalidateMatchedPropertiesCache(); 485 m_resolver->invalidateMatchedPropertiesCache();
486 FontCache::fontCache()->invalidateShapeCache(); 486 FontCache::fontCache()->invalidateShapeCache();
487 } 487 }
488 488
489 void StyleEngine::removeFontFaceRules( 489 void StyleEngine::removeFontFaceRules(
490 const HeapVector<Member<const StyleRuleFontFace>>& fontFaceRules) { 490 const HeapVector<Member<const StyleRuleFontFace>>& fontFaceRules) {
491 if (!m_fontSelector) 491 if (!m_fontSelector)
492 return; 492 return;
493 493
494 FontFaceCache* cache = m_document->fontFaceCache(); 494 FontFaceCache* cache = m_fontSelector->fontFaceCache();
495 for (const auto& rule : fontFaceRules) 495 for (const auto& rule : fontFaceRules)
496 cache->remove(rule); 496 cache->remove(rule);
497 if (m_resolver) 497 if (m_resolver)
498 m_resolver->invalidateMatchedPropertiesCache(); 498 m_resolver->invalidateMatchedPropertiesCache();
499 } 499 }
500 500
501 void StyleEngine::markTreeScopeDirty(TreeScope& scope) { 501 void StyleEngine::markTreeScopeDirty(TreeScope& scope) {
502 if (scope == m_document) { 502 if (scope == m_document) {
503 markDocumentDirty(); 503 markDocumentDirty();
504 return; 504 return;
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
1146 } 1146 }
1147 1147
1148 DEFINE_TRACE_WRAPPERS(StyleEngine) { 1148 DEFINE_TRACE_WRAPPERS(StyleEngine) {
1149 for (auto sheet : m_injectedAuthorStyleSheets) { 1149 for (auto sheet : m_injectedAuthorStyleSheets) {
1150 visitor->traceWrappers(sheet); 1150 visitor->traceWrappers(sheet);
1151 } 1151 }
1152 visitor->traceWrappers(m_documentStyleSheetCollection); 1152 visitor->traceWrappers(m_documentStyleSheetCollection);
1153 } 1153 }
1154 1154
1155 } // namespace blink 1155 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698