Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 110 maxPreferredLogicalWidth = child->maxPreferredLogicalWidth(); | 110 maxPreferredLogicalWidth = child->maxPreferredLogicalWidth(); |
| 111 } | 111 } |
| 112 minPreferredLogicalWidth += margin; | 112 minPreferredLogicalWidth += margin; |
| 113 maxPreferredLogicalWidth += margin; | 113 maxPreferredLogicalWidth += margin; |
| 114 if (!isColumnFlow()) { | 114 if (!isColumnFlow()) { |
| 115 maxLogicalWidth += maxPreferredLogicalWidth; | 115 maxLogicalWidth += maxPreferredLogicalWidth; |
| 116 if (isMultiline()) { | 116 if (isMultiline()) { |
| 117 // For multiline, the min preferred width is if you put a break between each item. | 117 // For multiline, the min preferred width is if you put a break between each item. |
| 118 minLogicalWidth = std::max(minLogicalWidth, minPreferredLogicalW idth); | 118 minLogicalWidth = std::max(minLogicalWidth, minPreferredLogicalW idth); |
| 119 } else { | 119 } else { |
| 120 minLogicalWidth += minPreferredLogicalWidth; | 120 // We add minPreferredLogicalWidth only if is positive. Adding n egative widths does not make sense. |
|
cbiesinger
2015/05/27 16:50:19
minPreferredLogicalWidth should not be negative. W
| |
| 121 if (minPreferredLogicalWidth >= 0) | |
| 122 minLogicalWidth += minPreferredLogicalWidth; | |
| 121 } | 123 } |
| 122 } else { | 124 } else { |
| 123 minLogicalWidth = std::max(minPreferredLogicalWidth, minLogicalWidth ); | 125 minLogicalWidth = std::max(minPreferredLogicalWidth, minLogicalWidth ); |
| 124 maxLogicalWidth = std::max(maxPreferredLogicalWidth, maxLogicalWidth ); | 126 maxLogicalWidth = std::max(maxPreferredLogicalWidth, maxLogicalWidth ); |
| 125 } | 127 } |
| 126 } | 128 } |
| 127 | 129 |
| 128 maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth); | 130 maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth); |
| 129 | 131 |
| 130 LayoutUnit scrollbarWidth = intrinsicScrollbarLogicalWidth(); | 132 LayoutUnit scrollbarWidth = intrinsicScrollbarLogicalWidth(); |
| (...skipping 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1457 ASSERT(child); | 1459 ASSERT(child); |
| 1458 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent; | 1460 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent; |
| 1459 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; | 1461 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; |
| 1460 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent; | 1462 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent; |
| 1461 adjustAlignmentForChild(*child, newOffset - originalOffset); | 1463 adjustAlignmentForChild(*child, newOffset - originalOffset); |
| 1462 } | 1464 } |
| 1463 } | 1465 } |
| 1464 } | 1466 } |
| 1465 | 1467 |
| 1466 } | 1468 } |
| OLD | NEW |