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

Unified Diff: Source/core/loader/ImageLoader.cpp

Issue 1186333004: Add support for `width` based Width Client Hint (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Moar comments Created 5 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
« no previous file with comments | « Source/core/html/parser/HTMLPreloadScannerTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/ImageLoader.cpp
diff --git a/Source/core/loader/ImageLoader.cpp b/Source/core/loader/ImageLoader.cpp
index bfc4bbe9bfed9f83dfda07734086dc4eccafb55f..61839baeff1931b2dde53b3823f984cf7912a416 100644
--- a/Source/core/loader/ImageLoader.cpp
+++ b/Source/core/loader/ImageLoader.cpp
@@ -219,12 +219,8 @@ static void configureRequest(FetchRequest& request, ImageLoader::BypassMainWorld
if (!crossOriginMode.isNull())
request.setCrossOriginAccessControl(element.document().securityOrigin(), crossOriginMode);
- if (clientHintsPreferences.shouldSendResourceWidth() && isHTMLImageElement(element)) {
- FetchRequest::ResourceWidth resourceWidth;
- resourceWidth.width = toHTMLImageElement(element).sourceSize(element);
- resourceWidth.isSet = true;
- request.setResourceWidth(resourceWidth);
- }
+ if (clientHintsPreferences.shouldSendResourceWidth() && isHTMLImageElement(element))
+ request.setResourceWidth(toHTMLImageElement(element).resourceWidth());
}
inline void ImageLoader::dispatchErrorEvent()
« no previous file with comments | « Source/core/html/parser/HTMLPreloadScannerTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698