| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 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->getSecurityOrigin(), c
     rossOrigin); | 123             request.setCrossOriginAccessControl(document->getSecurityOrigin(), c
     rossOrigin); | 
| 124 | 124 | 
| 125         if (RawPtr<ImageResource> cachedImage = ImageResource::fetch(request, do
     cument->fetcher())) | 125         if (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, image.scal
     eFactor, 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 } | 
| 134 | 134 | 
| 135 String CSSImageSetValue::customCSSText() const | 135 String CSSImageSetValue::customCSSText() const | 
| 136 { | 136 { | 
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 170         return cachedResource->loadFailedOrCanceled(); | 170         return cachedResource->loadFailedOrCanceled(); | 
| 171     return true; | 171     return true; | 
| 172 } | 172 } | 
| 173 | 173 | 
| 174 DEFINE_TRACE_AFTER_DISPATCH(CSSImageSetValue) | 174 DEFINE_TRACE_AFTER_DISPATCH(CSSImageSetValue) | 
| 175 { | 175 { | 
| 176     visitor->trace(m_cachedImage); | 176     visitor->trace(m_cachedImage); | 
| 177     CSSValueList::traceAfterDispatch(visitor); | 177     CSSValueList::traceAfterDispatch(visitor); | 
| 178 } | 178 } | 
| 179 | 179 | 
| 180 RawPtr<CSSImageSetValue> CSSImageSetValue::valueWithURLsMadeAbsolute() | 180 CSSImageSetValue* CSSImageSetValue::valueWithURLsMadeAbsolute() | 
| 181 { | 181 { | 
| 182     RawPtr<CSSImageSetValue> value = CSSImageSetValue::create(); | 182     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; | 
| 186 } | 186 } | 
| 187 | 187 | 
| 188 | 188 | 
| 189 } // namespace blink | 189 } // namespace blink | 
| OLD | NEW | 
|---|