Commit 74420b3c authored by robhogan@gmail.com's avatar robhogan@gmail.com

Remove out-of-date FIXME on collapsing margins

CSS2.1 is now clear about what to do if the collapsed margins are
greater than the offset required to clear a float.

"Computing the clearance of an element on which 'clear' is set is done
by first determining the hypothetical position of the element's top
border edge. This position is where the actual top border edge would
have been if the element's 'clear' property had been 'none'. If this
hypothetical position of the element's top border edge is not past
the relevant floats, then clearance [..] is set to the greater of:
The amount necessary to place the border edge of the block even with
the bottom outer edge of the lowest float that is to be cleared. [or]
The amount necessary to place the top border edge of the block at
its hypothetical position."

http://www.w3.org/TR/CSS2/visuren.html#clearance


BUG=

Review URL: https://codereview.chromium.org/195743002

git-svn-id: svn://svn.chromium.org/blink/trunk@169798 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 0744c458
<div>
<p> The black box should be 5px below the float. </p>
<div style="height: 20px; width:50px; background-color: green; margin-bottom: 5px;"></div>
<div style="height: 10px; width:50px; background-color: blue; margin-top: 5px; margin-bottom: 5px;"></div>
<div style="height: 20px; width:50px; background-color: black; margin-top: 5px; "></div>
</div>
<div>
<p> The black box should be 5px below the float. </p>
<div style="height: 20px; width:50px; background-color: green; margin-bottom: 5px;"></div>
<div style="height: 10px; width:50px; background-color: blue; float:left;"></div>
<div style="height: 20px; width:50px; background-color: black; margin-top: 20px; clear:both"></div>
</div>
...@@ -1276,9 +1276,6 @@ LayoutUnit RenderBlockFlow::clearFloatsIfNeeded(RenderBox* child, MarginInfo& ma ...@@ -1276,9 +1276,6 @@ LayoutUnit RenderBlockFlow::clearFloatsIfNeeded(RenderBox* child, MarginInfo& ma
if (marginInfo.canCollapseWithMarginBefore()) { if (marginInfo.canCollapseWithMarginBefore()) {
// We can no longer collapse with the top of the block since a clear // We can no longer collapse with the top of the block since a clear
// occurred. The empty blocks collapse into the cleared block. // occurred. The empty blocks collapse into the cleared block.
// FIXME: This isn't quite correct. Need clarification for what to do
// if the height the cleared block is offset by is smaller than the
// margins involved.
setMaxMarginBeforeValues(oldTopPosMargin, oldTopNegMargin); setMaxMarginBeforeValues(oldTopPosMargin, oldTopNegMargin);
marginInfo.setAtBeforeSideOfBlock(false); marginInfo.setAtBeforeSideOfBlock(false);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment