| Index: Source/core/layout/LayoutBlockFlow.cpp
|
| diff --git a/Source/core/layout/LayoutBlockFlow.cpp b/Source/core/layout/LayoutBlockFlow.cpp
|
| index f5de61d020b13b1723007d6760db32721f8f04a5..90a3a45347d21d449fa44f83cadcea3936c97976 100644
|
| --- a/Source/core/layout/LayoutBlockFlow.cpp
|
| +++ b/Source/core/layout/LayoutBlockFlow.cpp
|
| @@ -548,13 +548,16 @@ void LayoutBlockFlow::layoutBlockChild(LayoutBox& child, MarginInfo& marginInfo,
|
| // Cache if we are at the top of the block right now.
|
| bool atBeforeSideOfBlock = marginInfo.atBeforeSideOfBlock();
|
| bool childIsSelfCollapsing = child.isSelfCollapsingBlock();
|
| + bool childDiscardMarginBefore = mustDiscardMarginBeforeForChild(child);
|
| + bool childDiscardMarginAfter = mustDiscardMarginAfterForChild(child);
|
|
|
| // Now determine the correct ypos based off examination of collapsing margin
|
| // values.
|
| - LayoutUnit logicalTopBeforeClear = collapseMargins(child, marginInfo, childIsSelfCollapsing);
|
| + LayoutUnit logicalTopBeforeClear = collapseMargins(child, marginInfo, childIsSelfCollapsing, childDiscardMarginBefore, childDiscardMarginAfter);
|
|
|
| // Now check for clear.
|
| - LayoutUnit logicalTopAfterClear = clearFloatsIfNeeded(child, marginInfo, oldPosMarginBefore, oldNegMarginBefore, logicalTopBeforeClear, childIsSelfCollapsing);
|
| + bool childDiscardMargin = childDiscardMarginBefore || childDiscardMarginAfter;
|
| + LayoutUnit logicalTopAfterClear = clearFloatsIfNeeded(child, marginInfo, oldPosMarginBefore, oldNegMarginBefore, logicalTopBeforeClear, childIsSelfCollapsing, childDiscardMargin);
|
|
|
| bool paginated = view()->layoutState()->isPaginated();
|
| if (paginated) {
|
| @@ -1122,11 +1125,8 @@ LayoutBlockFlow::MarginValues LayoutBlockFlow::marginValuesForChild(LayoutBox& c
|
| return LayoutBlockFlow::MarginValues(childBeforePositive, childBeforeNegative, childAfterPositive, childAfterNegative);
|
| }
|
|
|
| -LayoutUnit LayoutBlockFlow::collapseMargins(LayoutBox& child, MarginInfo& marginInfo, bool childIsSelfCollapsing)
|
| +LayoutUnit LayoutBlockFlow::collapseMargins(LayoutBox& child, MarginInfo& marginInfo, bool childIsSelfCollapsing, bool childDiscardMarginBefore, bool childDiscardMarginAfter)
|
| {
|
| - bool childDiscardMarginBefore = mustDiscardMarginBeforeForChild(child);
|
| - bool childDiscardMarginAfter = mustDiscardMarginAfterForChild(child);
|
| -
|
| // The child discards the before margin when the the after margin has discard in the case of a self collapsing block.
|
| childDiscardMarginBefore = childDiscardMarginBefore || (childDiscardMarginAfter && childIsSelfCollapsing);
|
|
|
| @@ -1305,7 +1305,7 @@ void LayoutBlockFlow::adjustPositionedBlock(LayoutBox& child, const MarginInfo&
|
| }
|
| }
|
|
|
| -LayoutUnit LayoutBlockFlow::clearFloatsIfNeeded(LayoutBox& child, MarginInfo& marginInfo, LayoutUnit oldTopPosMargin, LayoutUnit oldTopNegMargin, LayoutUnit yPos, bool childIsSelfCollapsing)
|
| +LayoutUnit LayoutBlockFlow::clearFloatsIfNeeded(LayoutBox& child, MarginInfo& marginInfo, LayoutUnit oldTopPosMargin, LayoutUnit oldTopNegMargin, LayoutUnit yPos, bool childIsSelfCollapsing, bool childDiscardMargin)
|
| {
|
| LayoutUnit heightIncrease = getClearDelta(&child, yPos);
|
| marginInfo.setLastChildIsSelfCollapsingBlockWithClearance(false);
|
| @@ -1315,7 +1315,6 @@ LayoutUnit LayoutBlockFlow::clearFloatsIfNeeded(LayoutBox& child, MarginInfo& ma
|
|
|
| if (childIsSelfCollapsing) {
|
| marginInfo.setLastChildIsSelfCollapsingBlockWithClearance(true);
|
| - bool childDiscardMargin = mustDiscardMarginBeforeForChild(child) || mustDiscardMarginAfterForChild(child);
|
| marginInfo.setDiscardMargin(childDiscardMargin);
|
|
|
| // For self-collapsing blocks that clear, they can still collapse their
|
|
|