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

Side by Side Diff: Source/core/rendering/RenderFlexibleBox.cpp

Issue 331203002: Blink doesn't honor percent heights on children of "align-self:stretch" flex items in a fixed-height (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addresses changes asked in comments in patch set 5 Created 6 years, 6 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/core/rendering/RenderBox.cpp ('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 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after
1366 { 1366 {
1367 if (!isColumnFlow() && child->style()->logicalHeight().isAuto()) { 1367 if (!isColumnFlow() && child->style()->logicalHeight().isAuto()) {
1368 // FIXME: If the child has orthogonal flow, then it already has an overr ide height set, so use it. 1368 // FIXME: If the child has orthogonal flow, then it already has an overr ide height set, so use it.
1369 if (!hasOrthogonalFlow(child)) { 1369 if (!hasOrthogonalFlow(child)) {
1370 LayoutUnit heightBeforeStretching = needToStretchChildLogicalHeight( child) ? constrainedChildIntrinsicContentLogicalHeight(child) : child->logicalHe ight(); 1370 LayoutUnit heightBeforeStretching = needToStretchChildLogicalHeight( child) ? constrainedChildIntrinsicContentLogicalHeight(child) : child->logicalHe ight();
1371 LayoutUnit stretchedLogicalHeight = heightBeforeStretching + availab leAlignmentSpaceForChildBeforeStretching(lineCrossAxisExtent, child); 1371 LayoutUnit stretchedLogicalHeight = heightBeforeStretching + availab leAlignmentSpaceForChildBeforeStretching(lineCrossAxisExtent, child);
1372 ASSERT(!child->needsLayout()); 1372 ASSERT(!child->needsLayout());
1373 LayoutUnit desiredLogicalHeight = child->constrainLogicalHeightByMin Max(stretchedLogicalHeight, heightBeforeStretching - child->borderAndPaddingLogi calHeight()); 1373 LayoutUnit desiredLogicalHeight = child->constrainLogicalHeightByMin Max(stretchedLogicalHeight, heightBeforeStretching - child->borderAndPaddingLogi calHeight());
1374 1374
1375 // FIXME: Can avoid laying out here in some cases. See https://webki t.org/b/87905. 1375 // FIXME: Can avoid laying out here in some cases. See https://webki t.org/b/87905.
1376 if (desiredLogicalHeight != child->logicalHeight()) { 1376 if (desiredLogicalHeight != child->logicalHeight()) {
cbiesinger 2014/06/25 04:14:32 So I just realized there's another bug here. Even
harpreet.sk 2014/06/25 14:43:08 For the given case i think we need to do relayout
1377 child->setOverrideLogicalContentHeight(desiredLogicalHeight - ch ild->borderAndPaddingLogicalHeight()); 1377 child->setOverrideLogicalContentHeight(desiredLogicalHeight - ch ild->borderAndPaddingLogicalHeight());
1378 child->setOverrideContainingBlockContentLogicalHeight(desiredLog icalHeight - child->borderAndPaddingLogicalHeight());
1378 child->setLogicalHeight(0); 1379 child->setLogicalHeight(0);
1379 child->forceChildLayout(); 1380 child->forceChildLayout();
1381 child->clearOverrideContainingBlockContentLogicalHeight();
1380 } 1382 }
1381 } 1383 }
1382 } else if (isColumnFlow() && child->style()->logicalWidth().isAuto()) { 1384 } else if (isColumnFlow() && child->style()->logicalWidth().isAuto()) {
1383 // FIXME: If the child doesn't have orthogonal flow, then it already has an override width set, so use it. 1385 // FIXME: If the child doesn't have orthogonal flow, then it already has an override width set, so use it.
1384 if (hasOrthogonalFlow(child)) { 1386 if (hasOrthogonalFlow(child)) {
1385 LayoutUnit childWidth = std::max<LayoutUnit>(0, lineCrossAxisExtent - crossAxisMarginExtentForChild(child)); 1387 LayoutUnit childWidth = std::max<LayoutUnit>(0, lineCrossAxisExtent - crossAxisMarginExtentForChild(child));
1386 childWidth = child->constrainLogicalWidthByMinMax(childWidth, childW idth, this); 1388 childWidth = child->constrainLogicalWidthByMinMax(childWidth, childW idth, this);
1387 1389
1388 if (childWidth != child->logicalWidth()) { 1390 if (childWidth != child->logicalWidth()) {
1389 child->setOverrideLogicalContentWidth(childWidth - child->border AndPaddingLogicalWidth()); 1391 child->setOverrideLogicalContentWidth(childWidth - child->border AndPaddingLogicalWidth());
(...skipping 29 matching lines...) Expand all
1419 ASSERT(child); 1421 ASSERT(child);
1420 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent; 1422 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent;
1421 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; 1423 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge;
1422 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent; 1424 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent;
1423 adjustAlignmentForChild(child, newOffset - originalOffset); 1425 adjustAlignmentForChild(child, newOffset - originalOffset);
1424 } 1426 }
1425 } 1427 }
1426 } 1428 }
1427 1429
1428 } 1430 }
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBox.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698