https://bugs.webkit.org/show_bug.cgi?id=120235
Source/WebCore:
There is no point in comparing the last item in the candidates vector to the DPR, since it will be returned anyway. Therefore, the
iteration on the candidates vector now skips the last candidate.
Patch by Yoav Weiss <yoav@yoav.ws> on 2013-08-24
Reviewed by Andreas Kling.
* html/parser/HTMLParserIdioms.cpp:
(WebCore::bestFitSourceForImageAttributes):
LayoutTests:
Removed MIME types from the test's output, since they're irrelevant for the test, and make it fragile.
Patch by Yoav Weiss <yoav@yoav.ws> on 2013-08-24
Reviewed by Andreas Kling.
* fast/hidpi/image-srcset-fraction-expected.txt:
* fast/hidpi/image-srcset-fraction.html:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154548
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2013-08-24 Yoav Weiss <yoav@yoav.ws>
+
+ Eliminate a useless comparison in srcset's candidate selection algorithm
+ https://bugs.webkit.org/show_bug.cgi?id=120235
+
+ Removed MIME types from the test's output, since they're irrelevant for the test, and make it fragile.
+
+ Reviewed by Andreas Kling.
+
+ * fast/hidpi/image-srcset-fraction-expected.txt:
+ * fast/hidpi/image-srcset-fraction.html:
+
2013-08-23 Ryosuke Niwa <rniwa@webkit.org>
Rebaseline after r154518. Also fix the test to expect "0" instead of "-0".
-blue-100-px-square.png has MIME type image/png
-image-srcset-fraction.html has MIME type text/html
-srcset-helper.js has MIME type text/javascript
-js-test-pre.js has MIME type text/javascript
-green-200-px-square.png has MIME type image/png
PASS document.getElementById("testimg").clientWidth==200 is true
This test passes if the srcset resource is loaded and displayed as the image
<script>
if (window.testRunner) {
testRunner.dumpAsText();
- testRunner.dumpResourceResponseMIMETypes();
}
addEventListener("load", function() {
+2013-08-24 Yoav Weiss <yoav@yoav.ws>
+
+ Eliminate a useless comparison in srcset's candidate selection algorithm
+ https://bugs.webkit.org/show_bug.cgi?id=120235
+
+ There is no point in comparing the last item in the candidates vector to the DPR, since it will be returned anyway. Therefore, the
+ iteration on the candidates vector now skips the last candidate.
+
+ Reviewed by Andreas Kling.
+
+ * html/parser/HTMLParserIdioms.cpp:
+ (WebCore::bestFitSourceForImageAttributes):
+
2013-08-24 Andreas Kling <akling@apple.com>
RenderObject::view() should return a reference.
std::stable_sort(imageCandidates.begin(), imageCandidates.end(), compareByScaleFactor);
- for (size_t i = 0; i < imageCandidates.size(); ++i) {
+ for (size_t i = 0; i < imageCandidates.size() - 1; ++i) {
if (imageCandidates[i].scaleFactor >= deviceScaleFactor)
return imageCandidates[i].imageURL;
}