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

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

Issue 293423002: Refactor srcset parser to align it with spec changes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added tests and fixed a bug 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 2c3e81bccccf9f0a8de6b19c88014fb46acdf243..b0ac25d0d140acb5b7210d42591440b067e90787 100644
--- a/Source/core/html/HTMLImageElement.cpp
+++ b/Source/core/html/HTMLImageElement.cpp
@@ -158,10 +158,10 @@ void HTMLImageElement::setBestFitURLAndDPRFromImageCandidate(const ImageCandidat
{
m_bestFitImageURL = candidate.url();
m_currentSrc = AtomicString(document().completeURL(imageSourceURL()).string());
- float candidateScaleFactor = candidate.scaleFactor();
+ float candidateDensity = candidate.density();
// FIXME: Make this ">0" part match the spec, once it settles.
- if (candidateScaleFactor > 0)
- m_imageDevicePixelRatio = 1 / candidateScaleFactor;
+ if (candidateDensity > 0)
+ m_imageDevicePixelRatio = 1 / candidateDensity;
if (renderer() && renderer()->isImage())
toRenderImage(renderer())->setImageDevicePixelRatio(m_imageDevicePixelRatio);
}

Powered by Google App Engine
This is Rietveld 408576698