| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 bool CSSSegmentedFontFace::isValid() const | 64 bool CSSSegmentedFontFace::isValid() const |
| 65 { | 65 { |
| 66 // Valid if at least one font face is valid. | 66 // Valid if at least one font face is valid. |
| 67 for (FontFaceList::const_iterator it = m_fontFaces.begin(); it != m_fontFace
s.end(); ++it) { | 67 for (FontFaceList::const_iterator it = m_fontFaces.begin(); it != m_fontFace
s.end(); ++it) { |
| 68 if ((*it)->cssFontFace()->isValid()) | 68 if ((*it)->cssFontFace()->isValid()) |
| 69 return true; | 69 return true; |
| 70 } | 70 } |
| 71 return false; | 71 return false; |
| 72 } | 72 } |
| 73 | 73 |
| 74 void CSSSegmentedFontFace::fontLoaded(CSSFontFace*) | |
| 75 { | |
| 76 pruneTable(); | |
| 77 } | |
| 78 | |
| 79 void CSSSegmentedFontFace::fontLoadWaitLimitExceeded(CSSFontFace*) | |
| 80 { | |
| 81 pruneTable(); | |
| 82 } | |
| 83 | |
| 84 void CSSSegmentedFontFace::addFontFace(PassRefPtr<FontFace> prpFontFace, bool cs
sConnected) | 74 void CSSSegmentedFontFace::addFontFace(PassRefPtr<FontFace> prpFontFace, bool cs
sConnected) |
| 85 { | 75 { |
| 86 RefPtr<FontFace> fontFace = prpFontFace; | 76 RefPtr<FontFace> fontFace = prpFontFace; |
| 87 pruneTable(); | 77 pruneTable(); |
| 88 fontFace->cssFontFace()->setSegmentedFontFace(this); | 78 fontFace->cssFontFace()->setSegmentedFontFace(this); |
| 89 if (cssConnected) { | 79 if (cssConnected) { |
| 90 m_fontFaces.insertBefore(m_firstNonCssConnectedFace, fontFace); | 80 m_fontFaces.insertBefore(m_firstNonCssConnectedFace, fontFace); |
| 91 } else { | 81 } else { |
| 92 // This is the only place in Blink that is using addReturnIterator. | 82 // This is the only place in Blink that is using addReturnIterator. |
| 93 FontFaceList::iterator iterator = m_fontFaces.addReturnIterator(fontFace
); | 83 FontFaceList::iterator iterator = m_fontFaces.addReturnIterator(fontFace
); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 | 187 |
| 198 void CSSSegmentedFontFace::match(const String& text, Vector<RefPtr<FontFace> >&
faces) const | 188 void CSSSegmentedFontFace::match(const String& text, Vector<RefPtr<FontFace> >&
faces) const |
| 199 { | 189 { |
| 200 for (FontFaceList::const_iterator it = m_fontFaces.begin(); it != m_fontFace
s.end(); ++it) { | 190 for (FontFaceList::const_iterator it = m_fontFaces.begin(); it != m_fontFace
s.end(); ++it) { |
| 201 if ((*it)->cssFontFace()->ranges().intersectsWith(text)) | 191 if ((*it)->cssFontFace()->ranges().intersectsWith(text)) |
| 202 faces.append(*it); | 192 faces.append(*it); |
| 203 } | 193 } |
| 204 } | 194 } |
| 205 | 195 |
| 206 } | 196 } |
| OLD | NEW |