OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2011 Apple Inc. All rights reserved. |
3 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 3 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 134 |
135 return FontCache::fontCache()->getFontData(fontDescription, | 135 return FontCache::fontCache()->getFontData(fontDescription, |
136 settingsFamilyName); | 136 settingsFamilyName); |
137 } | 137 } |
138 | 138 |
139 void CSSFontSelector::willUseFontData(const FontDescription& fontDescription, | 139 void CSSFontSelector::willUseFontData(const FontDescription& fontDescription, |
140 const AtomicString& family, | 140 const AtomicString& family, |
141 const String& text) { | 141 const String& text) { |
142 CSSSegmentedFontFace* face = getFontFaceFromCache(fontDescription, family); | 142 CSSSegmentedFontFace* face = getFontFaceFromCache(fontDescription, family); |
143 if (face) | 143 if (face) |
144 face->willUseFontData(fontDescription, text); | 144 face->willUseFontData(m_document, fontDescription, text); |
145 } | 145 } |
146 | 146 |
147 void CSSFontSelector::willUseRange(const FontDescription& fontDescription, | 147 void CSSFontSelector::willUseRange(const FontDescription& fontDescription, |
148 const AtomicString& family, | 148 const AtomicString& family, |
149 const FontDataForRangeSet& rangeSet) { | 149 const FontDataForRangeSet& rangeSet) { |
150 CSSSegmentedFontFace* face = getFontFaceFromCache(fontDescription, family); | 150 CSSSegmentedFontFace* face = getFontFaceFromCache(fontDescription, family); |
151 if (face) | 151 if (face) |
152 face->willUseRange(fontDescription, rangeSet); | 152 face->willUseRange(m_document, fontDescription, rangeSet); |
153 } | 153 } |
154 | 154 |
155 bool CSSFontSelector::isPlatformFontAvailable( | 155 bool CSSFontSelector::isPlatformFontAvailable( |
156 const FontDescription& fontDescription, | 156 const FontDescription& fontDescription, |
157 const AtomicString& passedFamily) { | 157 const AtomicString& passedFamily) { |
158 AtomicString family = familyNameFromSettings(m_genericFontFamilySettings, | 158 AtomicString family = familyNameFromSettings(m_genericFontFamilySettings, |
159 fontDescription, passedFamily); | 159 fontDescription, passedFamily); |
160 if (family.isEmpty()) | 160 if (family.isEmpty()) |
161 family = passedFamily; | 161 family = passedFamily; |
162 return FontCache::fontCache()->isPlatformFontAvailable(fontDescription, | 162 return FontCache::fontCache()->isPlatformFontAvailable(fontDescription, |
163 family); | 163 family); |
164 } | 164 } |
165 | 165 |
166 void CSSFontSelector::updateGenericFontFamilySettings(Document& document) { | 166 void CSSFontSelector::updateGenericFontFamilySettings(Document& document) { |
167 if (!document.settings()) | 167 if (!document.settings()) |
168 return; | 168 return; |
169 m_genericFontFamilySettings = | 169 m_genericFontFamilySettings = |
170 document.settings()->genericFontFamilySettings(); | 170 document.settings()->genericFontFamilySettings(); |
171 fontCacheInvalidated(); | 171 fontCacheInvalidated(); |
172 } | 172 } |
173 | 173 |
174 DEFINE_TRACE(CSSFontSelector) { | 174 DEFINE_TRACE(CSSFontSelector) { |
175 visitor->trace(m_document); | 175 visitor->trace(m_document); |
176 visitor->trace(m_clients); | 176 visitor->trace(m_clients); |
177 FontSelector::trace(visitor); | 177 FontSelector::trace(visitor); |
178 } | 178 } |
179 | 179 |
180 } // namespace blink | 180 } // namespace blink |
OLD | NEW |