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

Unified Diff: Source/core/html/parser/HTMLSrcsetParser.cpp

Issue 1045353002: Avoid srcset upscaling for 1x DPR scenarios (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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 | « no previous file | Source/core/html/parser/HTMLSrcsetParserTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/parser/HTMLSrcsetParser.cpp
diff --git a/Source/core/html/parser/HTMLSrcsetParser.cpp b/Source/core/html/parser/HTMLSrcsetParser.cpp
index db1edd1bb6d30a7d9debb22f7f2393a16bd479cb..8283ecd41536a733ce2d23e426c427da4eeffa4c 100644
--- a/Source/core/html/parser/HTMLSrcsetParser.cpp
+++ b/Source/core/html/parser/HTMLSrcsetParser.cpp
@@ -338,7 +338,7 @@ static unsigned selectionLogic(Vector<ImageCandidate*>& imageCandidates, float d
currentDensity = imageCandidates[i]->density();
geometricMean = sqrt(currentDensity * nextDensity);
- if (deviceScaleFactor >= geometricMean)
+ if (((deviceScaleFactor <= 1.0) && (deviceScaleFactor > currentDensity)) || (deviceScaleFactor >= geometricMean))
return next;
break;
}
« no previous file with comments | « no previous file | Source/core/html/parser/HTMLSrcsetParserTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698