Changeset 203785 in webkit


Ignore:
Timestamp:
Jul 27, 2016 11:46:42 AM (8 years ago)
Author:
jfernandez@igalia.com
Message:

[css-grid] The isValidTransition function must not alter the GridSizingData object
https://bugs.webkit.org/show_bug.cgi?id=160252

Reviewed by Darin Adler.

It's not correct that a function which purpose is to check out the
validity of a state modifies such state.

That code was there to allow the extra row track sizing iteration
in the case of a grid container with indefinite height. We need to
do that in order to figure out its intrinsic height, which will be
used then to properly sizing the row tracks.

Since the intrinsic height computation uses directly the
computeUsedBreadthOfGridTracks function, it does not alter the
algorithm state-machine, hence, we can safely remove this code,
which was incorrect in any case.

No new tests, it's just a refactoring with no functionality change.

  • rendering/RenderGrid.cpp:

(WebCore::RenderGrid::GridSizingData::isValidTransition):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r203784 r203785  
     12016-07-27  Javier Fernandez  <jfernandez@igalia.com>
     2
     3        [css-grid] The isValidTransition function must not alter the GridSizingData object
     4        https://bugs.webkit.org/show_bug.cgi?id=160252
     5
     6        Reviewed by Darin Adler.
     7
     8        It's not correct that a function which purpose is to check out the
     9        validity of a state modifies such state.
     10
     11        That code was there to allow the extra row track sizing iteration
     12        in the case of a grid container with indefinite height. We need to
     13        do that in order to figure out its intrinsic height, which will be
     14        used then to properly sizing the row tracks.
     15
     16        Since the intrinsic height computation uses directly the
     17        computeUsedBreadthOfGridTracks function, it does not alter the
     18        algorithm state-machine, hence, we can safely remove this code,
     19        which was incorrect in any case.
     20
     21        No new tests, it's just a refactoring with no functionality change.
     22
     23        * rendering/RenderGrid.cpp:
     24        (WebCore::RenderGrid::GridSizingData::isValidTransition):
     25
    1262016-07-27  Chris Dumez  <cdumez@apple.com>
    227
  • trunk/Source/WebCore/rendering/RenderGrid.cpp

    r203771 r203785  
    262262        sizingState = ColumnSizingFirstIteration;
    263263    }
    264     bool isValidTransition(GridTrackSizingDirection direction)
     264    bool isValidTransition(GridTrackSizingDirection direction) const
    265265    {
    266266        switch (sizingState) {
    267267        case ColumnSizingFirstIteration:
     268        case ColumnSizingSecondIteration:
    268269            return direction == ForColumns;
    269270        case RowSizingFirstIteration:
    270             return direction == ForRows;
    271         case ColumnSizingSecondIteration:
    272             if (direction == ForRows)
    273                 sizingState = RowSizingFirstIteration;
    274             return true;
    275271        case RowSizingSecondIteration:
    276272            return direction == ForRows;
Note: See TracChangeset for help on using the changeset viewer.