Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: third_party/WebKit/Source/core/css/CSSImageSetValue.cpp

Issue 1458083002: Support fragment URLs for more kinds of SVG images (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplification wasn't simple enough Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, options); 119 FetchRequest request(ResourceRequest(document->completeURL(image.imageUR L)), FetchInitiatorTypeNames::css, options);
120 request.mutableResourceRequest().setHTTPReferrer(image.referrer); 120 request.mutableResourceRequest().setHTTPReferrer(image.referrer);
121 121
122 if (options.corsEnabled == IsCORSEnabled) 122 if (options.corsEnabled == IsCORSEnabled)
123 request.setCrossOriginAccessControl(document->securityOrigin(), opti ons.allowCredentials, options.credentialsRequested); 123 request.setCrossOriginAccessControl(document->securityOrigin(), opti ons.allowCredentials, options.credentialsRequested);
124 124
125 if (ResourcePtr<ImageResource> cachedImage = ImageResource::fetch(reques t, document->fetcher())) { 125 if (ResourcePtr<ImageResource> cachedImage = ImageResource::fetch(reques t, document->fetcher())) {
126 m_cachedImageSet = StyleFetchedImageSet::create(cachedImage.get(), i mage.scaleFactor, this); 126 m_cachedImageSet = StyleFetchedImageSet::create(cachedImage.get(), i mage.scaleFactor, this, request.url());
127 m_cachedScaleFactor = deviceScaleFactor; 127 m_cachedScaleFactor = deviceScaleFactor;
128 m_isCachePending = false; 128 m_isCachePending = false;
129 } 129 }
130 } 130 }
131 131
132 return m_cachedImageSet.get(); 132 return m_cachedImageSet.get();
133 } 133 }
134 134
135 StyleFetchedImageSet* CSSImageSetValue::cacheImageSet(Document* document, float deviceScaleFactor) 135 StyleFetchedImageSet* CSSImageSetValue::cacheImageSet(Document* document, float deviceScaleFactor)
136 { 136 {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 PassRefPtrWillBeRawPtr<CSSImageSetValue> CSSImageSetValue::valueWithURLsMadeAbso lute() 185 PassRefPtrWillBeRawPtr<CSSImageSetValue> CSSImageSetValue::valueWithURLsMadeAbso lute()
186 { 186 {
187 RefPtrWillBeRawPtr<CSSImageSetValue> value = CSSImageSetValue::create(); 187 RefPtrWillBeRawPtr<CSSImageSetValue> value = CSSImageSetValue::create();
188 for (auto& item : *this) 188 for (auto& item : *this)
189 item->isImageValue() ? value->append(toCSSImageValue(*item).valueWithURL MadeAbsolute()) : value->append(item); 189 item->isImageValue() ? value->append(toCSSImageValue(*item).valueWithURL MadeAbsolute()) : value->append(item);
190 return value.release(); 190 return value.release();
191 } 191 }
192 192
193 193
194 } // namespace blink 194 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698