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

Unified Diff: Source/core/html/HTMLImageElement.cpp

Issue 305643006: Enable a srcset 0x descriptor (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase and unflake the layout test Created 6 years, 7 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-intrinsic-size-zero-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLImageElement.cpp
diff --git a/Source/core/html/HTMLImageElement.cpp b/Source/core/html/HTMLImageElement.cpp
index 979abd88b26a8737ea6f5030470d11fdbef1a7ca..64266a6c5754f0a5a2b1ffbd9ed80835e2033b80 100644
--- a/Source/core/html/HTMLImageElement.cpp
+++ b/Source/core/html/HTMLImageElement.cpp
@@ -185,9 +185,8 @@ void HTMLImageElement::setBestFitURLAndDPRFromImageCandidate(const ImageCandidat
{
m_bestFitImageURL = candidate.url();
float candidateDensity = candidate.density();
- // FIXME: Make this ">0" part match the spec, once it settles.
- if (candidateDensity > 0)
- m_imageDevicePixelRatio = 1 / candidateDensity;
+ if (candidateDensity >= 0)
+ m_imageDevicePixelRatio = 1.0 / candidateDensity;
if (renderer() && renderer()->isImage())
toRenderImage(renderer())->setImageDevicePixelRatio(m_imageDevicePixelRatio);
}
« no previous file with comments | « LayoutTests/fast/hidpi/image-srcset-intrinsic-size-zero-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698