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

Unified Diff: third_party/WebKit/Source/core/css/CSSImageSetValue.cpp

Issue 2423683002: Add Blink support for showing image placeholders using range requests. (Closed)
Patch Set: Created 4 years, 2 months 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/CSSImageSetValue.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSImageSetValue.cpp b/third_party/WebKit/Source/core/css/CSSImageSetValue.cpp
index 4357df9a80159457e9a3028d6f717e2b8c4068c5..99677c8cdc015297d1fbde794910d4708dc259c7 100644
--- a/third_party/WebKit/Source/core/css/CSSImageSetValue.cpp
+++ b/third_party/WebKit/Source/core/css/CSSImageSetValue.cpp
@@ -33,6 +33,7 @@
#include "core/fetch/ImageResource.h"
#include "core/fetch/ResourceFetcher.h"
#include "core/fetch/ResourceLoaderOptions.h"
+#include "core/frame/Settings.h"
#include "core/style/StyleFetchedImageSet.h"
#include "core/style/StyleInvalidImage.h"
#include "platform/weborigin/KURL.h"
@@ -116,6 +117,10 @@ StyleImage* CSSImageSetValue::cacheImage(
if (crossOrigin != CrossOriginAttributeNotSet)
request.setCrossOriginAccessControl(document.getSecurityOrigin(),
crossOrigin);
+ request.setPlaceholderImageRequestType(
+ document.settings() && document.settings()->fetchImagePlaceholders()
+ ? FetchRequest::AllowPlaceholder
+ : FetchRequest::DisallowPlaceholder);
if (ImageResource* cachedImage =
ImageResource::fetch(request, document.fetcher()))

Powered by Google App Engine
This is Rietveld 408576698