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

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

Issue 649183007: Add console errors and usecounter when srcset candidates are dropped (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: improved log messages Created 6 years, 2 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 74e7d1350790183f293fd66801efb85ce4ee3ea6..1a560463f9ce47fadb196d4802b7b86a6f023c52 100644
--- a/Source/core/html/HTMLImageElement.cpp
+++ b/Source/core/html/HTMLImageElement.cpp
@@ -309,7 +309,7 @@ ImageCandidate HTMLImageElement::findBestFitImageFromPictureParent()
SizesAttributeParser parser = SizesAttributeParser(MediaValuesDynamic::create(document()), sizes);
float effectiveSize = parser.length();
m_effectiveSizeViewportDependant = parser.viewportDependant();
- ImageCandidate candidate = bestFitSourceForSrcsetAttribute(document().devicePixelRatio(), effectiveSize, source->fastGetAttribute(srcsetAttr));
+ ImageCandidate candidate = bestFitSourceForSrcsetAttribute(document().devicePixelRatio(), effectiveSize, source->fastGetAttribute(srcsetAttr), &document());
if (candidate.isEmpty())
continue;
return candidate;
@@ -644,7 +644,7 @@ void HTMLImageElement::selectSourceURL(ImageLoader::UpdateFromElementBehavior be
effectiveSize = parser.length();
m_effectiveSizeViewportDependant = parser.viewportDependant();
}
- ImageCandidate candidate = bestFitSourceForImageAttributes(document().devicePixelRatio(), effectiveSize, fastGetAttribute(srcAttr), fastGetAttribute(srcsetAttr));
+ ImageCandidate candidate = bestFitSourceForImageAttributes(document().devicePixelRatio(), effectiveSize, fastGetAttribute(srcAttr), fastGetAttribute(srcsetAttr), &document());
setBestFitURLAndDPRFromImageCandidate(candidate);
}
if (m_intrinsicSizingViewportDependant && m_effectiveSizeViewportDependant && !m_listener) {

Powered by Google App Engine
This is Rietveld 408576698