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

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

Issue 2795173002: Do not show image placeholders for CSS sprites (Closed)
Patch Set: rebased and addressed comments Created 3 years, 6 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 55b987308ca1a4c725c5432138dcff214305ce82..dc5e7869d9bab06859421ab5b48c25f389d3154b 100644
--- a/third_party/WebKit/Source/core/css/CSSImageSetValue.cpp
+++ b/third_party/WebKit/Source/core/css/CSSImageSetValue.cpp
@@ -30,6 +30,7 @@
#include "core/css/CSSPrimitiveValue.h"
#include "core/dom/Document.h"
#include "core/frame/LocalFrame.h"
+#include "core/frame/Settings.h"
#include "core/loader/resource/ImageResourceContent.h"
#include "core/style/StyleFetchedImageSet.h"
#include "core/style/StyleInvalidImage.h"
@@ -101,6 +102,7 @@ StyleImage* CSSImageSetValue::CachedImage(float device_scale_factor) const {
StyleImage* CSSImageSetValue::CacheImage(
const Document& document,
float device_scale_factor,
+ FetchParameters::PlaceholderImageRequestType placeholder_image_request_type,
CrossOriginAttributeValue cross_origin) {
if (!images_in_set_.size())
FillImageSet();
@@ -122,7 +124,9 @@ StyleImage* CSSImageSetValue::CacheImage(
params.SetCrossOriginAccessControl(document.GetSecurityOrigin(),
cross_origin);
}
- if (document.GetFrame())
+ if (document.GetFrame() && document.GetSettings() &&
+ document.GetSettings()->GetFetchImagePlaceholders() &&
sclittle 2017/06/13 00:28:27 Could you remove the Settings checks here? That lo
rajendrant 2017/06/21 19:00:57 Done.
+ placeholder_image_request_type == FetchParameters::kAllowPlaceholder)
document.GetFrame()->MaybeAllowImagePlaceholder(params);
if (ImageResourceContent* cached_image =

Powered by Google App Engine
This is Rietveld 408576698