OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google 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 are met: | 5 * modification, are permitted provided that the following conditions are met: |
6 * | 6 * |
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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 Document* d = document(); | 355 Document* d = document(); |
356 d->ensureStyleResolver(); // Flush pending style changes. | 356 d->ensureStyleResolver(); // Flush pending style changes. |
357 return d->styleEngine()->fontSelector()->fontFaceCache()->cssConnectedFontFa
ces(); | 357 return d->styleEngine()->fontSelector()->fontFaceCache()->cssConnectedFontFa
ces(); |
358 } | 358 } |
359 | 359 |
360 bool FontFaceSet::isCSSConnectedFontFace(FontFace* fontFace) const | 360 bool FontFaceSet::isCSSConnectedFontFace(FontFace* fontFace) const |
361 { | 361 { |
362 return cssConnectedFontFaceList().contains(fontFace); | 362 return cssConnectedFontFaceList().contains(fontFace); |
363 } | 363 } |
364 | 364 |
365 void FontFaceSet::forEach(PassOwnPtr<FontFaceSetForEachCallback> callback, Scrip
tValue& thisArg) const | 365 void FontFaceSet::forEach(PassOwnPtr<FontFaceSetForEachCallback> callback, const
ScriptValue& thisArg) const |
366 { | 366 { |
367 forEachInternal(callback, &thisArg); | 367 forEachInternal(callback, &thisArg); |
368 } | 368 } |
369 | 369 |
370 void FontFaceSet::forEach(PassOwnPtr<FontFaceSetForEachCallback> callback) const | 370 void FontFaceSet::forEach(PassOwnPtr<FontFaceSetForEachCallback> callback) const |
371 { | 371 { |
372 forEachInternal(callback, 0); | 372 forEachInternal(callback, 0); |
373 } | 373 } |
374 | 374 |
375 void FontFaceSet::forEachInternal(PassOwnPtr<FontFaceSetForEachCallback> callbac
k, ScriptValue* thisArg) const | 375 void FontFaceSet::forEachInternal(PassOwnPtr<FontFaceSetForEachCallback> callbac
k, const ScriptValue* thisArg) const |
376 { | 376 { |
377 if (!inActiveDocumentContext()) | 377 if (!inActiveDocumentContext()) |
378 return; | 378 return; |
379 const WillBeHeapListHashSet<RefPtrWillBeMember<FontFace> >& cssConnectedFace
s = cssConnectedFontFaceList(); | 379 const WillBeHeapListHashSet<RefPtrWillBeMember<FontFace> >& cssConnectedFace
s = cssConnectedFontFaceList(); |
380 WillBeHeapVector<RefPtrWillBeMember<FontFace> > fontFaces; | 380 WillBeHeapVector<RefPtrWillBeMember<FontFace> > fontFaces; |
381 fontFaces.reserveInitialCapacity(cssConnectedFaces.size() + m_nonCSSConnecte
dFaces.size()); | 381 fontFaces.reserveInitialCapacity(cssConnectedFaces.size() + m_nonCSSConnecte
dFaces.size()); |
382 for (WillBeHeapListHashSet<RefPtrWillBeMember<FontFace> >::const_iterator it
= cssConnectedFaces.begin(); it != cssConnectedFaces.end(); ++it) | 382 for (WillBeHeapListHashSet<RefPtrWillBeMember<FontFace> >::const_iterator it
= cssConnectedFaces.begin(); it != cssConnectedFaces.end(); ++it) |
383 fontFaces.append(*it); | 383 fontFaces.append(*it); |
384 for (WillBeHeapListHashSet<RefPtrWillBeMember<FontFace> >::const_iterator it
= m_nonCSSConnectedFaces.begin(); it != m_nonCSSConnectedFaces.end(); ++it) | 384 for (WillBeHeapListHashSet<RefPtrWillBeMember<FontFace> >::const_iterator it
= m_nonCSSConnectedFaces.begin(); it != m_nonCSSConnectedFaces.end(); ++it) |
385 fontFaces.append(*it); | 385 fontFaces.append(*it); |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 visitor->trace(m_loadingFonts); | 598 visitor->trace(m_loadingFonts); |
599 visitor->trace(m_loadedFonts); | 599 visitor->trace(m_loadedFonts); |
600 visitor->trace(m_failedFonts); | 600 visitor->trace(m_failedFonts); |
601 visitor->trace(m_nonCSSConnectedFaces); | 601 visitor->trace(m_nonCSSConnectedFaces); |
602 DocumentSupplement::trace(visitor); | 602 DocumentSupplement::trace(visitor); |
603 EventTargetWithInlineData::trace(visitor); | 603 EventTargetWithInlineData::trace(visitor); |
604 } | 604 } |
605 #endif | 605 #endif |
606 | 606 |
607 } // namespace blink | 607 } // namespace blink |
OLD | NEW |