| 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, 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 } |
| OLD | NEW |