| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 StyleImage* CSSImageSetValue::CacheImage( | 101 StyleImage* CSSImageSetValue::CacheImage( |
| 102 const Document& document, | 102 const Document& document, |
| 103 float device_scale_factor, | 103 float device_scale_factor, |
| 104 CrossOriginAttributeValue cross_origin) { | 104 CrossOriginAttributeValue cross_origin) { |
| 105 if (!images_in_set_.size()) | 105 if (!images_in_set_.size()) |
| 106 FillImageSet(); | 106 FillImageSet(); |
| 107 | 107 |
| 108 if (IsCachePending(device_scale_factor)) { | 108 if (IsCachePending(device_scale_factor)) { |
| 109 // FIXME: In the future, we want to take much more than deviceScaleFactor | 109 // FIXME: In the future, we want to take much more than deviceScaleFactor |
| 110 // into acount here. All forms of scale should be included: | 110 // into acount here. All forms of scale should be included: |
| 111 // Page::pageScaleFactor(), LocalFrame::pageZoomFactor(), and any CSS | 111 // Page::PageScaleFactor(), LocalFrame::PageZoomFactor(), and any CSS |
| 112 // transforms. https://bugs.webkit.org/show_bug.cgi?id=81698 | 112 // transforms. https://bugs.webkit.org/show_bug.cgi?id=81698 |
| 113 ImageWithScale image = BestImageForScaleFactor(device_scale_factor); | 113 ImageWithScale image = BestImageForScaleFactor(device_scale_factor); |
| 114 ResourceRequest resource_request(document.CompleteURL(image.image_url)); | 114 ResourceRequest resource_request(document.CompleteURL(image.image_url)); |
| 115 resource_request.SetHTTPReferrer(image.referrer); | 115 resource_request.SetHTTPReferrer(image.referrer); |
| 116 FetchRequest request(resource_request, FetchInitiatorTypeNames::css); | 116 FetchRequest request(resource_request, FetchInitiatorTypeNames::css); |
| 117 | 117 |
| 118 if (cross_origin != kCrossOriginAttributeNotSet) | 118 if (cross_origin != kCrossOriginAttributeNotSet) |
| 119 request.SetCrossOriginAccessControl(document.GetSecurityOrigin(), | 119 request.SetCrossOriginAccessControl(document.GetSecurityOrigin(), |
| 120 cross_origin); | 120 cross_origin); |
| 121 if (document.GetSettings() && | 121 if (document.GetSettings() && |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 CSSImageSetValue* CSSImageSetValue::ValueWithURLsMadeAbsolute() { | 180 CSSImageSetValue* CSSImageSetValue::ValueWithURLsMadeAbsolute() { |
| 181 CSSImageSetValue* value = CSSImageSetValue::Create(); | 181 CSSImageSetValue* value = CSSImageSetValue::Create(); |
| 182 for (auto& item : *this) | 182 for (auto& item : *this) |
| 183 item->IsImageValue() | 183 item->IsImageValue() |
| 184 ? value->Append(*ToCSSImageValue(*item).ValueWithURLMadeAbsolute()) | 184 ? value->Append(*ToCSSImageValue(*item).ValueWithURLMadeAbsolute()) |
| 185 : value->Append(*item); | 185 : value->Append(*item); |
| 186 return value; | 186 return value; |
| 187 } | 187 } |
| 188 | 188 |
| 189 } // namespace blink | 189 } // namespace blink |
| OLD | NEW |