OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2009 Torch Mobile, Inc. | 3 * Copyright (C) 2009 Torch Mobile, Inc. |
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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 if (!collection) | 136 if (!collection) |
137 return 0; | 137 return 0; |
138 | 138 |
139 unsigned collectionLength = collection->length(); | 139 unsigned collectionLength = collection->length(); |
140 if (!collectionLength) | 140 if (!collectionLength) |
141 return 0; | 141 return 0; |
142 | 142 |
143 #ifndef NDEBUG | 143 #ifndef NDEBUG |
144 for (unsigned i = 0; i < collectionLength; ++i) { | 144 for (unsigned i = 0; i < collectionLength; ++i) { |
145 ASSERT(collection->item(i)); | 145 ASSERT(collection->item(i)); |
146 ASSERT(collection->item(i)->hasTagName(SVGNames::fontTag)); | 146 ASSERT(isSVGFontElement(collection->item(i))); |
147 } | 147 } |
148 #endif | 148 #endif |
149 | 149 |
150 if (fontName.isEmpty()) | 150 if (fontName.isEmpty()) |
151 return toSVGFontElement(collection->item(0)); | 151 return toSVGFontElement(collection->item(0)); |
152 | 152 |
153 for (unsigned i = 0; i < collectionLength; ++i) { | 153 for (unsigned i = 0; i < collectionLength; ++i) { |
154 SVGFontElement* element = toSVGFontElement(collection->item(i)); | 154 SVGFontElement* element = toSVGFontElement(collection->item(i)); |
155 if (element->getIdAttribute() == fontName) | 155 if (element->getIdAttribute() == fontName) |
156 return element; | 156 return element; |
(...skipping 26 matching lines...) Expand all Loading... |
183 | 183 |
184 void FontResource::checkNotify() | 184 void FontResource::checkNotify() |
185 { | 185 { |
186 m_fontLoadWaitLimitTimer.stop(); | 186 m_fontLoadWaitLimitTimer.stop(); |
187 ResourceClientWalker<FontResourceClient> w(m_clients); | 187 ResourceClientWalker<FontResourceClient> w(m_clients); |
188 while (FontResourceClient* c = w.next()) | 188 while (FontResourceClient* c = w.next()) |
189 c->fontLoaded(this); | 189 c->fontLoaded(this); |
190 } | 190 } |
191 | 191 |
192 } | 192 } |
OLD | NEW |