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 293423002: Refactor srcset parser to align it with spec changes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed ASSERT 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 2f7619cacdd2201f0d77b7288ec9e71cb153b52b..b6ee23f8573b7c8f45a14437d456eb57c26e9ada 100644
--- a/Source/core/html/HTMLImageElement.cpp
+++ b/Source/core/html/HTMLImageElement.cpp
@@ -180,10 +180,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