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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp

Issue 1549153002: Fix preferred logical widths of orthogonal writing modes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: TestExpectations 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 /* 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 // See https://bugs.webkit.org/show_bug.cgi?id=116117 and http://crbug.com/2 40765. 97 // See https://bugs.webkit.org/show_bug.cgi?id=116117 and http://crbug.com/2 40765.
98 float previousMaxContentFlexFraction = -1; 98 float previousMaxContentFlexFraction = -1;
99 for (LayoutBox* child = firstChildBox(); child; child = child->nextSiblingBo x()) { 99 for (LayoutBox* child = firstChildBox(); child; child = child->nextSiblingBo x()) {
100 if (child->isOutOfFlowPositioned()) 100 if (child->isOutOfFlowPositioned())
101 continue; 101 continue;
102 102
103 LayoutUnit margin = marginIntrinsicLogicalWidthForChild(*child); 103 LayoutUnit margin = marginIntrinsicLogicalWidthForChild(*child);
104 104
105 LayoutUnit minPreferredLogicalWidth; 105 LayoutUnit minPreferredLogicalWidth;
106 LayoutUnit maxPreferredLogicalWidth; 106 LayoutUnit maxPreferredLogicalWidth;
107 bool hasOrthogonalWritingMode = child->isHorizontalWritingMode() != isHo rizontalWritingMode(); 107 computeChildPreferredLogicalWidths(*child, minPreferredLogicalWidth, max PreferredLogicalWidth);
cbiesinger 2016/01/15 05:31:47 Hmm I wonder why this didn't call that function in
kojii 2016/01/15 09:09:10 Great, thank you for the review.
108 if (hasOrthogonalWritingMode) {
109 minPreferredLogicalWidth = maxPreferredLogicalWidth = child->compute LogicalHeightWithoutLayout();
110 } else {
111 minPreferredLogicalWidth = child->minPreferredLogicalWidth();
112 maxPreferredLogicalWidth = child->maxPreferredLogicalWidth();
113 }
114 ASSERT(minPreferredLogicalWidth >= 0); 108 ASSERT(minPreferredLogicalWidth >= 0);
115 ASSERT(maxPreferredLogicalWidth >= 0); 109 ASSERT(maxPreferredLogicalWidth >= 0);
116 minPreferredLogicalWidth += margin; 110 minPreferredLogicalWidth += margin;
117 maxPreferredLogicalWidth += margin; 111 maxPreferredLogicalWidth += margin;
118 if (!isColumnFlow()) { 112 if (!isColumnFlow()) {
119 maxLogicalWidth += maxPreferredLogicalWidth; 113 maxLogicalWidth += maxPreferredLogicalWidth;
120 if (isMultiline()) { 114 if (isMultiline()) {
121 // For multiline, the min preferred width is if you put a break between each item. 115 // For multiline, the min preferred width is if you put a break between each item.
122 minLogicalWidth = std::max(minLogicalWidth, minPreferredLogicalW idth); 116 minLogicalWidth = std::max(minLogicalWidth, minPreferredLogicalW idth);
123 } else { 117 } else {
(...skipping 1418 matching lines...) Expand 10 before | Expand all | Expand 10 after
1542 ASSERT(child); 1536 ASSERT(child);
1543 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent; 1537 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent;
1544 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; 1538 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge;
1545 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent; 1539 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent;
1546 adjustAlignmentForChild(*child, newOffset - originalOffset); 1540 adjustAlignmentForChild(*child, newOffset - originalOffset);
1547 } 1541 }
1548 } 1542 }
1549 } 1543 }
1550 1544
1551 } 1545 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698