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

Side by Side Diff: Source/core/css/CSSFontSelector.cpp

Issue 324293003: Change FontFaceSet#check() behavior when no matched font-face (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 return FontCache::fontCache()->getFontData(fontDescription, settingsFamilyNa me); 142 return FontCache::fontCache()->getFontData(fontDescription, settingsFamilyNa me);
143 } 143 }
144 144
145 void CSSFontSelector::willUseFontData(const FontDescription& fontDescription, co nst AtomicString& family, UChar32 character) 145 void CSSFontSelector::willUseFontData(const FontDescription& fontDescription, co nst AtomicString& family, UChar32 character)
146 { 146 {
147 CSSSegmentedFontFace* face = m_fontFaceCache.get(fontDescription, family); 147 CSSSegmentedFontFace* face = m_fontFaceCache.get(fontDescription, family);
148 if (face) 148 if (face)
149 face->willUseFontData(fontDescription, character); 149 face->willUseFontData(fontDescription, character);
150 } 150 }
151 151
152 bool CSSFontSelector::isPlatformFontAvailable(const FontDescription& fontDescrip tion, const AtomicString& passedFamily)
153 {
154 AtomicString family = familyNameFromSettings(m_genericFontFamilySettings, fo ntDescription, passedFamily);
155 if (family.isEmpty())
156 family = passedFamily;
157 return FontCache::fontCache()->isPlatformFontAvailable(fontDescription, fami ly);
158 }
159
152 #if !ENABLE(OILPAN) 160 #if !ENABLE(OILPAN)
153 void CSSFontSelector::clearDocument() 161 void CSSFontSelector::clearDocument()
154 { 162 {
155 m_fontLoader->clearResourceFetcher(); 163 m_fontLoader->clearResourceFetcher();
156 m_document = nullptr; 164 m_document = nullptr;
157 } 165 }
158 #endif 166 #endif
159 167
160 void CSSFontSelector::updateGenericFontFamilySettings(Document& document) 168 void CSSFontSelector::updateGenericFontFamilySettings(Document& document)
161 { 169 {
162 if (!document.settings()) 170 if (!document.settings())
163 return; 171 return;
164 m_genericFontFamilySettings = document.settings()->genericFontFamilySettings (); 172 m_genericFontFamilySettings = document.settings()->genericFontFamilySettings ();
165 } 173 }
166 174
167 void CSSFontSelector::trace(Visitor* visitor) 175 void CSSFontSelector::trace(Visitor* visitor)
168 { 176 {
169 visitor->trace(m_document); 177 visitor->trace(m_document);
170 visitor->trace(m_fontFaceCache); 178 visitor->trace(m_fontFaceCache);
171 visitor->trace(m_clients); 179 visitor->trace(m_clients);
172 visitor->trace(m_fontLoader); 180 visitor->trace(m_fontLoader);
173 FontSelector::trace(visitor); 181 FontSelector::trace(visitor);
174 } 182 }
175 183
176 } 184 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698