OLD | NEW |
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 r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r
ights reserved. |
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 updateActiveStyleSheets(); | 88 updateActiveStyleSheets(); |
89 } | 89 } |
90 | 90 |
91 void StyleEngine::updateDocumentFonts() | 91 void StyleEngine::updateDocumentFonts() |
92 { | 92 { |
93 // TODO(esprehn): We should really support @font-face in ShadowRoot too. | 93 // TODO(esprehn): We should really support @font-face in ShadowRoot too. |
94 | 94 |
95 const auto& sheets = m_document->scopedStyleResolver().authorStyleSheets(); | 95 const auto& sheets = m_document->scopedStyleResolver().authorStyleSheets(); |
96 | 96 |
97 for (const auto& sheet : sheets) { | 97 for (const auto& sheet : sheets) { |
98 RuleSet& ruleSet = sheet->contents()->ruleSet(); | 98 RuleSet& ruleSet = sheet->contents()->ensureRuleSet(); |
99 for (const auto& rule : ruleSet.fontFaceRules()) { | 99 for (const auto& rule : ruleSet.fontFaceRules()) { |
100 if (RefPtr<FontFace> fontFace = FontFace::create(m_document, rule)) | 100 if (RefPtr<FontFace> fontFace = FontFace::create(m_document, rule)) |
101 m_fontSelector->fontFaceCache()->add(m_fontSelector.get(), rule,
fontFace); | 101 m_fontSelector->fontFaceCache()->add(m_fontSelector.get(), rule,
fontFace); |
102 } | 102 } |
103 if (!ruleSet.fontFaceRules().isEmpty()) | 103 if (!ruleSet.fontFaceRules().isEmpty()) |
104 m_resolver->invalidateMatchedPropertiesCache(); | 104 m_resolver->invalidateMatchedPropertiesCache(); |
105 } | 105 } |
106 | 106 |
107 m_document->renderView()->style()->font().update(m_fontSelector.get()); | 107 m_document->renderView()->style()->font().update(m_fontSelector.get()); |
108 } | 108 } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 m_sheetToTextCache.remove(contents); | 156 m_sheetToTextCache.remove(contents); |
157 } | 157 } |
158 | 158 |
159 void StyleEngine::fontsNeedUpdate(CSSFontSelector*) | 159 void StyleEngine::fontsNeedUpdate(CSSFontSelector*) |
160 { | 160 { |
161 m_resolver->invalidateMatchedPropertiesCache(); | 161 m_resolver->invalidateMatchedPropertiesCache(); |
162 m_document->setNeedsStyleRecalc(SubtreeStyleChange); | 162 m_document->setNeedsStyleRecalc(SubtreeStyleChange); |
163 } | 163 } |
164 | 164 |
165 } | 165 } |
OLD | NEW |