Index: Source/core/rendering/RenderGrid.cpp |
diff --git a/Source/core/rendering/RenderGrid.cpp b/Source/core/rendering/RenderGrid.cpp |
index 5221e3ece7743c67a854c39e39114332caa1b9f9..0a50fa3ac28b3e6a304ae47e7f37437d29b9f383 100644 |
--- a/Source/core/rendering/RenderGrid.cpp |
+++ b/Source/core/rendering/RenderGrid.cpp |
@@ -194,6 +194,7 @@ public: |
RenderGrid::RenderGrid(Element* element) |
: RenderBlock(element) |
, m_gridIsDirty(true) |
+ , m_hasAutoPlacedItems(false) |
, m_orderIterator(this) |
{ |
ASSERT(!childrenInline()); |
@@ -233,9 +234,8 @@ void RenderGrid::addChild(RenderObject* newChild, RenderObject* beforeChild) |
if (newChild->parent() != this) |
return; |
- // FIXME: Implement properly "stack" value in auto-placement algorithm. |
- if (!style()->isGridAutoFlowAlgorithmStack()) { |
- // The grid needs to be recomputed as it might contain auto-placed items that will change their position. |
+ if (hasAutoPlacedItems()) { |
+ // The grid needs to be recomputed as it contains auto-placed items that might change their position. |
dirtyGrid(); |
return; |
} |
@@ -283,9 +283,8 @@ void RenderGrid::removeChild(RenderObject* child) |
ASSERT(child->isBox()); |
- // FIXME: Implement properly "stack" value in auto-placement algorithm. |
- if (!style()->isGridAutoFlowAlgorithmStack()) { |
- // The grid needs to be recomputed as it might contain auto-placed items that will change their position. |
+ if (hasAutoPlacedItems()) { |
+ // The grid needs to be recomputed as it contains auto-placed items that will change their position. |
dirtyGrid(); |
return; |
} |
@@ -917,6 +916,7 @@ void RenderGrid::placeItemsOnGrid() |
OwnPtr<GridSpan> rowPositions = GridResolvedPosition::resolveGridPositionsFromStyle(*style(), *child, ForRows); |
OwnPtr<GridSpan> columnPositions = GridResolvedPosition::resolveGridPositionsFromStyle(*style(), *child, ForColumns); |
if (!rowPositions || !columnPositions) { |
+ setHasAutoPlacedItems(); |
GridSpan* majorAxisPositions = (autoPlacementMajorAxisDirection() == ForColumns) ? columnPositions.get() : rowPositions.get(); |
if (!majorAxisPositions) |
autoMajorAxisAutoGridItems.append(child); |
@@ -930,14 +930,6 @@ void RenderGrid::placeItemsOnGrid() |
ASSERT(gridRowCount() >= GridResolvedPosition::explicitGridRowCount(*style())); |
ASSERT(gridColumnCount() >= GridResolvedPosition::explicitGridColumnCount(*style())); |
- // FIXME: Implement properly "stack" value in auto-placement algorithm. |
- if (style()->isGridAutoFlowAlgorithmStack()) { |
- // If we did collect some grid items, they won't be placed thus never laid out. |
- ASSERT(!autoMajorAxisAutoGridItems.size()); |
- ASSERT(!specifiedMajorAxisAutoGridItems.size()); |
- return; |
- } |
- |
placeSpecifiedMajorAxisItemsOnGrid(specifiedMajorAxisAutoGridItems); |
placeAutoMajorAxisItemsOnGrid(autoMajorAxisAutoGridItems); |
@@ -1093,6 +1085,7 @@ void RenderGrid::dirtyGrid() |
m_grid.resize(0); |
m_gridItemCoordinate.clear(); |
m_gridIsDirty = true; |
+ m_hasAutoPlacedItems = false; |
m_gridItemsOverflowingGridArea.resize(0); |
m_gridItemsIndexesMap.clear(); |
} |