| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 StyleFetchedImageSet* CSSImageSetValue::cachedImageSet(ResourceFetcher* loader,
float deviceScaleFactor, const ResourceLoaderOptions& options) | 92 StyleFetchedImageSet* CSSImageSetValue::cachedImageSet(ResourceFetcher* loader,
float deviceScaleFactor, const ResourceLoaderOptions& options) |
| 93 { | 93 { |
| 94 ASSERT(loader); | 94 ASSERT(loader); |
| 95 | 95 |
| 96 m_scaleFactor = deviceScaleFactor; | 96 m_scaleFactor = deviceScaleFactor; |
| 97 | 97 |
| 98 if (!m_imagesInSet.size()) | 98 if (!m_imagesInSet.size()) |
| 99 fillImageSet(); | 99 fillImageSet(); |
| 100 | 100 |
| 101 if (!m_accessedBestFitImage) { | 101 if (!m_accessedBestFitImage) { |
| 102 // FIXME: In the future, we want to take much more than deviceScaleFacto
r into acount here. | |
| 103 // All forms of scale should be included: Page::pageScaleFactor(), Local
Frame::pageZoomFactor(), | |
| 104 // and any CSS transforms. https://bugs.webkit.org/show_bug.cgi?id=81698 | |
| 105 ImageWithScale image = bestImageForScaleFactor(); | 102 ImageWithScale image = bestImageForScaleFactor(); |
| 106 if (Document* document = loader->document()) { | 103 if (Document* document = loader->document()) { |
| 107 FetchRequest request(ResourceRequest(document->completeURL(image.ima
geURL)), FetchInitiatorTypeNames::css, options); | 104 FetchRequest request(ResourceRequest(document->completeURL(image.ima
geURL)), FetchInitiatorTypeNames::css, options); |
| 108 request.mutableResourceRequest().setHTTPReferrer(image.referrer); | 105 request.mutableResourceRequest().setHTTPReferrer(image.referrer); |
| 109 | 106 |
| 110 if (ResourcePtr<ImageResource> cachedImage = loader->fetchImage(requ
est)) { | 107 if (ResourcePtr<ImageResource> cachedImage = loader->fetchImage(requ
est)) { |
| 111 m_imageSet = StyleFetchedImageSet::create(cachedImage.get(), ima
ge.scaleFactor, this); | 108 m_imageSet = StyleFetchedImageSet::create(cachedImage.get(), ima
ge.scaleFactor, this); |
| 112 m_accessedBestFitImage = true; | 109 m_accessedBestFitImage = true; |
| 113 } | 110 } |
| 114 } | 111 } |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 { | 180 { |
| 184 // Non-CSSValueList data is not accessible through CSS OM, no need to clone. | 181 // Non-CSSValueList data is not accessible through CSS OM, no need to clone. |
| 185 } | 182 } |
| 186 | 183 |
| 187 PassRefPtr<CSSImageSetValue> CSSImageSetValue::cloneForCSSOM() const | 184 PassRefPtr<CSSImageSetValue> CSSImageSetValue::cloneForCSSOM() const |
| 188 { | 185 { |
| 189 return adoptRef(new CSSImageSetValue(*this)); | 186 return adoptRef(new CSSImageSetValue(*this)); |
| 190 } | 187 } |
| 191 | 188 |
| 192 } // namespace blink | 189 } // namespace blink |
| OLD | NEW |