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

Side by Side Diff: Source/core/rendering/style/GridResolvedPosition.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, 5 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 unified diff | Download patch
« no previous file with comments | « Source/core/rendering/RenderGrid.cpp ('k') | Source/core/rendering/style/RenderStyle.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/rendering/style/GridResolvedPosition.h" 6 #include "core/rendering/style/GridResolvedPosition.h"
7 7
8 #include "core/rendering/RenderBox.h" 8 #include "core/rendering/RenderBox.h"
9 #include "core/rendering/style/GridCoordinate.h" 9 #include "core/rendering/style/GridCoordinate.h"
10 10
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 PassOwnPtr<GridSpan> GridResolvedPosition::resolveGridPositionsFromStyle(const R enderStyle& gridContainerStyle, const RenderBox& gridItem, GridTrackSizingDirect ion direction) 88 PassOwnPtr<GridSpan> GridResolvedPosition::resolveGridPositionsFromStyle(const R enderStyle& gridContainerStyle, const RenderBox& gridItem, GridTrackSizingDirect ion direction)
89 { 89 {
90 GridPosition initialPosition, finalPosition; 90 GridPosition initialPosition, finalPosition;
91 initialAndFinalPositionsFromStyle(gridContainerStyle, gridItem, direction, i nitialPosition, finalPosition); 91 initialAndFinalPositionsFromStyle(gridContainerStyle, gridItem, direction, i nitialPosition, finalPosition);
92 92
93 GridPositionSide initialPositionSide = calculateInitialPositionSide(directio n); 93 GridPositionSide initialPositionSide = calculateInitialPositionSide(directio n);
94 GridPositionSide finalPositionSide = calculateFinalPositionSide(direction); 94 GridPositionSide finalPositionSide = calculateFinalPositionSide(direction);
95 95
96 if (initialPosition.shouldBeResolvedAgainstOppositePosition() && finalPositi on.shouldBeResolvedAgainstOppositePosition()) { 96 if (initialPosition.shouldBeResolvedAgainstOppositePosition() && finalPositi on.shouldBeResolvedAgainstOppositePosition()) {
97 if (gridContainerStyle.gridAutoFlow() == AutoFlowNone) 97 // FIXME: Implement properly "stack" value in auto-placement algorithm.
98 if (gridContainerStyle.isGridAutoFlowAlgorithmStack())
98 return adoptPtr(new GridSpan(0, 0)); 99 return adoptPtr(new GridSpan(0, 0));
99 100
100 // We can't get our grid positions without running the auto placement al gorithm. 101 // We can't get our grid positions without running the auto placement al gorithm.
101 return nullptr; 102 return nullptr;
102 } 103 }
103 104
104 if (initialPosition.shouldBeResolvedAgainstOppositePosition()) { 105 if (initialPosition.shouldBeResolvedAgainstOppositePosition()) {
105 // Infer the position from the final position ('auto / 1' or 'span 2 / 3 ' case). 106 // Infer the position from the final position ('auto / 1' or 'span 2 / 3 ' case).
106 GridResolvedPosition finalResolvedPosition = resolveGridPositionFromStyl e(gridContainerStyle, finalPosition, finalPositionSide); 107 GridResolvedPosition finalResolvedPosition = resolveGridPositionFromStyl e(gridContainerStyle, finalPosition, finalPositionSide);
107 return resolveGridPositionAgainstOppositePosition(gridContainerStyle, fi nalResolvedPosition, initialPosition, initialPositionSide); 108 return resolveGridPositionAgainstOppositePosition(gridContainerStyle, fi nalResolvedPosition, initialPosition, initialPositionSide);
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 245
245 // If there is no named grid line of that name, we resolve the position to ' auto' (which is equivalent to 'span 1' in this case). 246 // If there is no named grid line of that name, we resolve the position to ' auto' (which is equivalent to 'span 1' in this case).
246 // See http://lists.w3.org/Archives/Public/www-style/2013Jun/0394.html. 247 // See http://lists.w3.org/Archives/Public/www-style/2013Jun/0394.html.
247 if (it == gridLinesNames.end()) 248 if (it == gridLinesNames.end())
248 return GridSpan::create(resolvedOppositePosition, resolvedOppositePositi on); 249 return GridSpan::create(resolvedOppositePosition, resolvedOppositePositi on);
249 250
250 return GridSpan::createWithNamedSpanAgainstOpposite(resolvedOppositePosition , position, side, it->value); 251 return GridSpan::createWithNamedSpanAgainstOpposite(resolvedOppositePosition , position, side, it->value);
251 } 252 }
252 253
253 } // namespace WebCore 254 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderGrid.cpp ('k') | Source/core/rendering/style/RenderStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698