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

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

Issue 1420283011: [css-flexbox] Make min-size:auto work correctly with an explicit width on the flex item (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 | « third_party/WebKit/LayoutTests/css3/flexbox/imported/flexbox_direction-row-reverse-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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 // Otherwise we need the logical height. 442 // Otherwise we need the logical height.
443 if (isHorizontalFlow() != child.styleRef().isHorizontalWritingMode()) { 443 if (isHorizontalFlow() != child.styleRef().isHorizontalWritingMode()) {
444 // We don't have to check for "auto" here - computeContentLogicalHeight will just return -1 for that case anyway. 444 // We don't have to check for "auto" here - computeContentLogicalHeight will just return -1 for that case anyway.
445 // It's safe to access scrollbarLogicalHeight here because computeNextFl exLine will have already 445 // It's safe to access scrollbarLogicalHeight here because computeNextFl exLine will have already
446 // forced layout on the child. 446 // forced layout on the child.
447 return child.computeContentLogicalHeight(sizeType, size, child.contentLo gicalHeight()) + child.scrollbarLogicalHeight(); 447 return child.computeContentLogicalHeight(sizeType, size, child.contentLo gicalHeight()) + child.scrollbarLogicalHeight();
448 } 448 }
449 // computeLogicalWidth always re-computes the intrinsic widths. However, whe n our logical width is auto, 449 // computeLogicalWidth always re-computes the intrinsic widths. However, whe n our logical width is auto,
450 // we can just use our cached value. So let's do that here. (Compare code in LayoutBlock::computePreferredLogicalWidths) 450 // we can just use our cached value. So let's do that here. (Compare code in LayoutBlock::computePreferredLogicalWidths)
451 LayoutUnit borderAndPadding = child.borderAndPaddingLogicalWidth(); 451 LayoutUnit borderAndPadding = child.borderAndPaddingLogicalWidth();
452 if (styleRef().logicalWidth().isAuto()) { 452 if (child.styleRef().logicalWidth().isAuto()) {
453 if (size.type() == MinContent) 453 if (size.type() == MinContent)
454 return child.minPreferredLogicalWidth() - borderAndPadding; 454 return child.minPreferredLogicalWidth() - borderAndPadding;
455 if (size.type() == MaxContent) 455 if (size.type() == MaxContent)
456 return child.maxPreferredLogicalWidth() - borderAndPadding; 456 return child.maxPreferredLogicalWidth() - borderAndPadding;
457 } 457 }
458 return child.computeLogicalWidthUsing(sizeType, size, contentLogicalWidth(), this) - borderAndPadding; 458 return child.computeLogicalWidthUsing(sizeType, size, contentLogicalWidth(), this) - borderAndPadding;
459 } 459 }
460 460
461 WritingMode LayoutFlexibleBox::transformedWritingMode() const 461 WritingMode LayoutFlexibleBox::transformedWritingMode() const
462 { 462 {
(...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after
1518 ASSERT(child); 1518 ASSERT(child);
1519 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent; 1519 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent;
1520 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; 1520 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge;
1521 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent; 1521 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent;
1522 adjustAlignmentForChild(*child, newOffset - originalOffset); 1522 adjustAlignmentForChild(*child, newOffset - originalOffset);
1523 } 1523 }
1524 } 1524 }
1525 } 1525 }
1526 1526
1527 } 1527 }
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/css3/flexbox/imported/flexbox_direction-row-reverse-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698