| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 // All forms of scale should be included: Page::pageScaleFactor(), Local
Frame::pageZoomFactor(), | 108 // All forms of scale should be included: Page::pageScaleFactor(), Local
Frame::pageZoomFactor(), |
| 109 // and any CSS transforms. https://bugs.webkit.org/show_bug.cgi?id=81698 | 109 // and any CSS transforms. https://bugs.webkit.org/show_bug.cgi?id=81698 |
| 110 ImageWithScale image = bestImageForScaleFactor(); | 110 ImageWithScale image = bestImageForScaleFactor(); |
| 111 FetchRequest request(ResourceRequest(document->completeURL(image.imageUR
L)), FetchInitiatorTypeNames::css, options); | 111 FetchRequest request(ResourceRequest(document->completeURL(image.imageUR
L)), FetchInitiatorTypeNames::css, options); |
| 112 request.mutableResourceRequest().setHTTPReferrer(image.referrer); | 112 request.mutableResourceRequest().setHTTPReferrer(image.referrer); |
| 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, request.url()); |
| 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) : nullptr; | 123 return (m_imageSet && m_imageSet->isImageResourceSet()) ? toStyleFetchedImag
eSet(m_imageSet) : nullptr; |
| 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()); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 return true; | 182 return true; |
| 183 } | 183 } |
| 184 | 184 |
| 185 DEFINE_TRACE_AFTER_DISPATCH(CSSImageSetValue) | 185 DEFINE_TRACE_AFTER_DISPATCH(CSSImageSetValue) |
| 186 { | 186 { |
| 187 visitor->trace(m_imageSet); | 187 visitor->trace(m_imageSet); |
| 188 CSSValueList::traceAfterDispatch(visitor); | 188 CSSValueList::traceAfterDispatch(visitor); |
| 189 } | 189 } |
| 190 | 190 |
| 191 } // namespace blink | 191 } // namespace blink |
| OLD | NEW |