| 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 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 | 581 |
| 582 for (int i = 0; i < srcLength; i++) { | 582 for (int i = 0; i < srcLength; i++) { |
| 583 // An item in the list either specifies a string (local font name) or a
URL (remote font to download). | 583 // An item in the list either specifies a string (local font name) or a
URL (remote font to download). |
| 584 CSSFontFaceSrcValue* item = toCSSFontFaceSrcValue(srcList->item(i)); | 584 CSSFontFaceSrcValue* item = toCSSFontFaceSrcValue(srcList->item(i)); |
| 585 OwnPtrWillBeRawPtr<CSSFontFaceSource> source = nullptr; | 585 OwnPtrWillBeRawPtr<CSSFontFaceSource> source = nullptr; |
| 586 | 586 |
| 587 if (!item->isLocal()) { | 587 if (!item->isLocal()) { |
| 588 const Settings* settings = document ? document->settings() : nullptr
; | 588 const Settings* settings = document ? document->settings() : nullptr
; |
| 589 bool allowDownloading = settings && settings->downloadableBinaryFont
sEnabled(); | 589 bool allowDownloading = settings && settings->downloadableBinaryFont
sEnabled(); |
| 590 if (allowDownloading && item->isSupportedFormat() && document) { | 590 if (allowDownloading && item->isSupportedFormat() && document) { |
| 591 FontResource* fetched = item->fetch(document); | 591 RefPtrWillBeRawPtr<FontResource> fetched = item->fetch(document)
; |
| 592 if (fetched) { | 592 if (fetched) { |
| 593 FontLoader* fontLoader = document->styleEngine().fontSelecto
r()->fontLoader(); | 593 FontLoader* fontLoader = document->styleEngine().fontSelecto
r()->fontLoader(); |
| 594 source = adoptPtrWillBeNoop(new RemoteFontFaceSource(fetched
, fontLoader, CSSValueToFontDisplay(m_display.get()))); | 594 source = adoptPtrWillBeNoop(new RemoteFontFaceSource(fetched
.release(), fontLoader, CSSValueToFontDisplay(m_display.get()))); |
| 595 } | 595 } |
| 596 } | 596 } |
| 597 } else { | 597 } else { |
| 598 source = adoptPtrWillBeNoop(new LocalFontFaceSource(item->resource()
)); | 598 source = adoptPtrWillBeNoop(new LocalFontFaceSource(item->resource()
)); |
| 599 } | 599 } |
| 600 | 600 |
| 601 if (source) | 601 if (source) |
| 602 m_cssFontFace->addSource(source.release()); | 602 m_cssFontFace->addSource(source.release()); |
| 603 } | 603 } |
| 604 | 604 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 { | 643 { |
| 644 return m_cssFontFace->hadBlankText(); | 644 return m_cssFontFace->hadBlankText(); |
| 645 } | 645 } |
| 646 | 646 |
| 647 bool FontFace::hasPendingActivity() const | 647 bool FontFace::hasPendingActivity() const |
| 648 { | 648 { |
| 649 return m_status == Loading && executionContext() && !executionContext()->act
iveDOMObjectsAreStopped(); | 649 return m_status == Loading && executionContext() && !executionContext()->act
iveDOMObjectsAreStopped(); |
| 650 } | 650 } |
| 651 | 651 |
| 652 } // namespace blink | 652 } // namespace blink |
| OLD | NEW |