[css-grid] Remove unneeded calls to compute(Content)LogicalWidth(Height)
authorsvillar@igalia.com <svillar@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Oct 2015 12:47:47 +0000 (12:47 +0000)
committersvillar@igalia.com <svillar@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Oct 2015 12:47:47 +0000 (12:47 +0000)
commit18424a070c206386359d3c63922c60dbb486ac7d
treebbe5383dd3913c01101cf1728935a3b9415e9fa1
parent250f12ce8e62495701eb87f05da1377325e9eb58
[css-grid] Remove unneeded calls to compute(Content)LogicalWidth(Height)
https://bugs.webkit.org/show_bug.cgi?id=149926

Reviewed by Darin Adler.

In order to resolve a Length to a LayoutUnit we need to
provide a maximum value so that i.e. percentages are correctly
computed. That maximum value was computeLogicalWidth() for
columns and computeContentLogicalHeight() for rows. We were
calling it for every single track with a definite size instead
of computing it once and reusing it multiple times.

This brings some nice performance improvements:
- 2.9%  in /Layout/fixed-grid-lots-of-data
- 2.95% in /Layout/fixed-grid-lots-of-stretched-data

No new tests required as there is no change in functionality.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
(WebCore::RenderGrid::computeUsedBreadthOfMinLength):
(WebCore::RenderGrid::computeUsedBreadthOfMaxLength):
(WebCore::RenderGrid::tracksAreWiderThanMinTrackBreadth):
* rendering/RenderGrid.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190783 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderGrid.cpp
Source/WebCore/rendering/RenderGrid.h