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 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 Loading... | |
| 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 } |
| OLD | NEW |