[CSS Grid Layout] Fix the handling of infinity in track growth limits
https://bugs.webkit.org/show_bug.cgi?id=137019

Reviewed by Darin Adler.

Source/WebCore:

The growth limit of content sized tracks is initialized to
infinity which is internally represented as -1. We were not
specialcasing this situation, and thus, -1 was used in the
computations as any other value. This change makes the code aware
of the existence of infinites (like when sorting tracks by growth
potential or when initializing the track growth limits).

There was another bug related to infinities. The code that was
replacing a infinite growth limit by a finite one was not using
the proper indexes so the tracks that were being updated were the
wrong ones.

Test: fast/css-grid-layout/grid-content-sized-columns-resolution.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
(WebCore::sortByGridTrackGrowthPotential):
(WebCore::RenderGrid::distributeSpaceToTracks):

LayoutTests:

* fast/css-grid-layout/grid-content-sized-columns-resolution-expected.txt: Added.
* fast/css-grid-layout/grid-content-sized-columns-resolution.html: Added.
* fast/css-grid-layout/grid-item-order-in-content-sized-columns-resolution-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174006 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Grid Layout] Empty string case already covered by containesOnlyWhiteSpace.
https://bugs.webkit.org/show_bug.cgi?id=137146

Reviewed by Sergio Villar Senin.

When checking out for white-space only strings in the grid-template-areas
property values, it's not neccessary to check out for empty strings as
such case is already covered.

No new tests, already covered by fast/css-grid-layout/grid-template-areas-empty-string-crash.html.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseGridTemplateAreasRow):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@174007 268f45cc-cd09-0410-ab3c-d52691b4dbfc