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

Side by Side Diff: Source/core/layout/LayoutBlockFlowLine.cpp

Issue 1121173002: Fix shrink-to-fit when children's writing-mode is orthogonal (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: float tests added + cleanup a bit Created 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ight reserved. 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ight reserved.
4 * Copyright (C) 2010 Google Inc. All rights reserved. 4 * Copyright (C) 2010 Google Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after
1313 childMin += margins; 1313 childMin += margins;
1314 childMax += margins; 1314 childMax += margins;
1315 } 1315 }
1316 } 1316 }
1317 1317
1318 if (!child->isLayoutInline() && !child->isText()) { 1318 if (!child->isLayoutInline() && !child->isText()) {
1319 // Case (2). Inline replaced elements and floats. 1319 // Case (2). Inline replaced elements and floats.
1320 // Go ahead and terminate the current line as far as 1320 // Go ahead and terminate the current line as far as
1321 // minwidth is concerned. 1321 // minwidth is concerned.
1322 LayoutUnit childMinPreferredLogicalWidth, childMaxPreferredLogic alWidth; 1322 LayoutUnit childMinPreferredLogicalWidth, childMaxPreferredLogic alWidth;
1323 if (child->isBox() && child->isHorizontalWritingMode() != isHori zontalWritingMode()) { 1323 minMaxPreferredLogicalWidthOfChild(*child, childMinPreferredLogi calWidth, childMaxPreferredLogicalWidth);
1324 LayoutBox* childBox = toLayoutBox(child);
1325 LogicalExtentComputedValues computedValues;
1326 childBox->computeLogicalHeight(childBox->borderAndPaddingLog icalHeight(), 0, computedValues);
1327 childMinPreferredLogicalWidth = childMaxPreferredLogicalWidt h = computedValues.m_extent;
1328 } else {
1329 childMinPreferredLogicalWidth = child->minPreferredLogicalWi dth();
1330 childMaxPreferredLogicalWidth = child->maxPreferredLogicalWi dth();
1331 }
1332 childMin += childMinPreferredLogicalWidth; 1324 childMin += childMinPreferredLogicalWidth;
1333 childMax += childMaxPreferredLogicalWidth; 1325 childMax += childMaxPreferredLogicalWidth;
1334 1326
1335 bool clearPreviousFloat; 1327 bool clearPreviousFloat;
1336 if (child->isFloating()) { 1328 if (child->isFloating()) {
1337 clearPreviousFloat = (prevFloat 1329 clearPreviousFloat = (prevFloat
1338 && ((prevFloat->styleRef().floating() == LeftFloat && (c hildStyle.clear() & CLEFT)) 1330 && ((prevFloat->styleRef().floating() == LeftFloat && (c hildStyle.clear() & CLEFT))
1339 || (prevFloat->styleRef().floating() == RightFloat & & (childStyle.clear() & CRIGHT)))); 1331 || (prevFloat->styleRef().floating() == RightFloat & & (childStyle.clear() & CRIGHT))));
1340 prevFloat = child; 1332 prevFloat = child;
1341 } else { 1333 } else {
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
2051 float logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false).toFloat (); 2043 float logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false).toFloat ();
2052 float availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), fal se) - logicalLeft; 2044 float availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), fal se) - logicalLeft;
2053 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid th, availableLogicalWidth, 0); 2045 updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWid th, availableLogicalWidth, 0);
2054 2046
2055 if (!style()->isLeftToRightDirection()) 2047 if (!style()->isLeftToRightDirection())
2056 return logicalWidth() - logicalLeft; 2048 return logicalWidth() - logicalLeft;
2057 return logicalLeft; 2049 return logicalLeft;
2058 } 2050 }
2059 2051
2060 } 2052 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698