| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 99 |
| 100 if (!m_accessedBestFitImage) { | 100 if (!m_accessedBestFitImage) { |
| 101 // FIXME: In the future, we want to take much more than deviceScaleFacto
r into acount here. | 101 // FIXME: In the future, we want to take much more than deviceScaleFacto
r into acount here. |
| 102 // All forms of scale should be included: Page::pageScaleFactor(), Local
Frame::pageZoomFactor(), | 102 // All forms of scale should be included: Page::pageScaleFactor(), Local
Frame::pageZoomFactor(), |
| 103 // and any CSS transforms. https://bugs.webkit.org/show_bug.cgi?id=81698 | 103 // and any CSS transforms. https://bugs.webkit.org/show_bug.cgi?id=81698 |
| 104 ImageWithScale image = bestImageForScaleFactor(); | 104 ImageWithScale image = bestImageForScaleFactor(); |
| 105 if (Document* document = loader->document()) { | 105 if (Document* document = loader->document()) { |
| 106 FetchRequest request(ResourceRequest(document->completeURL(image.ima
geURL)), FetchInitiatorTypeNames::css, options); | 106 FetchRequest request(ResourceRequest(document->completeURL(image.ima
geURL)), FetchInitiatorTypeNames::css, options); |
| 107 | 107 |
| 108 if (options.corsEnabled == IsCORSEnabled) | 108 if (options.corsEnabled == IsCORSEnabled) |
| 109 request.setCrossOriginAccessControl(loader->document()->security
Origin(), options.allowCredentials, options.credentialsRequested); | 109 request.setCrossOriginAccessControl(loader->document()->security
Origin(), options.allowCredentials); |
| 110 | 110 |
| 111 if (ResourcePtr<ImageResource> cachedImage = loader->fetchImage(requ
est)) { | 111 if (ResourcePtr<ImageResource> cachedImage = loader->fetchImage(requ
est)) { |
| 112 m_imageSet = StyleFetchedImageSet::create(cachedImage.get(), ima
ge.scaleFactor, this); | 112 m_imageSet = StyleFetchedImageSet::create(cachedImage.get(), ima
ge.scaleFactor, this); |
| 113 m_accessedBestFitImage = true; | 113 m_accessedBestFitImage = true; |
| 114 } | 114 } |
| 115 } | 115 } |
| 116 } | 116 } |
| 117 | 117 |
| 118 return (m_imageSet && m_imageSet->isImageResourceSet()) ? toStyleFetchedImag
eSet(m_imageSet) : 0; | 118 return (m_imageSet && m_imageSet->isImageResourceSet()) ? toStyleFetchedImag
eSet(m_imageSet) : 0; |
| 119 } | 119 } |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 { | 184 { |
| 185 // Non-CSSValueList data is not accessible through CSS OM, no need to clone. | 185 // Non-CSSValueList data is not accessible through CSS OM, no need to clone. |
| 186 } | 186 } |
| 187 | 187 |
| 188 PassRefPtrWillBeRawPtr<CSSImageSetValue> CSSImageSetValue::cloneForCSSOM() const | 188 PassRefPtrWillBeRawPtr<CSSImageSetValue> CSSImageSetValue::cloneForCSSOM() const |
| 189 { | 189 { |
| 190 return adoptRefWillBeRefCountedGarbageCollected(new CSSImageSetValue(*this))
; | 190 return adoptRefWillBeRefCountedGarbageCollected(new CSSImageSetValue(*this))
; |
| 191 } | 191 } |
| 192 | 192 |
| 193 } // namespace WebCore | 193 } // namespace WebCore |
| OLD | NEW |