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

Side by Side Diff: Source/core/rendering/RenderFlexibleBox.cpp

Issue 290823003: Chrome incorrectly honors "align-content" in "flex-wrap: wrap" flex containers that only have a sin… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Modified LayoutTests Created 6 years, 7 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 | « LayoutTests/css3/flexbox/multiline-align-content.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after
1202 mainAxisOffset -= flowAwareMarginStartForChild(child); 1202 mainAxisOffset -= flowAwareMarginStartForChild(child);
1203 1203
1204 ++seenInFlowPositionedChildren; 1204 ++seenInFlowPositionedChildren;
1205 if (seenInFlowPositionedChildren < numberOfChildrenForJustifyContent) 1205 if (seenInFlowPositionedChildren < numberOfChildrenForJustifyContent)
1206 mainAxisOffset -= justifyContentSpaceBetweenChildren(availableFreeSp ace, style()->justifyContent(), numberOfChildrenForJustifyContent); 1206 mainAxisOffset -= justifyContentSpaceBetweenChildren(availableFreeSp ace, style()->justifyContent(), numberOfChildrenForJustifyContent);
1207 } 1207 }
1208 } 1208 }
1209 1209
1210 static LayoutUnit initialAlignContentOffset(LayoutUnit availableFreeSpace, EAlig nContent alignContent, unsigned numberOfLines) 1210 static LayoutUnit initialAlignContentOffset(LayoutUnit availableFreeSpace, EAlig nContent alignContent, unsigned numberOfLines)
1211 { 1211 {
1212 if (numberOfLines <= 1)
1213 return 0;
1212 if (alignContent == AlignContentFlexEnd) 1214 if (alignContent == AlignContentFlexEnd)
1213 return availableFreeSpace; 1215 return availableFreeSpace;
1214 if (alignContent == AlignContentCenter) 1216 if (alignContent == AlignContentCenter)
1215 return availableFreeSpace / 2; 1217 return availableFreeSpace / 2;
1216 if (alignContent == AlignContentSpaceAround) { 1218 if (alignContent == AlignContentSpaceAround) {
1217 if (availableFreeSpace > 0 && numberOfLines) 1219 if (availableFreeSpace > 0 && numberOfLines)
1218 return availableFreeSpace / (2 * numberOfLines); 1220 return availableFreeSpace / (2 * numberOfLines);
1219 if (availableFreeSpace < 0) 1221 if (availableFreeSpace < 0)
1220 return availableFreeSpace / 2; 1222 return availableFreeSpace / 2;
1221 } 1223 }
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
1411 ASSERT(child); 1413 ASSERT(child);
1412 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent; 1414 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent;
1413 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; 1415 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge;
1414 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent; 1416 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent;
1415 adjustAlignmentForChild(child, newOffset - originalOffset); 1417 adjustAlignmentForChild(child, newOffset - originalOffset);
1416 } 1418 }
1417 } 1419 }
1418 } 1420 }
1419 1421
1420 } 1422 }
OLDNEW
« no previous file with comments | « LayoutTests/css3/flexbox/multiline-align-content.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698