[CSS Grid Layout] Fix raw function pointer usages
authorsvillar@igalia.com <svillar@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Apr 2015 10:51:01 +0000 (10:51 +0000)
committersvillar@igalia.com <svillar@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Apr 2015 10:51:01 +0000 (10:51 +0000)
commit17ac381485e17f3f6a8ecec94ccb2e657716801b
treea3dcdf3c6705548e013f0e7823f942a44e1072ec
parent57717d5f78c0dcc53f8a6537bb70a1c66aef6cec
[CSS Grid Layout] Fix raw function pointer usages
https://bugs.webkit.org/show_bug.cgi?id=143481

Reviewed by Antti Koivisto.

The argument list of
resolveContentBasedTrackSizingFunctionsForItems() became too long
and rather incomprehensible as it included up to 6 function
pointers. This replaces all of them by an enum which describes the
phase of the algorithm that is currently running. With that phase
we have enough information to select the right function to call.

In order not to tangle up too much the method, the new explicit
switch statements where moved to static helper functions.

No new tests as this is just a code refactoring.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
(WebCore::RenderGrid::trackSizeForTrackSizeComputationPhase): New helper function.
(WebCore::RenderGrid::shouldProcessTrackForTrackSizeComputationPhase): Ditto.
(WebCore::RenderGrid::trackShouldGrowBeyondGrowthLimitsForTrackSizeComputationPhase): Ditto.
(WebCore::RenderGrid::updateTrackSizeForTrackSizeComputationPhase): Ditto.
(WebCore::RenderGrid::currentItemSizeForTrackSizeComputationPhase): Ditto.
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
(WebCore::RenderGrid::distributeSpaceToTracks):
* rendering/RenderGrid.h:

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