| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2010 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 result.append(m_resource); | 68 result.append(m_resource); |
| 69 result.append(')'); | 69 result.append(')'); |
| 70 if (!m_format.isEmpty()) { | 70 if (!m_format.isEmpty()) { |
| 71 result.appendLiteral(" format("); | 71 result.appendLiteral(" format("); |
| 72 result.append(m_format); | 72 result.append(m_format); |
| 73 result.append(')'); | 73 result.append(')'); |
| 74 } | 74 } |
| 75 return result.toString(); | 75 return result.toString(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 bool CSSFontFaceSrcValue::hasFailedOrCanceledSubresources() const | |
| 79 { | |
| 80 if (!m_fetched) | |
| 81 return false; | |
| 82 return m_fetched->loadFailedOrCanceled(); | |
| 83 } | |
| 84 | |
| 85 FontResource* CSSFontFaceSrcValue::fetch(Document* document) | 78 FontResource* CSSFontFaceSrcValue::fetch(Document* document) |
| 86 { | 79 { |
| 87 if (!m_fetched) { | 80 if (!m_fetched) { |
| 88 FetchRequest request(ResourceRequest(document->completeURL(m_resource)),
FetchInitiatorTypeNames::css); | 81 FetchRequest request(ResourceRequest(document->completeURL(m_resource)),
FetchInitiatorTypeNames::css); |
| 89 request.mutableResourceRequest().setHTTPReferrer(m_referrer); | 82 request.mutableResourceRequest().setHTTPReferrer(m_referrer); |
| 90 m_fetched = document->fetcher()->fetchFont(request); | 83 m_fetched = document->fetcher()->fetchFont(request); |
| 91 } else { | 84 } else { |
| 92 // FIXME: CSSFontFaceSrcValue::fetch is invoked when @font-face rule | 85 // FIXME: CSSFontFaceSrcValue::fetch is invoked when @font-face rule |
| 93 // is processed by StyleResolver / StyleEngine. | 86 // is processed by StyleResolver / StyleEngine. |
| 94 restoreCachedResourceIfNeeded(document); | 87 restoreCachedResourceIfNeeded(document); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 108 FetchRequest request(ResourceRequest(resourceURL), FetchInitiatorTypeNames::
css); | 101 FetchRequest request(ResourceRequest(resourceURL), FetchInitiatorTypeNames::
css); |
| 109 document->fetcher()->requestLoadStarted(m_fetched.get(), request, ResourceFe
tcher::ResourceLoadingFromCache); | 102 document->fetcher()->requestLoadStarted(m_fetched.get(), request, ResourceFe
tcher::ResourceLoadingFromCache); |
| 110 } | 103 } |
| 111 | 104 |
| 112 bool CSSFontFaceSrcValue::equals(const CSSFontFaceSrcValue& other) const | 105 bool CSSFontFaceSrcValue::equals(const CSSFontFaceSrcValue& other) const |
| 113 { | 106 { |
| 114 return m_isLocal == other.m_isLocal && m_format == other.m_format && m_resou
rce == other.m_resource; | 107 return m_isLocal == other.m_isLocal && m_format == other.m_format && m_resou
rce == other.m_resource; |
| 115 } | 108 } |
| 116 | 109 |
| 117 } | 110 } |
| OLD | NEW |