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 | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 else | 386 else |
387 m_callbacks.append(callback); | 387 m_callbacks.append(callback); |
388 } | 388 } |
389 | 389 |
390 void FontFace::loadInternal(ExecutionContext* context) | 390 void FontFace::loadInternal(ExecutionContext* context) |
391 { | 391 { |
392 if (m_status != Unloaded) | 392 if (m_status != Unloaded) |
393 return; | 393 return; |
394 | 394 |
395 m_cssFontFace->load(); | 395 m_cssFontFace->load(); |
396 toDocument(context)->styleEngine()->fontSelector()->fontLoader()->loadPendin
gFonts(); | 396 toDocument(context)->styleEngine().fontSelector()->fontLoader()->loadPending
Fonts(); |
397 } | 397 } |
398 | 398 |
399 FontTraits FontFace::traits() const | 399 FontTraits FontFace::traits() const |
400 { | 400 { |
401 FontStyle style = FontStyleNormal; | 401 FontStyle style = FontStyleNormal; |
402 if (m_style) { | 402 if (m_style) { |
403 if (!m_style->isPrimitiveValue()) | 403 if (!m_style->isPrimitiveValue()) |
404 return 0; | 404 return 0; |
405 | 405 |
406 switch (toCSSPrimitiveValue(m_style.get())->getValueID()) { | 406 switch (toCSSPrimitiveValue(m_style.get())->getValueID()) { |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 // An item in the list either specifies a string (local font name) or a
URL (remote font to download). | 525 // An item in the list either specifies a string (local font name) or a
URL (remote font to download). |
526 CSSFontFaceSrcValue* item = toCSSFontFaceSrcValue(srcList->item(i)); | 526 CSSFontFaceSrcValue* item = toCSSFontFaceSrcValue(srcList->item(i)); |
527 OwnPtrWillBeRawPtr<CSSFontFaceSource> source = nullptr; | 527 OwnPtrWillBeRawPtr<CSSFontFaceSource> source = nullptr; |
528 | 528 |
529 if (!item->isLocal()) { | 529 if (!item->isLocal()) { |
530 Settings* settings = document ? document->frame() ? document->frame(
)->settings() : 0 : 0; | 530 Settings* settings = document ? document->frame() ? document->frame(
)->settings() : 0 : 0; |
531 bool allowDownloading = settings && settings->downloadableBinaryFont
sEnabled(); | 531 bool allowDownloading = settings && settings->downloadableBinaryFont
sEnabled(); |
532 if (allowDownloading && item->isSupportedFormat() && document) { | 532 if (allowDownloading && item->isSupportedFormat() && document) { |
533 FontResource* fetched = item->fetch(document); | 533 FontResource* fetched = item->fetch(document); |
534 if (fetched) { | 534 if (fetched) { |
535 FontLoader* fontLoader = document->styleEngine()->fontSelect
or()->fontLoader(); | 535 FontLoader* fontLoader = document->styleEngine().fontSelecto
r()->fontLoader(); |
536 source = adoptPtrWillBeNoop(new RemoteFontFaceSource(fetched
, fontLoader)); | 536 source = adoptPtrWillBeNoop(new RemoteFontFaceSource(fetched
, fontLoader)); |
537 } | 537 } |
538 } | 538 } |
539 } else { | 539 } else { |
540 source = adoptPtrWillBeNoop(new LocalFontFaceSource(item->resource()
)); | 540 source = adoptPtrWillBeNoop(new LocalFontFaceSource(item->resource()
)); |
541 } | 541 } |
542 | 542 |
543 if (source) | 543 if (source) |
544 m_cssFontFace->addSource(source.release()); | 544 m_cssFontFace->addSource(source.release()); |
545 } | 545 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 { | 580 { |
581 return m_cssFontFace->hadBlankText(); | 581 return m_cssFontFace->hadBlankText(); |
582 } | 582 } |
583 | 583 |
584 bool FontFace::hasPendingActivity() const | 584 bool FontFace::hasPendingActivity() const |
585 { | 585 { |
586 return m_status == Loading && executionContext() && !executionContext()->act
iveDOMObjectsAreStopped(); | 586 return m_status == Loading && executionContext() && !executionContext()->act
iveDOMObjectsAreStopped(); |
587 } | 587 } |
588 | 588 |
589 } // namespace blink | 589 } // namespace blink |
OLD | NEW |