[css-grid] Avoid duplicated calls to resolution code
authorrego@igalia.com <rego@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Feb 2016 18:17:17 +0000 (18:17 +0000)
committerrego@igalia.com <rego@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Feb 2016 18:17:17 +0000 (18:17 +0000)
commit57337d3a30f8faf766f5c61ce5043bde8339bfe9
treeb7155e3e48696cf8cc6565d10d289681c04a099a
parente7d48f9573b127d3f3aed57faef2afb8c3e11fb4
[css-grid] Avoid duplicated calls to resolution code
https://bugs.webkit.org/show_bug.cgi?id=154336

Reviewed by Sergio Villar Senin.

We were calling GridResolvedPosition::resolveGridPositionsFromStyle()
several times per item.

We can store the GridCoordinates in
RenderGrid::populateExplicitGridAndOrderIterator()
and reuse them in the placement code.
Once RenderGrid::placeItemsOnGrid() is over,
all the items will have a definite position in both axis.

No new tests, no change of behavior.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::insertItemIntoGrid):
(WebCore::RenderGrid::placeItemsOnGrid):
(WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
(WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
(WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
(WebCore::RenderGrid::cachedGridCoordinate):
(WebCore::RenderGrid::cachedGridSpan):
* rendering/RenderGrid.h:

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