| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 | 113 |
| 114 if (options.corsEnabled == IsCORSEnabled) | 114 if (options.corsEnabled == IsCORSEnabled) |
| 115 request.setCrossOriginAccessControl(document->securityOrigin(), opti
ons.allowCredentials, options.credentialsRequested); | 115 request.setCrossOriginAccessControl(document->securityOrigin(), opti
ons.allowCredentials, options.credentialsRequested); |
| 116 | 116 |
| 117 if (ResourcePtr<ImageResource> cachedImage = ImageResource::fetch(reques
t, document->fetcher())) { | 117 if (ResourcePtr<ImageResource> cachedImage = ImageResource::fetch(reques
t, document->fetcher())) { |
| 118 m_imageSet = StyleFetchedImageSet::create(cachedImage.get(), image.s
caleFactor, this); | 118 m_imageSet = StyleFetchedImageSet::create(cachedImage.get(), image.s
caleFactor, this); |
| 119 m_accessedBestFitImage = true; | 119 m_accessedBestFitImage = true; |
| 120 } | 120 } |
| 121 } | 121 } |
| 122 | 122 |
| 123 return (m_imageSet && m_imageSet->isImageResourceSet()) ? toStyleFetchedImag
eSet(m_imageSet) : 0; | 123 return (m_imageSet && m_imageSet->isImageResourceSet()) ? toStyleFetchedImag
eSet(m_imageSet.get()) : 0; |
| 124 } | 124 } |
| 125 | 125 |
| 126 StyleFetchedImageSet* CSSImageSetValue::cachedImageSet(Document* document, float
deviceScaleFactor) | 126 StyleFetchedImageSet* CSSImageSetValue::cachedImageSet(Document* document, float
deviceScaleFactor) |
| 127 { | 127 { |
| 128 return cachedImageSet(document, deviceScaleFactor, ResourceFetcher::defaultR
esourceOptions()); | 128 return cachedImageSet(document, deviceScaleFactor, ResourceFetcher::defaultR
esourceOptions()); |
| 129 } | 129 } |
| 130 | 130 |
| 131 StyleImage* CSSImageSetValue::cachedOrPendingImageSet(float deviceScaleFactor) | 131 StyleImage* CSSImageSetValue::cachedOrPendingImageSet(float deviceScaleFactor) |
| 132 { | 132 { |
| 133 if (!m_imageSet) { | 133 if (!m_imageSet) { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 } | 170 } |
| 171 | 171 |
| 172 result.append(')'); | 172 result.append(')'); |
| 173 return result.toString(); | 173 return result.toString(); |
| 174 } | 174 } |
| 175 | 175 |
| 176 bool CSSImageSetValue::hasFailedOrCanceledSubresources() const | 176 bool CSSImageSetValue::hasFailedOrCanceledSubresources() const |
| 177 { | 177 { |
| 178 if (!m_imageSet || !m_imageSet->isImageResourceSet()) | 178 if (!m_imageSet || !m_imageSet->isImageResourceSet()) |
| 179 return false; | 179 return false; |
| 180 if (Resource* cachedResource = toStyleFetchedImageSet(m_imageSet)->cachedIma
ge()) | 180 if (Resource* cachedResource = toStyleFetchedImageSet(m_imageSet.get())->cac
hedImage()) |
| 181 return cachedResource->loadFailedOrCanceled(); | 181 return cachedResource->loadFailedOrCanceled(); |
| 182 return true; | 182 return true; |
| 183 } | 183 } |
| 184 | 184 |
| 185 DEFINE_TRACE_AFTER_DISPATCH(CSSImageSetValue) | |
| 186 { | |
| 187 visitor->trace(m_imageSet); | |
| 188 CSSValueList::traceAfterDispatch(visitor); | |
| 189 } | |
| 190 | |
| 191 } // namespace blink | 185 } // namespace blink |
| OLD | NEW |