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

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

Issue 261753011: Revert of Make CSSFontFace::willUseFontData() load fonts with unicode-range (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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
« no previous file with comments | « Source/core/css/CSSSegmentedFontFace.h ('k') | Source/core/rendering/RenderText.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 177
178 bool CSSSegmentedFontFace::isLoaded() const 178 bool CSSSegmentedFontFace::isLoaded() const
179 { 179 {
180 for (FontFaceList::const_iterator it = m_fontFaces.begin(); it != m_fontFace s.end(); ++it) { 180 for (FontFaceList::const_iterator it = m_fontFaces.begin(); it != m_fontFace s.end(); ++it) {
181 if ((*it)->loadStatus() != FontFace::Loaded) 181 if ((*it)->loadStatus() != FontFace::Loaded)
182 return false; 182 return false;
183 } 183 }
184 return true; 184 return true;
185 } 185 }
186 186
187 void CSSSegmentedFontFace::willUseFontData(const FontDescription& fontDescriptio n, UChar32 character) 187 void CSSSegmentedFontFace::willUseFontData(const FontDescription& fontDescriptio n)
188 { 188 {
189 for (FontFaceList::reverse_iterator it = m_fontFaces.rbegin(); it != m_fontF aces.rend(); ++it) { 189 for (FontFaceList::iterator it = m_fontFaces.begin(); it != m_fontFaces.end( ); ++it)
190 if ((*it)->loadStatus() != FontFace::Unloaded) 190 (*it)->cssFontFace()->willUseFontData(fontDescription);
191 break;
192 if ((*it)->cssFontFace()->maybeScheduleFontLoad(fontDescription, charact er))
193 break;
194 }
195 } 191 }
196 192
197 bool CSSSegmentedFontFace::checkFont(const String& text) const 193 bool CSSSegmentedFontFace::checkFont(const String& text) const
198 { 194 {
199 for (FontFaceList::const_iterator it = m_fontFaces.begin(); it != m_fontFace s.end(); ++it) { 195 for (FontFaceList::const_iterator it = m_fontFaces.begin(); it != m_fontFace s.end(); ++it) {
200 if ((*it)->loadStatus() != FontFace::Loaded && (*it)->cssFontFace()->ran ges().intersectsWith(text)) 196 if ((*it)->loadStatus() != FontFace::Loaded && (*it)->cssFontFace()->ran ges().intersectsWith(text))
201 return false; 197 return false;
202 } 198 }
203 return true; 199 return true;
204 } 200 }
205 201
206 void CSSSegmentedFontFace::match(const String& text, WillBeHeapVector<RefPtrWill BeMember<FontFace> >& faces) const 202 void CSSSegmentedFontFace::match(const String& text, WillBeHeapVector<RefPtrWill BeMember<FontFace> >& faces) const
207 { 203 {
208 for (FontFaceList::const_iterator it = m_fontFaces.begin(); it != m_fontFace s.end(); ++it) { 204 for (FontFaceList::const_iterator it = m_fontFaces.begin(); it != m_fontFace s.end(); ++it) {
209 if ((*it)->cssFontFace()->ranges().intersectsWith(text)) 205 if ((*it)->cssFontFace()->ranges().intersectsWith(text))
210 faces.append(*it); 206 faces.append(*it);
211 } 207 }
212 } 208 }
213 209
214 void CSSSegmentedFontFace::trace(Visitor* visitor) 210 void CSSSegmentedFontFace::trace(Visitor* visitor)
215 { 211 {
216 visitor->trace(m_fontSelector); 212 visitor->trace(m_fontSelector);
217 visitor->trace(m_fontFaces); 213 visitor->trace(m_fontFaces);
218 } 214 }
219 215
220 } 216 }
OLDNEW
« no previous file with comments | « Source/core/css/CSSSegmentedFontFace.h ('k') | Source/core/rendering/RenderText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698