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/WebCore/rendering/RenderFlexibleBox.cpp

Issue 13674002: Support intrinsic values for height, min-height and max-height (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: CSS table tests Created 7 years, 8 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 | « Source/WebCore/rendering/RenderBox.cpp ('k') | Source/WebCore/rendering/RenderGrid.cpp » ('j') | 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 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 computeLogicalHeight(borderBoxLogicalHeight, logicalTop(), computedValue s); 527 computeLogicalHeight(borderBoxLogicalHeight, logicalTop(), computedValue s);
528 return std::max(LayoutUnit(0), computedValues.m_extent - borderPaddingAn dScrollbar); 528 return std::max(LayoutUnit(0), computedValues.m_extent - borderPaddingAn dScrollbar);
529 } 529 }
530 return contentLogicalWidth(); 530 return contentLogicalWidth();
531 } 531 }
532 532
533 LayoutUnit RenderFlexibleBox::computeMainAxisExtentForChild(RenderBox* child, Si zeType sizeType, const Length& size) 533 LayoutUnit RenderFlexibleBox::computeMainAxisExtentForChild(RenderBox* child, Si zeType sizeType, const Length& size)
534 { 534 {
535 // FIXME: This is wrong for orthogonal flows. It should use the flexbox's wr iting-mode, not the child's in order 535 // FIXME: This is wrong for orthogonal flows. It should use the flexbox's wr iting-mode, not the child's in order
536 // to figure out the logical height/width. 536 // to figure out the logical height/width.
537 // FIXME: This is wrong if the height is set to an intrinsic keyword value. computeContentLogicalHeight will return -1. 537 if (isColumnFlow()) {
538 // Instead, we need to layout the child an get the appropriate height value. 538 if (child->style()->logicalHeight().isIntrinsic() || child->style()->log icalMinHeight().isIntrinsic() ||
539 // https://bugs.webkit.org/show_bug.cgi?id=113610 539 child->style()->logicalMaxHeight().isIntrinsic()) {
540 if (isColumnFlow()) 540 if (child->needsLayout())
541 return child->computeContentLogicalHeight(size); 541 child->layout();
542 }
543 return child->computeContentLogicalHeight(size, child->logicalHeight() - child->borderAndPaddingLogicalHeight());
544 }
542 // FIXME: Figure out how this should work for regions and pass in the approp riate values. 545 // FIXME: Figure out how this should work for regions and pass in the approp riate values.
543 LayoutUnit offsetFromLogicalTopOfFirstPage = 0; 546 LayoutUnit offsetFromLogicalTopOfFirstPage = 0;
544 RenderRegion* region = 0; 547 RenderRegion* region = 0;
545 return child->computeLogicalWidthInRegionUsing(sizeType, size, contentLogica lWidth(), this, region, offsetFromLogicalTopOfFirstPage) - child->borderAndPaddi ngLogicalWidth(); 548 return child->computeLogicalWidthInRegionUsing(sizeType, size, contentLogica lWidth(), this, region, offsetFromLogicalTopOfFirstPage) - child->borderAndPaddi ngLogicalWidth();
546 } 549 }
547 550
548 WritingMode RenderFlexibleBox::transformedWritingMode() const 551 WritingMode RenderFlexibleBox::transformedWritingMode() const
549 { 552 {
550 WritingMode mode = style()->writingMode(); 553 WritingMode mode = style()->writingMode();
551 if (!isColumnFlow()) 554 if (!isColumnFlow())
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
1382 } 1385 }
1383 } 1386 }
1384 } 1387 }
1385 1388
1386 void RenderFlexibleBox::applyStretchAlignmentToChild(RenderBox* child, LayoutUni t lineCrossAxisExtent) 1389 void RenderFlexibleBox::applyStretchAlignmentToChild(RenderBox* child, LayoutUni t lineCrossAxisExtent)
1387 { 1390 {
1388 if (!isColumnFlow() && child->style()->logicalHeight().isAuto()) { 1391 if (!isColumnFlow() && child->style()->logicalHeight().isAuto()) {
1389 // FIXME: If the child has orthogonal flow, then it already has an overr ide height set, so use it. 1392 // FIXME: If the child has orthogonal flow, then it already has an overr ide height set, so use it.
1390 if (!hasOrthogonalFlow(child)) { 1393 if (!hasOrthogonalFlow(child)) {
1391 LayoutUnit stretchedLogicalHeight = child->logicalHeight() + availab leAlignmentSpaceForChild(lineCrossAxisExtent, child); 1394 LayoutUnit stretchedLogicalHeight = child->logicalHeight() + availab leAlignmentSpaceForChild(lineCrossAxisExtent, child);
1392 LayoutUnit desiredLogicalHeight = child->constrainLogicalHeightByMin Max(stretchedLogicalHeight); 1395 ASSERT(!child->needsLayout());
1396 LayoutUnit desiredLogicalHeight = child->constrainLogicalHeightByMin Max(stretchedLogicalHeight, child->logicalHeight() - child->borderAndPaddingLogi calHeight());
1393 1397
1394 // FIXME: Can avoid laying out here in some cases. See https://webki t.org/b/87905. 1398 // FIXME: Can avoid laying out here in some cases. See https://webki t.org/b/87905.
1395 if (desiredLogicalHeight != child->logicalHeight()) { 1399 if (desiredLogicalHeight != child->logicalHeight()) {
1396 child->setOverrideLogicalContentHeight(desiredLogicalHeight - ch ild->borderAndPaddingLogicalHeight()); 1400 child->setOverrideLogicalContentHeight(desiredLogicalHeight - ch ild->borderAndPaddingLogicalHeight());
1397 child->setLogicalHeight(0); 1401 child->setLogicalHeight(0);
1398 child->setChildNeedsLayout(true, MarkOnlyThis); 1402 child->setChildNeedsLayout(true, MarkOnlyThis);
1399 child->layout(); 1403 child->layout();
1400 } 1404 }
1401 } 1405 }
1402 } else if (isColumnFlow() && child->style()->logicalWidth().isAuto()) { 1406 } else if (isColumnFlow() && child->style()->logicalWidth().isAuto()) {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1438 ASSERT(child); 1442 ASSERT(child);
1439 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent; 1443 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent;
1440 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; 1444 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge;
1441 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent; 1445 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent;
1442 adjustAlignmentForChild(child, newOffset - originalOffset); 1446 adjustAlignmentForChild(child, newOffset - originalOffset);
1443 } 1447 }
1444 } 1448 }
1445 } 1449 }
1446 1450
1447 } 1451 }
OLDNEW
« no previous file with comments | « Source/WebCore/rendering/RenderBox.cpp ('k') | Source/WebCore/rendering/RenderGrid.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698