Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 1357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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()) { |
| 1377 child->setOverrideLogicalContentHeight(desiredLogicalHeight - ch ild->borderAndPaddingLogicalHeight()); | 1377 child->setOverrideLogicalContentHeight(desiredLogicalHeight - ch ild->borderAndPaddingLogicalHeight()); |
| 1378 child->setOverrideContainingBlockContentLogicalHeight(stretchedL ogicalHeight - child->borderAndPaddingLogicalHeight()); | |
|
cbiesinger
2014/06/24 03:01:28
I wrote this comment below before I thought of the
harpreet.sk
2014/06/24 07:57:00
I had made the changes to add desiredLogicalHeight
| |
| 1378 child->setLogicalHeight(0); | 1379 child->setLogicalHeight(0); |
| 1379 child->forceChildLayout(); | 1380 child->forceChildLayout(); |
| 1380 } | 1381 } |
| 1381 } | 1382 } |
| 1382 } else if (isColumnFlow() && child->style()->logicalWidth().isAuto()) { | 1383 } 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. | 1384 // FIXME: If the child doesn't have orthogonal flow, then it already has an override width set, so use it. |
| 1384 if (hasOrthogonalFlow(child)) { | 1385 if (hasOrthogonalFlow(child)) { |
| 1385 LayoutUnit childWidth = std::max<LayoutUnit>(0, lineCrossAxisExtent - crossAxisMarginExtentForChild(child)); | 1386 LayoutUnit childWidth = std::max<LayoutUnit>(0, lineCrossAxisExtent - crossAxisMarginExtentForChild(child)); |
| 1386 childWidth = child->constrainLogicalWidthByMinMax(childWidth, childW idth, this); | 1387 childWidth = child->constrainLogicalWidthByMinMax(childWidth, childW idth, this); |
| 1387 | 1388 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1419 ASSERT(child); | 1420 ASSERT(child); |
| 1420 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent; | 1421 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent; |
| 1421 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; | 1422 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; |
| 1422 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent; | 1423 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent; |
| 1423 adjustAlignmentForChild(child, newOffset - originalOffset); | 1424 adjustAlignmentForChild(child, newOffset - originalOffset); |
| 1424 } | 1425 } |
| 1425 } | 1426 } |
| 1426 } | 1427 } |
| 1427 | 1428 |
| 1428 } | 1429 } |
| OLD | NEW |