OLD | NEW |
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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 addKeyframeStyle(keyframesRules[i]); | 64 addKeyframeStyle(keyframesRules[i]); |
65 } | 65 } |
66 | 66 |
67 void ScopedStyleResolver::addFontFaceRules(const RuleSet& ruleSet) { | 67 void ScopedStyleResolver::addFontFaceRules(const RuleSet& ruleSet) { |
68 // FIXME(BUG 72461): We don't add @font-face rules of scoped style sheets for | 68 // FIXME(BUG 72461): We don't add @font-face rules of scoped style sheets for |
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(); | |
75 const HeapVector<Member<StyleRuleFontFace>> fontFaceRules = | 74 const HeapVector<Member<StyleRuleFontFace>> fontFaceRules = |
76 ruleSet.fontFaceRules(); | 75 ruleSet.fontFaceRules(); |
77 for (auto& fontFaceRule : fontFaceRules) { | 76 for (auto& fontFaceRule : fontFaceRules) { |
78 if (FontFace* fontFace = FontFace::create(&document, fontFaceRule)) | 77 if (FontFace* fontFace = FontFace::create(&document, fontFaceRule)) |
79 document.fontFaceCache()->add(cssFontSelector, fontFaceRule, fontFace); | 78 document.fontFaceCache()->add(fontFaceRule, fontFace); |
80 } | 79 } |
81 if (fontFaceRules.size() && document.styleResolver()) | 80 if (fontFaceRules.size() && document.styleResolver()) |
82 document.styleResolver()->invalidateMatchedPropertiesCache(); | 81 document.styleResolver()->invalidateMatchedPropertiesCache(); |
83 } | 82 } |
84 | 83 |
85 void ScopedStyleResolver::appendActiveStyleSheets( | 84 void ScopedStyleResolver::appendActiveStyleSheets( |
86 unsigned index, | 85 unsigned index, |
87 const ActiveStyleSheetVector& activeSheets) { | 86 const ActiveStyleSheetVector& activeSheets) { |
88 for (auto activeIterator = activeSheets.begin() + index; | 87 for (auto activeIterator = activeSheets.begin() + index; |
89 activeIterator != activeSheets.end(); activeIterator++) { | 88 activeIterator != activeSheets.end(); activeIterator++) { |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 } | 317 } |
319 return true; | 318 return true; |
320 } | 319 } |
321 | 320 |
322 DEFINE_TRACE(ScopedStyleResolver::RuleSubSet) { | 321 DEFINE_TRACE(ScopedStyleResolver::RuleSubSet) { |
323 visitor->trace(m_parentStyleSheet); | 322 visitor->trace(m_parentStyleSheet); |
324 visitor->trace(m_ruleSet); | 323 visitor->trace(m_ruleSet); |
325 } | 324 } |
326 | 325 |
327 } // namespace blink | 326 } // namespace blink |
OLD | NEW |