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

Side by Side Diff: third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp

Issue 2624893003: Move the FontFaceCache stored in CSSFontSelector to be stored in Document. (Closed)
Patch Set: Rebase Created 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * Copyright (C) 2012 Google Inc. All rights reserved. 5 * Copyright (C) 2012 Google Inc. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 // the moment. 69 // the moment.
70 if (!treeScope().rootNode().isDocumentNode()) 70 if (!treeScope().rootNode().isDocumentNode())
71 return; 71 return;
72 72
73 Document& document = treeScope().document(); 73 Document& document = treeScope().document();
74 CSSFontSelector* cssFontSelector = document.styleEngine().fontSelector(); 74 CSSFontSelector* cssFontSelector = document.styleEngine().fontSelector();
75 const HeapVector<Member<StyleRuleFontFace>> fontFaceRules = 75 const HeapVector<Member<StyleRuleFontFace>> fontFaceRules =
76 ruleSet.fontFaceRules(); 76 ruleSet.fontFaceRules();
77 for (auto& fontFaceRule : fontFaceRules) { 77 for (auto& fontFaceRule : fontFaceRules) {
78 if (FontFace* fontFace = FontFace::create(&document, fontFaceRule)) 78 if (FontFace* fontFace = FontFace::create(&document, fontFaceRule))
79 cssFontSelector->fontFaceCache()->add(cssFontSelector, fontFaceRule, 79 document.fontFaceCache()->add(cssFontSelector, fontFaceRule, fontFace);
80 fontFace);
81 } 80 }
82 if (fontFaceRules.size() && document.styleResolver()) 81 if (fontFaceRules.size() && document.styleResolver())
83 document.styleResolver()->invalidateMatchedPropertiesCache(); 82 document.styleResolver()->invalidateMatchedPropertiesCache();
84 } 83 }
85 84
86 void ScopedStyleResolver::appendActiveStyleSheets( 85 void ScopedStyleResolver::appendActiveStyleSheets(
87 unsigned index, 86 unsigned index,
88 const ActiveStyleSheetVector& activeSheets) { 87 const ActiveStyleSheetVector& activeSheets) {
89 for (auto activeIterator = activeSheets.begin() + index; 88 for (auto activeIterator = activeSheets.begin() + index;
90 activeIterator != activeSheets.end(); activeIterator++) { 89 activeIterator != activeSheets.end(); activeIterator++) {
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 } 318 }
320 return true; 319 return true;
321 } 320 }
322 321
323 DEFINE_TRACE(ScopedStyleResolver::RuleSubSet) { 322 DEFINE_TRACE(ScopedStyleResolver::RuleSubSet) {
324 visitor->trace(m_parentStyleSheet); 323 visitor->trace(m_parentStyleSheet);
325 visitor->trace(m_ruleSet); 324 visitor->trace(m_ruleSet);
326 } 325 }
327 326
328 } // namespace blink 327 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/FontFaceSet.cpp ('k') | third_party/WebKit/Source/core/dom/Document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698