Title: [203785] trunk/Source/WebCore
Revision
203785
Author
[email protected]
Date
2016-07-27 11:46:42 -0700 (Wed, 27 Jul 2016)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (203784 => 203785)


--- trunk/Source/WebCore/ChangeLog	2016-07-27 18:27:22 UTC (rev 203784)
+++ trunk/Source/WebCore/ChangeLog	2016-07-27 18:46:42 UTC (rev 203785)
@@ -1,3 +1,28 @@
+2016-07-27  Javier Fernandez  <[email protected]>
+
+        [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):
+
 2016-07-27  Chris Dumez  <[email protected]>
 
         First parameter to Document.execCommand() / queryCommand*() should be mandatory

Modified: trunk/Source/WebCore/rendering/RenderGrid.cpp (203784 => 203785)


--- trunk/Source/WebCore/rendering/RenderGrid.cpp	2016-07-27 18:27:22 UTC (rev 203784)
+++ trunk/Source/WebCore/rendering/RenderGrid.cpp	2016-07-27 18:46:42 UTC (rev 203785)
@@ -261,17 +261,13 @@
         ASSERT_NOT_REACHED();
         sizingState = ColumnSizingFirstIteration;
     }
-    bool isValidTransition(GridTrackSizingDirection direction)
+    bool isValidTransition(GridTrackSizingDirection direction) const
     {
         switch (sizingState) {
         case ColumnSizingFirstIteration:
+        case ColumnSizingSecondIteration:
             return direction == ForColumns;
         case RowSizingFirstIteration:
-            return direction == ForRows;
-        case ColumnSizingSecondIteration:
-            if (direction == ForRows)
-                sizingState = RowSizingFirstIteration;
-            return true;
         case RowSizingSecondIteration:
             return direction == ForRows;
         }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to