Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(969)

Unified Diff: Source/core/rendering/RenderGrid.cpp

Issue 333563003: [CSS Grid Layout] Update grid-auto-flow to the new syntax (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Attempt 2 to fix win_blink_rel Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/RenderGrid.cpp
diff --git a/Source/core/rendering/RenderGrid.cpp b/Source/core/rendering/RenderGrid.cpp
index 80046d23d2c9225e15d8555bfc0590e01753b808..37bcc5c1398eb9605615c54aadced968b121100e 100644
--- a/Source/core/rendering/RenderGrid.cpp
+++ b/Source/core/rendering/RenderGrid.cpp
@@ -211,7 +211,8 @@ void RenderGrid::addChild(RenderObject* newChild, RenderObject* beforeChild)
return;
}
- if (style()->gridAutoFlow() != AutoFlowNone) {
+ // 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.
dirtyGrid();
return;
@@ -260,7 +261,8 @@ void RenderGrid::removeChild(RenderObject* child)
ASSERT(child->isBox());
- if (style()->gridAutoFlow() != AutoFlowNone) {
+ // 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.
dirtyGrid();
return;
@@ -790,7 +792,6 @@ void RenderGrid::placeItemsOnGrid()
Vector<RenderBox*> autoMajorAxisAutoGridItems;
Vector<RenderBox*> specifiedMajorAxisAutoGridItems;
- GridAutoFlow autoFlow = style()->gridAutoFlow();
for (RenderBox* child = m_orderIterator.first(); child; child = m_orderIterator.next()) {
// FIXME: We never re-resolve positions if the grid is grown during auto-placement which may lead auto / <integer>
// positions to not match the author's intent. The specification is unclear on what should be done in this case.
@@ -810,7 +811,8 @@ void RenderGrid::placeItemsOnGrid()
ASSERT(gridRowCount() >= style()->gridTemplateRows().size());
ASSERT(gridColumnCount() >= style()->gridTemplateColumns().size());
- if (autoFlow == AutoFlowNone) {
+ // 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());
@@ -932,16 +934,12 @@ void RenderGrid::placeAutoMajorAxisItemOnGrid(RenderBox* gridItem)
GridTrackSizingDirection RenderGrid::autoPlacementMajorAxisDirection() const
{
- GridAutoFlow flow = style()->gridAutoFlow();
- ASSERT(flow != AutoFlowNone);
- return (flow == AutoFlowColumn) ? ForColumns : ForRows;
+ return style()->isGridAutoFlowDirectionColumn() ? ForColumns : ForRows;
}
GridTrackSizingDirection RenderGrid::autoPlacementMinorAxisDirection() const
{
- GridAutoFlow flow = style()->gridAutoFlow();
- ASSERT(flow != AutoFlowNone);
- return (flow == AutoFlowColumn) ? ForRows : ForColumns;
+ return style()->isGridAutoFlowDirectionColumn() ? ForRows : ForColumns;
}
void RenderGrid::dirtyGrid()
« no previous file with comments | « Source/core/css/resolver/StyleBuilderCustom.cpp ('k') | Source/core/rendering/style/GridResolvedPosition.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698