| 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 (isCachePending(deviceScaleFactor)) { | 114 if (isCachePending(deviceScaleFactor)) { |
| 115 // FIXME: In the future, we want to take much more than deviceScaleFacto
r into acount here. | 115 // FIXME: In the future, we want to take much more than deviceScaleFacto
r into acount here. |
| 116 // All forms of scale should be included: Page::pageScaleFactor(), Local
Frame::pageZoomFactor(), | 116 // All forms of scale should be included: Page::pageScaleFactor(), Local
Frame::pageZoomFactor(), |
| 117 // and any CSS transforms. https://bugs.webkit.org/show_bug.cgi?id=81698 | 117 // and any CSS transforms. https://bugs.webkit.org/show_bug.cgi?id=81698 |
| 118 ImageWithScale image = bestImageForScaleFactor(deviceScaleFactor); | 118 ImageWithScale image = bestImageForScaleFactor(deviceScaleFactor); |
| 119 FetchRequest request(ResourceRequest(document->completeURL(image.imageUR
L)), FetchInitiatorTypeNames::css); | 119 FetchRequest request(ResourceRequest(document->completeURL(image.imageUR
L)), FetchInitiatorTypeNames::css); |
| 120 request.mutableResourceRequest().setHTTPReferrer(image.referrer); | 120 request.mutableResourceRequest().setHTTPReferrer(image.referrer); |
| 121 | 121 |
| 122 if (crossOrigin != CrossOriginAttributeNotSet) | 122 if (crossOrigin != CrossOriginAttributeNotSet) |
| 123 request.setCrossOriginAccessControl(document->securityOrigin(), cros
sOrigin); | 123 request.setCrossOriginAccessControl(document->getSecurityOrigin(), c
rossOrigin); |
| 124 | 124 |
| 125 if (RefPtrWillBeRawPtr<ImageResource> cachedImage = ImageResource::fetch
(request, document->fetcher())) | 125 if (RefPtrWillBeRawPtr<ImageResource> cachedImage = ImageResource::fetch
(request, document->fetcher())) |
| 126 m_cachedImage = StyleFetchedImageSet::create(cachedImage.get(), imag
e.scaleFactor, this, request.url()); | 126 m_cachedImage = StyleFetchedImageSet::create(cachedImage.get(), imag
e.scaleFactor, this, request.url()); |
| 127 else | 127 else |
| 128 m_cachedImage = StyleInvalidImage::create(image.imageURL); | 128 m_cachedImage = StyleInvalidImage::create(image.imageURL); |
| 129 m_cachedScaleFactor = deviceScaleFactor; | 129 m_cachedScaleFactor = deviceScaleFactor; |
| 130 } | 130 } |
| 131 | 131 |
| 132 return m_cachedImage.get(); | 132 return m_cachedImage.get(); |
| 133 } | 133 } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 PassRefPtrWillBeRawPtr<CSSImageSetValue> CSSImageSetValue::valueWithURLsMadeAbso
lute() | 180 PassRefPtrWillBeRawPtr<CSSImageSetValue> CSSImageSetValue::valueWithURLsMadeAbso
lute() |
| 181 { | 181 { |
| 182 RefPtrWillBeRawPtr<CSSImageSetValue> value = CSSImageSetValue::create(); | 182 RefPtrWillBeRawPtr<CSSImageSetValue> value = CSSImageSetValue::create(); |
| 183 for (auto& item : *this) | 183 for (auto& item : *this) |
| 184 item->isImageValue() ? value->append(toCSSImageValue(*item).valueWithURL
MadeAbsolute()) : value->append(item); | 184 item->isImageValue() ? value->append(toCSSImageValue(*item).valueWithURL
MadeAbsolute()) : value->append(item); |
| 185 return value.release(); | 185 return value.release(); |
| 186 } | 186 } |
| 187 | 187 |
| 188 | 188 |
| 189 } // namespace blink | 189 } // namespace blink |
| OLD | NEW |