Eliminate a useless comparison in srcset's candidate selection algorithm
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 24 Aug 2013 17:55:44 +0000 (17:55 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 24 Aug 2013 17:55:44 +0000 (17:55 +0000)
commit69f17b839ced673316f7bf406dba2c384772facc
tree01e5cfd88cbbd37e484974af2c59c21989e3bb29
parent862b3da74983c3ff2c1901410b54a1699dcaaae7
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 <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
LayoutTests/ChangeLog
LayoutTests/fast/hidpi/image-srcset-fraction-expected.txt
LayoutTests/fast/hidpi/image-srcset-fraction.html
Source/WebCore/ChangeLog
Source/WebCore/html/parser/HTMLParserIdioms.cpp