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

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: New patch set based on comments in patch set 1 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
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 1354 matching lines...) Expand 10 before | Expand all | Expand 10 after
1365 // FIXME: If the child has orthogonal flow, then it already has an overr ide height set, so use it. 1365 // FIXME: If the child has orthogonal flow, then it already has an overr ide height set, so use it.
1366 if (!hasOrthogonalFlow(child)) { 1366 if (!hasOrthogonalFlow(child)) {
1367 LayoutUnit heightBeforeStretching = needToStretchChildLogicalHeight( child) ? constrainedChildIntrinsicContentLogicalHeight(child) : child->logicalHe ight(); 1367 LayoutUnit heightBeforeStretching = needToStretchChildLogicalHeight( child) ? constrainedChildIntrinsicContentLogicalHeight(child) : child->logicalHe ight();
1368 LayoutUnit stretchedLogicalHeight = heightBeforeStretching + availab leAlignmentSpaceForChildBeforeStretching(lineCrossAxisExtent, child); 1368 LayoutUnit stretchedLogicalHeight = heightBeforeStretching + availab leAlignmentSpaceForChildBeforeStretching(lineCrossAxisExtent, child);
1369 ASSERT(!child->needsLayout()); 1369 ASSERT(!child->needsLayout());
1370 LayoutUnit desiredLogicalHeight = child->constrainLogicalHeightByMin Max(stretchedLogicalHeight, heightBeforeStretching - child->borderAndPaddingLogi calHeight()); 1370 LayoutUnit desiredLogicalHeight = child->constrainLogicalHeightByMin Max(stretchedLogicalHeight, heightBeforeStretching - child->borderAndPaddingLogi calHeight());
1371 1371
1372 // FIXME: Can avoid laying out here in some cases. See https://webki t.org/b/87905. 1372 // FIXME: Can avoid laying out here in some cases. See https://webki t.org/b/87905.
1373 if (desiredLogicalHeight != child->logicalHeight()) { 1373 if (desiredLogicalHeight != child->logicalHeight()) {
1374 child->setOverrideLogicalContentHeight(desiredLogicalHeight - ch ild->borderAndPaddingLogicalHeight()); 1374 child->setOverrideLogicalContentHeight(desiredLogicalHeight - ch ild->borderAndPaddingLogicalHeight());
1375 child->setOverrideContainingBlockContentLogicalHeight(desiredLog icalHeight - child->borderAndPaddingLogicalHeight());
1375 child->setLogicalHeight(0); 1376 child->setLogicalHeight(0);
1376 child->forceChildLayout(); 1377 child->forceChildLayout();
1377 } 1378 }
1378 } 1379 }
1379 } else if (isColumnFlow() && child->style()->logicalWidth().isAuto()) { 1380 } else if (isColumnFlow() && child->style()->logicalWidth().isAuto()) {
1380 // FIXME: If the child doesn't have orthogonal flow, then it already has an override width set, so use it. 1381 // FIXME: If the child doesn't have orthogonal flow, then it already has an override width set, so use it.
1381 if (hasOrthogonalFlow(child)) { 1382 if (hasOrthogonalFlow(child)) {
1382 LayoutUnit childWidth = std::max<LayoutUnit>(0, lineCrossAxisExtent - crossAxisMarginExtentForChild(child)); 1383 LayoutUnit childWidth = std::max<LayoutUnit>(0, lineCrossAxisExtent - crossAxisMarginExtentForChild(child));
1383 childWidth = child->constrainLogicalWidthByMinMax(childWidth, childW idth, this); 1384 childWidth = child->constrainLogicalWidthByMinMax(childWidth, childW idth, this);
1384 1385
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1416 ASSERT(child); 1417 ASSERT(child);
1417 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent; 1418 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent;
1418 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; 1419 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge;
1419 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent; 1420 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent;
1420 adjustAlignmentForChild(child, newOffset - originalOffset); 1421 adjustAlignmentForChild(child, newOffset - originalOffset);
1421 } 1422 }
1422 } 1423 }
1423 } 1424 }
1424 1425
1425 } 1426 }
OLDNEW
« Source/core/rendering/RenderBox.cpp ('K') | « Source/core/rendering/RenderBox.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698