OLD | NEW |
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 Loading... |
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) | 187 void CSSSegmentedFontFace::willUseFontData(const FontDescription& fontDescriptio
n, UChar32 character) |
188 { | 188 { |
189 for (FontFaceList::iterator it = m_fontFaces.begin(); it != m_fontFaces.end(
); ++it) | 189 for (FontFaceList::reverse_iterator it = m_fontFaces.rbegin(); it != m_fontF
aces.rend(); ++it) { |
190 (*it)->cssFontFace()->willUseFontData(fontDescription); | 190 if ((*it)->loadStatus() != FontFace::Unloaded) |
| 191 break; |
| 192 if ((*it)->cssFontFace()->maybeScheduleFontLoad(fontDescription, charact
er)) |
| 193 break; |
| 194 } |
191 } | 195 } |
192 | 196 |
193 bool CSSSegmentedFontFace::checkFont(const String& text) const | 197 bool CSSSegmentedFontFace::checkFont(const String& text) const |
194 { | 198 { |
195 for (FontFaceList::const_iterator it = m_fontFaces.begin(); it != m_fontFace
s.end(); ++it) { | 199 for (FontFaceList::const_iterator it = m_fontFaces.begin(); it != m_fontFace
s.end(); ++it) { |
196 if ((*it)->loadStatus() != FontFace::Loaded && (*it)->cssFontFace()->ran
ges().intersectsWith(text)) | 200 if ((*it)->loadStatus() != FontFace::Loaded && (*it)->cssFontFace()->ran
ges().intersectsWith(text)) |
197 return false; | 201 return false; |
198 } | 202 } |
199 return true; | 203 return true; |
200 } | 204 } |
201 | 205 |
202 void CSSSegmentedFontFace::match(const String& text, WillBeHeapVector<RefPtrWill
BeMember<FontFace> >& faces) const | 206 void CSSSegmentedFontFace::match(const String& text, WillBeHeapVector<RefPtrWill
BeMember<FontFace> >& faces) const |
203 { | 207 { |
204 for (FontFaceList::const_iterator it = m_fontFaces.begin(); it != m_fontFace
s.end(); ++it) { | 208 for (FontFaceList::const_iterator it = m_fontFaces.begin(); it != m_fontFace
s.end(); ++it) { |
205 if ((*it)->cssFontFace()->ranges().intersectsWith(text)) | 209 if ((*it)->cssFontFace()->ranges().intersectsWith(text)) |
206 faces.append(*it); | 210 faces.append(*it); |
207 } | 211 } |
208 } | 212 } |
209 | 213 |
210 void CSSSegmentedFontFace::trace(Visitor* visitor) | 214 void CSSSegmentedFontFace::trace(Visitor* visitor) |
211 { | 215 { |
212 visitor->trace(m_fontSelector); | 216 visitor->trace(m_fontSelector); |
213 visitor->trace(m_fontFaces); | 217 visitor->trace(m_fontFaces); |
214 } | 218 } |
215 | 219 |
216 } | 220 } |
OLD | NEW |