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

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

Issue 302083009: Revert of Enable a srcset 0x descriptor (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
Index: Source/core/html/HTMLImageElement.cpp
diff --git a/Source/core/html/HTMLImageElement.cpp b/Source/core/html/HTMLImageElement.cpp
index db02d60486d15ff914eb31b78ebd40737ee14a3c..b6ee23f8573b7c8f45a14437d456eb57c26e9ada 100644
--- a/Source/core/html/HTMLImageElement.cpp
+++ b/Source/core/html/HTMLImageElement.cpp
@@ -181,8 +181,9 @@
m_bestFitImageURL = candidate.url();
m_currentSrc = AtomicString(document().completeURL(imageSourceURL()).string());
float candidateDensity = candidate.density();
- if (candidateDensity >= 0)
- m_imageDevicePixelRatio = 1.0 / candidateDensity;
+ // FIXME: Make this ">0" part match the spec, once it settles.
+ if (candidateDensity > 0)
+ m_imageDevicePixelRatio = 1 / 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') | Source/core/html/parser/HTMLSrcsetParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698