Index: Source/core/html/parser/HTMLSrcsetParser.cpp |
diff --git a/Source/core/html/parser/HTMLSrcsetParser.cpp b/Source/core/html/parser/HTMLSrcsetParser.cpp |
index 40c95a19643c7000afcc631bcf41f13bd126effb..e65e3f54baa0aef731bd75c2169279e416250e42 100644 |
--- a/Source/core/html/parser/HTMLSrcsetParser.cpp |
+++ b/Source/core/html/parser/HTMLSrcsetParser.cpp |
@@ -154,7 +154,7 @@ ImageCandidate bestFitSourceForSrcsetAttribute(float deviceScaleFactor, const St |
return pickBestImageCandidate(deviceScaleFactor, imageCandidates); |
} |
-String bestFitSourceForImageAttributes(float deviceScaleFactor, const String& srcAttribute, const String& srcsetAttribute) |
+String bestFitSourceForImageAttributes(float deviceScaleFactor, const String& srcAttribute, const String& srcsetAttribute, float& intrinsicSizeFactor) |
{ |
if (srcsetAttribute.isNull()) |
return srcAttribute; |
@@ -166,7 +166,10 @@ String bestFitSourceForImageAttributes(float deviceScaleFactor, const String& sr |
if (!srcAttribute.isEmpty()) |
imageCandidates.append(ImageCandidate(srcAttribute, 0, srcAttribute.length(), 1.0)); |
- return pickBestImageCandidate(deviceScaleFactor, imageCandidates).toString(); |
+ ImageCandidate candidate = pickBestImageCandidate(deviceScaleFactor, imageCandidates); |
+ intrinsicSizeFactor = 1 / candidate.scaleFactor(); |
pdr.
2013/10/11 05:17:33
Do we need to check that scaleFactor is non-zero h
Yoav Weiss
2013/10/11 07:22:32
Yes, we should. Will fix.
|
+ |
+ return candidate.toString(); |
} |
String bestFitSourceForImageAttributes(float deviceScaleFactor, const String& srcAttribute, ImageCandidate& srcsetImageCandidate) |