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

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

Issue 289903007: Inline flexbox width is wrongly calculated when wrapping vertically (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressing comments of patch set 7 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 | « LayoutTests/css3/flexbox/multiline-shrink-to-fit-expected.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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 maxPreferredLogicalWidth += margin; 109 maxPreferredLogicalWidth += margin;
110 if (!isColumnFlow()) { 110 if (!isColumnFlow()) {
111 maxLogicalWidth += maxPreferredLogicalWidth; 111 maxLogicalWidth += maxPreferredLogicalWidth;
112 if (isMultiline()) { 112 if (isMultiline()) {
113 // For multiline, the min preferred width is if you put a break between each item. 113 // For multiline, the min preferred width is if you put a break between each item.
114 minLogicalWidth = std::max(minLogicalWidth, minPreferredLogicalW idth); 114 minLogicalWidth = std::max(minLogicalWidth, minPreferredLogicalW idth);
115 } else 115 } else
116 minLogicalWidth += minPreferredLogicalWidth; 116 minLogicalWidth += minPreferredLogicalWidth;
117 } else { 117 } else {
118 minLogicalWidth = std::max(minPreferredLogicalWidth, minLogicalWidth ); 118 minLogicalWidth = std::max(minPreferredLogicalWidth, minLogicalWidth );
119 if (isMultiline()) { 119 maxLogicalWidth = std::max(maxPreferredLogicalWidth, maxLogicalWidth );
120 // For multiline, the max preferred width is if you never break between items.
121 maxLogicalWidth += maxPreferredLogicalWidth;
122 } else
123 maxLogicalWidth = std::max(maxPreferredLogicalWidth, maxLogicalW idth);
124 } 120 }
125 } 121 }
126 122
127 maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth); 123 maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth);
128 124
129 LayoutUnit scrollbarWidth = instrinsicScrollbarLogicalWidth(); 125 LayoutUnit scrollbarWidth = instrinsicScrollbarLogicalWidth();
130 maxLogicalWidth += scrollbarWidth; 126 maxLogicalWidth += scrollbarWidth;
131 minLogicalWidth += scrollbarWidth; 127 minLogicalWidth += scrollbarWidth;
132 } 128 }
133 129
(...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after
1401 ASSERT(child); 1397 ASSERT(child);
1402 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent; 1398 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent;
1403 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; 1399 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge;
1404 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent; 1400 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent;
1405 adjustAlignmentForChild(child, newOffset - originalOffset); 1401 adjustAlignmentForChild(child, newOffset - originalOffset);
1406 } 1402 }
1407 } 1403 }
1408 } 1404 }
1409 1405
1410 } 1406 }
OLDNEW
« no previous file with comments | « LayoutTests/css3/flexbox/multiline-shrink-to-fit-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698