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

Side by Side Diff: third_party/WebKit/Source/core/style/GridResolvedPosition.cpp

Issue 1576993003: [css-grid] Fix placement for unknown named grid lines (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: New version with simplified loop Created 4 years, 11 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
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 "core/style/GridResolvedPosition.h" 5 #include "core/style/GridResolvedPosition.h"
6 6
7 #include "core/layout/LayoutBox.h" 7 #include "core/layout/LayoutBox.h"
8 #include "core/style/GridCoordinate.h" 8 #include "core/style/GridCoordinate.h"
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 29 matching lines...) Expand all
40 static void initialAndFinalPositionsFromStyle(const ComputedStyle& gridContainer Style, const LayoutBox& gridItem, GridTrackSizingDirection direction, GridPositi on& initialPosition, GridPosition& finalPosition) 40 static void initialAndFinalPositionsFromStyle(const ComputedStyle& gridContainer Style, const LayoutBox& gridItem, GridTrackSizingDirection direction, GridPositi on& initialPosition, GridPosition& finalPosition)
41 { 41 {
42 initialPosition = (direction == ForColumns) ? gridItem.style()->gridColumnSt art() : gridItem.style()->gridRowStart(); 42 initialPosition = (direction == ForColumns) ? gridItem.style()->gridColumnSt art() : gridItem.style()->gridRowStart();
43 finalPosition = (direction == ForColumns) ? gridItem.style()->gridColumnEnd( ) : gridItem.style()->gridRowEnd(); 43 finalPosition = (direction == ForColumns) ? gridItem.style()->gridColumnEnd( ) : gridItem.style()->gridRowEnd();
44 44
45 // We must handle the placement error handling code here instead of in the S tyleAdjuster because we don't want to 45 // We must handle the placement error handling code here instead of in the S tyleAdjuster because we don't want to
46 // overwrite the specified values. 46 // overwrite the specified values.
47 if (initialPosition.isSpan() && finalPosition.isSpan()) 47 if (initialPosition.isSpan() && finalPosition.isSpan())
48 finalPosition.setAutoPosition(); 48 finalPosition.setAutoPosition();
49 49
50 // Try to early detect the case of non existing named grid lines. This way w e could assume later that 50 if (gridItem.isOutOfFlowPositioned()) {
51 // GridResolvedPosition::resolveGrisPositionFromStyle() always return a vali d resolved position. 51 // Early detect the case of non existing named grid lines for positioned items.
52 if (initialPosition.isNamedGridArea() && !GridResolvedPosition::isValidNamed LineOrArea(initialPosition.namedGridLine(), gridContainerStyle, GridResolvedPosi tion::initialPositionSide(direction))) 52 if (initialPosition.isNamedGridArea() && !GridResolvedPosition::isValidN amedLineOrArea(initialPosition.namedGridLine(), gridContainerStyle, GridResolved Position::initialPositionSide(direction)))
53 initialPosition.setAutoPosition(); 53 initialPosition.setAutoPosition();
54 54
55 if (finalPosition.isNamedGridArea() && !GridResolvedPosition::isValidNamedLi neOrArea(finalPosition.namedGridLine(), gridContainerStyle, GridResolvedPosition ::finalPositionSide(direction))) 55 if (finalPosition.isNamedGridArea() && !GridResolvedPosition::isValidNam edLineOrArea(finalPosition.namedGridLine(), gridContainerStyle, GridResolvedPosi tion::finalPositionSide(direction)))
56 finalPosition.setAutoPosition(); 56 finalPosition.setAutoPosition();
57 }
57 58
58 // If the grid item has an automatic position and a grid span for a named li ne in a given dimension, instead treat the grid span as one. 59 // If the grid item has an automatic position and a grid span for a named li ne in a given dimension, instead treat the grid span as one.
59 if (initialPosition.isAuto() && finalPosition.isSpan() && !finalPosition.nam edGridLine().isNull()) 60 if (initialPosition.isAuto() && finalPosition.isSpan() && !finalPosition.nam edGridLine().isNull())
60 finalPosition.setSpanPosition(1, String()); 61 finalPosition.setSpanPosition(1, String());
61 if (finalPosition.isAuto() && initialPosition.isSpan() && !initialPosition.n amedGridLine().isNull()) 62 if (finalPosition.isAuto() && initialPosition.isSpan() && !initialPosition.n amedGridLine().isNull())
62 initialPosition.setSpanPosition(1, String()); 63 initialPosition.setSpanPosition(1, String());
63 } 64 }
64 65
65 static GridSpan definiteGridSpanWithInitialNamedSpanAgainstOpposite(size_t resol vedOppositePosition, const GridPosition& position, const Vector<size_t>& gridLin es) 66 static size_t lookAheadForNamedGridLine(int start, size_t numberOfLines, const V ector<size_t>* namedGridLinesIndexes, size_t gridLastLine)
66 { 67 {
67 if (resolvedOppositePosition == 0) 68 ASSERT(numberOfLines > 0);
rune 2016/01/27 10:27:54 ASSERT(numberOfLines);
Manuel Rego 2016/01/27 12:34:24 Done.
68 return GridSpan::untranslatedDefiniteGridSpan(resolvedOppositePosition, resolvedOppositePosition + 1);
69 69
70 size_t firstLineBeforeOppositePositionIndex = 0; 70 // Only implicit lines on the search direction are assumed to have the given name, so we can start to look from first line.
71 const size_t* firstLineBeforeOppositePosition = std::lower_bound(gridLines.b egin(), gridLines.end(), resolvedOppositePosition); 71 // See: https://drafts.csswg.org/css-grid/#grid-placement-span-int
72 if (firstLineBeforeOppositePosition != gridLines.end()) 72 size_t end = std::max(start, 0);
73 firstLineBeforeOppositePositionIndex = firstLineBeforeOppositePosition - gridLines.begin(); 73
74 size_t gridLineIndex = std::max<int>(0, firstLineBeforeOppositePositionIndex - position.spanPosition()); 74 for (; numberOfLines; ++end) {
75 size_t resolvedGridLinePosition = gridLines[gridLineIndex]; 75 if (end > gridLastLine || (namedGridLinesIndexes && namedGridLinesIndexe s->contains(end)))
76 if (resolvedGridLinePosition >= resolvedOppositePosition) 76 numberOfLines--;
rune 2016/01/27 10:27:53 Skip for-loop similar to lookBackForNamedGridLine?
Manuel Rego 2016/01/27 12:34:24 Acknowledged.
77 resolvedGridLinePosition = resolvedOppositePosition - 1; 77 }
78 return GridSpan::untranslatedDefiniteGridSpan(resolvedGridLinePosition, reso lvedOppositePosition); 78
79 ASSERT(end > 0);
rune 2016/01/27 10:27:53 ASSERT(end);
Manuel Rego 2016/01/27 12:34:25 Done.
80 return end - 1;
79 } 81 }
80 82
81 static GridSpan definiteGridSpanWithFinalNamedSpanAgainstOpposite(size_t resolve dOppositePosition, const GridPosition& position, const Vector<size_t>& gridLines ) 83 static int lookBackForNamedGridLine(int end, size_t numberOfLines, const Vector< size_t>* namedGridLinesIndexes, int gridLastLine)
82 { 84 {
83 ASSERT(gridLines.size()); 85 ASSERT(numberOfLines > 0);
rune 2016/01/27 10:27:53 ASSERT(numberOfLines)
Manuel Rego 2016/01/27 12:34:25 Done.
84 size_t firstLineAfterOppositePositionIndex = gridLines.size() - 1;
85 const size_t* firstLineAfterOppositePosition = std::upper_bound(gridLines.be gin(), gridLines.end(), resolvedOppositePosition);
86 if (firstLineAfterOppositePosition != gridLines.end())
87 firstLineAfterOppositePositionIndex = firstLineAfterOppositePosition - g ridLines.begin();
88 size_t gridLineIndex = std::min(gridLines.size() - 1, firstLineAfterOpposite PositionIndex + position.spanPosition() - 1);
89 size_t resolvedGridLinePosition = gridLines[gridLineIndex];
90 if (resolvedGridLinePosition <= resolvedOppositePosition)
91 resolvedGridLinePosition = resolvedOppositePosition + 1;
92 86
93 return GridSpan::untranslatedDefiniteGridSpan(resolvedOppositePosition, reso lvedGridLinePosition); 87 // Only implicit lines on the search direction are assumed to have the given name, so we can start to look from last line.
88 // See: https://drafts.csswg.org/css-grid/#grid-placement-span-int
89 int start = std::min(end, gridLastLine);
90
91 for (; numberOfLines; --start) {
92 if (start < 0 || (namedGridLinesIndexes && namedGridLinesIndexes->contai ns(static_cast<size_t>(start))))
93 numberOfLines--;
94 }
rune 2016/01/27 10:27:53 The for-loop looks unnecessary when namedGridLines
Manuel Rego 2016/01/27 12:34:25 Yeah, we can skip the loop in that case. As we'd b
95
96 return start + 1;
94 } 97 }
95 98
96 static GridSpan definiteGridSpanWithNamedSpanAgainstOpposite(size_t resolvedOppo sitePosition, const GridPosition& position, GridPositionSide side, const Vector< size_t>& gridLines) 99 static GridSpan definiteGridSpanWithNamedSpanAgainstOpposite(int resolvedOpposit ePosition, const GridPosition& position, GridPositionSide side, const Vector<siz e_t>* gridLines, int lastLine)
97 { 100 {
98 if (side == RowStartSide || side == ColumnStartSide) 101 int start, end;
99 return definiteGridSpanWithInitialNamedSpanAgainstOpposite(resolvedOppos itePosition, position, gridLines);
100 102
101 return definiteGridSpanWithFinalNamedSpanAgainstOpposite(resolvedOppositePos ition, position, gridLines); 103 if (side == RowStartSide || side == ColumnStartSide) {
104 start = lookBackForNamedGridLine(resolvedOppositePosition - 1, position. spanPosition(), gridLines, lastLine);
105 end = resolvedOppositePosition;
106 } else {
107 start = resolvedOppositePosition;
108 end = lookAheadForNamedGridLine(resolvedOppositePosition + 1, position.s panPosition(), gridLines, lastLine);
109 }
110
111 return GridSpan::untranslatedDefiniteGridSpan(start, end);
102 } 112 }
103 113
104 static GridSpan resolveNamedGridLinePositionAgainstOppositePosition(const Comput edStyle& gridContainerStyle, size_t resolvedOppositePosition, const GridPosition & position, GridPositionSide side) 114 size_t GridResolvedPosition::explicitGridColumnCount(const ComputedStyle& gridCo ntainerStyle)
115 {
116 return std::min<size_t>(gridContainerStyle.gridTemplateColumns().size(), kGr idMaxTracks);
117 }
118
119 size_t GridResolvedPosition::explicitGridRowCount(const ComputedStyle& gridConta inerStyle)
120 {
121 return std::min<size_t>(gridContainerStyle.gridTemplateRows().size(), kGridM axTracks);
122 }
123
124 static size_t explicitGridSizeForSide(const ComputedStyle& gridContainerStyle, G ridPositionSide side)
125 {
126 return (side == ColumnStartSide || side == ColumnEndSide) ? GridResolvedPosi tion::explicitGridColumnCount(gridContainerStyle) : GridResolvedPosition::explic itGridRowCount(gridContainerStyle);
127 }
128
129 static GridSpan resolveNamedGridLinePositionAgainstOppositePosition(const Comput edStyle& gridContainerStyle, int resolvedOppositePosition, const GridPosition& p osition, GridPositionSide side)
105 { 130 {
106 ASSERT(position.isSpan()); 131 ASSERT(position.isSpan());
107 ASSERT(!position.namedGridLine().isNull()); 132 ASSERT(!position.namedGridLine().isNull());
108 // Negative positions are not allowed per the specification and should have been handled during parsing. 133 // Negative positions are not allowed per the specification and should have been handled during parsing.
109 ASSERT(position.spanPosition() > 0); 134 ASSERT(position.spanPosition() > 0);
110 135
111 const NamedGridLinesMap& gridLinesNames = gridLinesForSide(gridContainerStyl e, side); 136 const NamedGridLinesMap& gridLinesNames = gridLinesForSide(gridContainerStyl e, side);
112 NamedGridLinesMap::const_iterator it = gridLinesNames.find(position.namedGri dLine()); 137 NamedGridLinesMap::const_iterator it = gridLinesNames.find(position.namedGri dLine());
113 138 const Vector<size_t>* gridLines = it == gridLinesNames.end() ? nullptr : &it ->value;
114 // 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). 139 size_t lastLine = explicitGridSizeForSide(gridContainerStyle, side);
115 // See http://lists.w3.org/Archives/Public/www-style/2013Jun/0394.html. 140 return definiteGridSpanWithNamedSpanAgainstOpposite(resolvedOppositePosition , position, side, gridLines, lastLine);
116 if (it == gridLinesNames.end()) {
117 if ((side == ColumnStartSide || side == RowStartSide) && resolvedOpposit ePosition)
118 return GridSpan::untranslatedDefiniteGridSpan(resolvedOppositePositi on - 1, resolvedOppositePosition);
119 return GridSpan::untranslatedDefiniteGridSpan(resolvedOppositePosition, resolvedOppositePosition + 1);
120 }
121
122 return definiteGridSpanWithNamedSpanAgainstOpposite(resolvedOppositePosition , position, side, it->value);
123 } 141 }
124 142
125 static GridSpan definiteGridSpanWithSpanAgainstOpposite(size_t resolvedOppositeP osition, const GridPosition& position, GridPositionSide side) 143 static GridSpan definiteGridSpanWithSpanAgainstOpposite(size_t resolvedOppositeP osition, const GridPosition& position, GridPositionSide side)
126 { 144 {
127 size_t positionOffset = position.spanPosition(); 145 size_t positionOffset = position.spanPosition();
128 if (side == ColumnStartSide || side == RowStartSide) 146 if (side == ColumnStartSide || side == RowStartSide)
129 return GridSpan::untranslatedDefiniteGridSpan(resolvedOppositePosition - positionOffset, resolvedOppositePosition); 147 return GridSpan::untranslatedDefiniteGridSpan(resolvedOppositePosition - positionOffset, resolvedOppositePosition);
130 148
131 return GridSpan::untranslatedDefiniteGridSpan(resolvedOppositePosition, reso lvedOppositePosition + positionOffset); 149 return GridSpan::untranslatedDefiniteGridSpan(resolvedOppositePosition, reso lvedOppositePosition + positionOffset);
132 } 150 }
133 151
134 static GridSpan resolveGridPositionAgainstOppositePosition(const ComputedStyle& gridContainerStyle, size_t resolvedOppositePosition, const GridPosition& positio n, GridPositionSide side) 152 static GridSpan resolveGridPositionAgainstOppositePosition(const ComputedStyle& gridContainerStyle, int resolvedOppositePosition, const GridPosition& position, GridPositionSide side)
135 { 153 {
136 if (position.isAuto()) { 154 if (position.isAuto()) {
137 if (side == ColumnStartSide || side == RowStartSide) 155 if (side == ColumnStartSide || side == RowStartSide)
138 return GridSpan::untranslatedDefiniteGridSpan(resolvedOppositePositi on - 1, resolvedOppositePosition); 156 return GridSpan::untranslatedDefiniteGridSpan(resolvedOppositePositi on - 1, resolvedOppositePosition);
139 return GridSpan::untranslatedDefiniteGridSpan(resolvedOppositePosition, resolvedOppositePosition + 1); 157 return GridSpan::untranslatedDefiniteGridSpan(resolvedOppositePosition, resolvedOppositePosition + 1);
140 } 158 }
141 159
142 ASSERT(position.isSpan()); 160 ASSERT(position.isSpan());
143 ASSERT(position.spanPosition() > 0); 161 ASSERT(position.spanPosition() > 0);
144 162
(...skipping 15 matching lines...) Expand all
160 178
161 if (initialPosition.isAuto() && finalPosition.isAuto()) 179 if (initialPosition.isAuto() && finalPosition.isAuto())
162 return 1; 180 return 1;
163 181
164 GridPosition position = initialPosition.isSpan() ? initialPosition : finalPo sition; 182 GridPosition position = initialPosition.isSpan() ? initialPosition : finalPo sition;
165 ASSERT(position.isSpan()); 183 ASSERT(position.isSpan());
166 ASSERT(position.spanPosition()); 184 ASSERT(position.spanPosition());
167 return position.spanPosition(); 185 return position.spanPosition();
168 } 186 }
169 187
170 size_t GridResolvedPosition::explicitGridColumnCount(const ComputedStyle& gridCo ntainerStyle) 188 static int resolveNamedGridLinePositionFromStyle(const ComputedStyle& gridContai nerStyle, const GridPosition& position, GridPositionSide side)
171 {
172 return std::min<size_t>(gridContainerStyle.gridTemplateColumns().size(), kGr idMaxTracks);
173 }
174
175 size_t GridResolvedPosition::explicitGridRowCount(const ComputedStyle& gridConta inerStyle)
176 {
177 return std::min<size_t>(gridContainerStyle.gridTemplateRows().size(), kGridM axTracks);
178 }
179
180 static size_t explicitGridSizeForSide(const ComputedStyle& gridContainerStyle, G ridPositionSide side)
181 {
182 return (side == ColumnStartSide || side == ColumnEndSide) ? GridResolvedPosi tion::explicitGridColumnCount(gridContainerStyle) : GridResolvedPosition::explic itGridRowCount(gridContainerStyle);
183 }
184
185 static size_t resolveNamedGridLinePositionFromStyle(const ComputedStyle& gridCon tainerStyle, const GridPosition& position, GridPositionSide side)
186 { 189 {
187 ASSERT(!position.namedGridLine().isNull()); 190 ASSERT(!position.namedGridLine().isNull());
188 191
189 const NamedGridLinesMap& gridLinesNames = gridLinesForSide(gridContainerStyl e, side); 192 const NamedGridLinesMap& gridLinesNames = gridLinesForSide(gridContainerStyl e, side);
190 NamedGridLinesMap::const_iterator it = gridLinesNames.find(position.namedGri dLine()); 193 NamedGridLinesMap::const_iterator it = gridLinesNames.find(position.namedGri dLine());
191 if (it == gridLinesNames.end()) { 194 const Vector<size_t>* gridLines = it == gridLinesNames.end() ? nullptr : &it ->value;
192 if (position.isPositive()) 195 size_t lastLine = explicitGridSizeForSide(gridContainerStyle, side);
193 return 0;
194 size_t lastLine = explicitGridSizeForSide(gridContainerStyle, side);
195 return lastLine;
196 }
197
198 size_t namedGridLineIndex;
199 if (position.isPositive()) 196 if (position.isPositive())
200 namedGridLineIndex = std::min<size_t>(position.integerPosition(), it->va lue.size()) - 1; 197 return lookAheadForNamedGridLine(0, abs(position.integerPosition()), gri dLines, lastLine);
201 else 198 else
202 namedGridLineIndex = std::max<int>(it->value.size() - abs(position.integ erPosition()), 0); 199 return lookBackForNamedGridLine(lastLine, abs(position.integerPosition() ), gridLines, lastLine);
203 return it->value[namedGridLineIndex];
204 } 200 }
205 201
206 static int resolveGridPositionFromStyle(const ComputedStyle& gridContainerStyle, const GridPosition& position, GridPositionSide side) 202 static int resolveGridPositionFromStyle(const ComputedStyle& gridContainerStyle, const GridPosition& position, GridPositionSide side)
207 { 203 {
208 switch (position.type()) { 204 switch (position.type()) {
209 case ExplicitPosition: { 205 case ExplicitPosition: {
210 ASSERT(position.integerPosition()); 206 ASSERT(position.integerPosition());
211 207
212 if (!position.namedGridLine().isNull()) 208 if (!position.namedGridLine().isNull())
213 return resolveNamedGridLinePositionFromStyle(gridContainerStyle, pos ition, side); 209 return resolveNamedGridLinePositionFromStyle(gridContainerStyle, pos ition, side);
214 210
215 // Handle <integer> explicit position. 211 // Handle <integer> explicit position.
216 if (position.isPositive()) 212 if (position.isPositive())
217 return position.integerPosition() - 1; 213 return position.integerPosition() - 1;
218 214
219 size_t resolvedPosition = abs(position.integerPosition()) - 1; 215 size_t resolvedPosition = abs(position.integerPosition()) - 1;
220 size_t endOfTrack = explicitGridSizeForSide(gridContainerStyle, side); 216 size_t endOfTrack = explicitGridSizeForSide(gridContainerStyle, side);
221 217
222 return endOfTrack - resolvedPosition; 218 return endOfTrack - resolvedPosition;
223 } 219 }
224 case NamedGridAreaPosition: 220 case NamedGridAreaPosition:
225 { 221 {
226 // First attempt to match the grid area's edge to a named grid area: if there is a named line with the name 222 // First attempt to match the grid area's edge to a named grid area: if there is a named line with the name
227 // ''<custom-ident>-start (for grid-*-start) / <custom-ident>-end'' (for grid-*-end), contributes the first such 223 // ''<custom-ident>-start (for grid-*-start) / <custom-ident>-end'' (for grid-*-end), contributes the first such
228 // line to the grid item's placement. 224 // line to the grid item's placement.
229 String namedGridLine = position.namedGridLine(); 225 String namedGridLine = position.namedGridLine();
230 ASSERT(GridResolvedPosition::isValidNamedLineOrArea(namedGridLine, gridC ontainerStyle, side)); 226 ASSERT(!position.namedGridLine().isNull());
231 227
232 const NamedGridLinesMap& gridLineNames = gridLinesForSide(gridContainerS tyle, side); 228 const NamedGridLinesMap& gridLineNames = gridLinesForSide(gridContainerS tyle, side);
233 NamedGridLinesMap::const_iterator implicitLineIter = gridLineNames.find( implicitNamedGridLineForSide(namedGridLine, side)); 229 NamedGridLinesMap::const_iterator implicitLineIter = gridLineNames.find( implicitNamedGridLineForSide(namedGridLine, side));
234 if (implicitLineIter != gridLineNames.end()) 230 if (implicitLineIter != gridLineNames.end())
235 return implicitLineIter->value[0]; 231 return implicitLineIter->value[0];
236 232
237 // Otherwise, if there is a named line with the specified name, contribu tes the first such line to the grid 233 // Otherwise, if there is a named line with the specified name, contribu tes the first such line to the grid
238 // item's placement. 234 // item's placement.
239 NamedGridLinesMap::const_iterator explicitLineIter = gridLineNames.find( namedGridLine); 235 NamedGridLinesMap::const_iterator explicitLineIter = gridLineNames.find( namedGridLine);
240 if (explicitLineIter != gridLineNames.end()) 236 if (explicitLineIter != gridLineNames.end())
241 return explicitLineIter->value[0]; 237 return explicitLineIter->value[0];
242 238
243 // If none of the above works specs mandate us to treat it as auto BUT w e should have detected it before calling 239 ASSERT(!GridResolvedPosition::isValidNamedLineOrArea(namedGridLine, grid ContainerStyle, side));
244 // this function in GridResolvedPosition::resolveGridPositionsFromStyle( ). We should be also covered by the 240 // If none of the above works specs mandate to assume that all the lines in the implicit grid have this name.
245 // ASSERT at the beginning of this block. 241 size_t lastLine = explicitGridSizeForSide(gridContainerStyle, side);
246 ASSERT_NOT_REACHED(); 242 return lastLine + 1;
247 return 0;
248 } 243 }
249 case AutoPosition: 244 case AutoPosition:
250 case SpanPosition: 245 case SpanPosition:
251 // 'auto' and span depend on the opposite position for resolution (e.g. grid-row: auto / 1 or grid-column: span 3 / "myHeader"). 246 // 'auto' and span depend on the opposite position for resolution (e.g. grid-row: auto / 1 or grid-column: span 3 / "myHeader").
252 ASSERT_NOT_REACHED(); 247 ASSERT_NOT_REACHED();
253 return 0; 248 return 0;
254 } 249 }
255 ASSERT_NOT_REACHED(); 250 ASSERT_NOT_REACHED();
256 return 0; 251 return 0;
257 } 252 }
(...skipping 28 matching lines...) Expand all
286 281
287 if (resolvedFinalPosition < resolvedInitialPosition) 282 if (resolvedFinalPosition < resolvedInitialPosition)
288 std::swap(resolvedFinalPosition, resolvedInitialPosition); 283 std::swap(resolvedFinalPosition, resolvedInitialPosition);
289 else if (resolvedFinalPosition == resolvedInitialPosition) 284 else if (resolvedFinalPosition == resolvedInitialPosition)
290 resolvedFinalPosition = resolvedInitialPosition + 1; 285 resolvedFinalPosition = resolvedInitialPosition + 1;
291 286
292 return GridSpan::untranslatedDefiniteGridSpan(resolvedInitialPosition, resol vedFinalPosition); 287 return GridSpan::untranslatedDefiniteGridSpan(resolvedInitialPosition, resol vedFinalPosition);
293 } 288 }
294 289
295 } // namespace blink 290 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/named-grid-lines-with-named-grid-areas-resolution.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698