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

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

Issue 249353002: Fix srcset selection bug when 'w' and src are present (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@calc
Patch Set: Added assert Created 6 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 | « LayoutTests/fast/hidpi/image-srcset-invalid-inputs-correct-src.html ('k') | no next file » | 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 eec44809b23097c7faf8eb94c62c4a2969a58f2b..35aa976503af65a7eba548215387d5f12e296021 100644
--- a/Source/core/html/parser/HTMLSrcsetParser.cpp
+++ b/Source/core/html/parser/HTMLSrcsetParser.cpp
@@ -164,7 +164,12 @@ static ImageCandidate pickBestImageCandidate(float deviceScaleFactor, unsigned s
break;
}
+ if (imageCandidates[i].srcOrigin() && ignoreSrc) {
+ ASSERT(i > 0);
+ --i;
+ }
float winningScaleFactor = imageCandidates[i].scaleFactor();
+
unsigned winner = i;
// 16. If an entry b in candidates has the same associated ... pixel density as an earlier entry a in candidates,
// then remove entry b
« no previous file with comments | « LayoutTests/fast/hidpi/image-srcset-invalid-inputs-correct-src.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698