Title: [154548] trunk
- Revision
- 154548
- Author
- [email protected]
- Date
- 2013-08-24 10:55:44 -0700 (Sat, 24 Aug 2013)
Log Message
Eliminate a useless comparison in srcset's candidate selection algorithm
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 <[email protected]> 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 <[email protected]> on 2013-08-24
Reviewed by Andreas Kling.
* fast/hidpi/image-srcset-fraction-expected.txt:
* fast/hidpi/image-srcset-fraction.html:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (154547 => 154548)
--- trunk/LayoutTests/ChangeLog 2013-08-24 16:39:53 UTC (rev 154547)
+++ trunk/LayoutTests/ChangeLog 2013-08-24 17:55:44 UTC (rev 154548)
@@ -1,3 +1,15 @@
+2013-08-24 Yoav Weiss <[email protected]>
+
+ 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 <[email protected]>
Rebaseline after r154518. Also fix the test to expect "0" instead of "-0".
Modified: trunk/LayoutTests/fast/hidpi/image-srcset-fraction-expected.txt (154547 => 154548)
--- trunk/LayoutTests/fast/hidpi/image-srcset-fraction-expected.txt 2013-08-24 16:39:53 UTC (rev 154547)
+++ trunk/LayoutTests/fast/hidpi/image-srcset-fraction-expected.txt 2013-08-24 17:55:44 UTC (rev 154548)
@@ -1,8 +1,3 @@
-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
Modified: trunk/LayoutTests/fast/hidpi/image-srcset-fraction.html (154547 => 154548)
--- trunk/LayoutTests/fast/hidpi/image-srcset-fraction.html 2013-08-24 16:39:53 UTC (rev 154547)
+++ trunk/LayoutTests/fast/hidpi/image-srcset-fraction.html 2013-08-24 17:55:44 UTC (rev 154548)
@@ -8,7 +8,6 @@
<script>
if (window.testRunner) {
testRunner.dumpAsText();
- testRunner.dumpResourceResponseMIMETypes();
}
addEventListener("load", function() {
Modified: trunk/Source/WebCore/ChangeLog (154547 => 154548)
--- trunk/Source/WebCore/ChangeLog 2013-08-24 16:39:53 UTC (rev 154547)
+++ trunk/Source/WebCore/ChangeLog 2013-08-24 17:55:44 UTC (rev 154548)
@@ -1,3 +1,16 @@
+2013-08-24 Yoav Weiss <[email protected]>
+
+ 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 <[email protected]>
RenderObject::view() should return a reference.
Modified: trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp (154547 => 154548)
--- trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp 2013-08-24 16:39:53 UTC (rev 154547)
+++ trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp 2013-08-24 17:55:44 UTC (rev 154548)
@@ -362,7 +362,7 @@
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;
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes