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

Side by Side Diff: third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.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
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 document.fontFaceCache()->add(cssFontSelector, fontFaceRule, fontFace); 79 cssFontSelector->fontFaceCache()->add(cssFontSelector, fontFaceRule,
80 fontFace);
80 } 81 }
81 if (fontFaceRules.size() && document.styleResolver()) 82 if (fontFaceRules.size() && document.styleResolver())
82 document.styleResolver()->invalidateMatchedPropertiesCache(); 83 document.styleResolver()->invalidateMatchedPropertiesCache();
83 } 84 }
84 85
85 void ScopedStyleResolver::appendActiveStyleSheets( 86 void ScopedStyleResolver::appendActiveStyleSheets(
86 unsigned index, 87 unsigned index,
87 const ActiveStyleSheetVector& activeSheets) { 88 const ActiveStyleSheetVector& activeSheets) {
88 for (auto activeIterator = activeSheets.begin() + index; 89 for (auto activeIterator = activeSheets.begin() + index;
89 activeIterator != activeSheets.end(); activeIterator++) { 90 activeIterator != activeSheets.end(); activeIterator++) {
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 } 319 }
319 return true; 320 return true;
320 } 321 }
321 322
322 DEFINE_TRACE(ScopedStyleResolver::RuleSubSet) { 323 DEFINE_TRACE(ScopedStyleResolver::RuleSubSet) {
323 visitor->trace(m_parentStyleSheet); 324 visitor->trace(m_parentStyleSheet);
324 visitor->trace(m_ruleSet); 325 visitor->trace(m_ruleSet);
325 } 326 }
326 327
327 } // namespace blink 328 } // 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