| 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 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 } | 489 } |
| 490 } | 490 } |
| 491 | 491 |
| 492 static const char* supplementName() | 492 static const char* supplementName() |
| 493 { | 493 { |
| 494 return "FontFaceSet"; | 494 return "FontFaceSet"; |
| 495 } | 495 } |
| 496 | 496 |
| 497 RawPtr<FontFaceSet> FontFaceSet::from(Document& document) | 497 RawPtr<FontFaceSet> FontFaceSet::from(Document& document) |
| 498 { | 498 { |
| 499 RawPtr<FontFaceSet> fonts = static_cast<FontFaceSet*>(SupplementType::from(d
ocument, supplementName())); | 499 RawPtr<FontFaceSet> fonts = static_cast<FontFaceSet*>(Supplement<Document>::
from(document, supplementName())); |
| 500 if (!fonts) { | 500 if (!fonts) { |
| 501 fonts = FontFaceSet::create(document); | 501 fonts = FontFaceSet::create(document); |
| 502 SupplementType::provideTo(document, supplementName(), fonts); | 502 Supplement<Document>::provideTo(document, supplementName(), fonts); |
| 503 } | 503 } |
| 504 | 504 |
| 505 return fonts.release(); | 505 return fonts.release(); |
| 506 } | 506 } |
| 507 | 507 |
| 508 void FontFaceSet::didLayout(Document& document) | 508 void FontFaceSet::didLayout(Document& document) |
| 509 { | 509 { |
| 510 if (FontFaceSet* fonts = static_cast<FontFaceSet*>(SupplementType::from(docu
ment, supplementName()))) | 510 if (FontFaceSet* fonts = static_cast<FontFaceSet*>(Supplement<Document>::fro
m(document, supplementName()))) |
| 511 fonts->didLayout(); | 511 fonts->didLayout(); |
| 512 } | 512 } |
| 513 | 513 |
| 514 FontFaceSetIterable::IterationSource* FontFaceSet::startIteration(ScriptState*,
ExceptionState&) | 514 FontFaceSetIterable::IterationSource* FontFaceSet::startIteration(ScriptState*,
ExceptionState&) |
| 515 { | 515 { |
| 516 // Setlike should iterate each item in insertion order, and items should | 516 // Setlike should iterate each item in insertion order, and items should |
| 517 // be keep on up to date. But since blink does not have a way to hook up CSS | 517 // be keep on up to date. But since blink does not have a way to hook up CSS |
| 518 // modification, take a snapshot here, and make it ordered as follows. | 518 // modification, take a snapshot here, and make it ordered as follows. |
| 519 HeapVector<Member<FontFace>> fontFaces; | 519 HeapVector<Member<FontFace>> fontFaces; |
| 520 if (inActiveDocumentContext()) { | 520 if (inActiveDocumentContext()) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 531 bool FontFaceSet::IterationSource::next(ScriptState*, Member<FontFace>& key, Mem
ber<FontFace>& value, ExceptionState&) | 531 bool FontFaceSet::IterationSource::next(ScriptState*, Member<FontFace>& key, Mem
ber<FontFace>& value, ExceptionState&) |
| 532 { | 532 { |
| 533 if (m_fontFaces.size() <= m_index) | 533 if (m_fontFaces.size() <= m_index) |
| 534 return false; | 534 return false; |
| 535 key = value = m_fontFaces[m_index++]; | 535 key = value = m_fontFaces[m_index++]; |
| 536 return true; | 536 return true; |
| 537 } | 537 } |
| 538 | 538 |
| 539 DEFINE_TRACE(FontFaceSet) | 539 DEFINE_TRACE(FontFaceSet) |
| 540 { | 540 { |
| 541 #if ENABLE(OILPAN) | |
| 542 visitor->trace(m_ready); | 541 visitor->trace(m_ready); |
| 543 visitor->trace(m_loadingFonts); | 542 visitor->trace(m_loadingFonts); |
| 544 visitor->trace(m_loadedFonts); | 543 visitor->trace(m_loadedFonts); |
| 545 visitor->trace(m_failedFonts); | 544 visitor->trace(m_failedFonts); |
| 546 visitor->trace(m_nonCSSConnectedFaces); | 545 visitor->trace(m_nonCSSConnectedFaces); |
| 547 visitor->trace(m_asyncRunner); | 546 visitor->trace(m_asyncRunner); |
| 548 HeapSupplement<Document>::trace(visitor); | |
| 549 #endif | |
| 550 EventTargetWithInlineData::trace(visitor); | 547 EventTargetWithInlineData::trace(visitor); |
| 548 Supplement<Document>::trace(visitor); |
| 551 ActiveDOMObject::trace(visitor); | 549 ActiveDOMObject::trace(visitor); |
| 552 } | 550 } |
| 553 | 551 |
| 554 } // namespace blink | 552 } // namespace blink |
| OLD | NEW |