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

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

Issue 1060483003: Add ImageLoader support for sizes based Client-Hints RW values (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix test failures Created 5 years, 8 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/HTMLImageElement.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 d87bcf5712d241df1d4e75084224bbd618ba91cb..63272e724db256a26a78815564b8c9dcc1c60d27 100644
--- a/Source/core/loader/ImageLoader.cpp
+++ b/Source/core/loader/ImageLoader.cpp
@@ -204,6 +204,13 @@ static void configureRequest(FetchRequest& request, ImageLoader::BypassMainWorld
AtomicString crossOriginMode = element.fastGetAttribute(HTMLNames::crossoriginAttr);
if (!crossOriginMode.isNull())
request.setCrossOriginAccessControl(element.document().securityOrigin(), crossOriginMode);
+
+ if (isHTMLImageElement(element)) {
+ FetchRequest::ResourceWidth resourceWidth;
+ resourceWidth.width = toHTMLImageElement(element).sourceSize(element);
+ resourceWidth.isSet = true;
+ request.setResourceWidth(resourceWidth);
+ }
}
inline void ImageLoader::dispatchErrorEvent()
« no previous file with comments | « Source/core/html/HTMLImageElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698