Re: Issue 158 proposed text

So, then, current proposal for fixing issue 158.  As a reminder, it's
meant to address the issue found at
http://wiki.csswg.org/spec/css2.1#issue-158 and replace the text found
at http://www.w3.org/TR/CSS2/visuren.html#flow-control .

| 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 within its parent block.  This position is
| determined after the top margin of the element has been collapsed
| with all appropriate adjoining margins per normal margin-collapse
| rules, except that the clearing element's top margin is not allowed
| to collapse with the clearing element's bottom margin.
|
| If this hypothetical position of the element's top border edge is
| flush with or past the relevant floats, then no clearance is
| applied. Otherwise, the top margin of the element no longer
| collapses with preceding margins, and the clearance is set to the
| greater of:
| * The amount necessary to place the top border edge of the block
|   even with the bottom outer edge of the lowest float that is to be
|   cleared.
| * The amount necessary to place the top border edge of the block
|   even with the previously computed hypothetical position of the top
|   border edge of the element.  (Informative Note: This is necessary
|   to handle the case where the float moves due to the element's top
|   margin no longer collapsing with previous margins.)

Changes from the current spec text:

1. The definition of hypothetical position has changed slightly, to be
more precise and properly include and exclude the margins we want.
When calculating the hypothetical position, you collapse the top
margin of the element as normal with all adjoining margins, except not
with the element's bottom margin or those of following siblings (this
would only happen if the clearing element is completely empty).

2. The second bullet point has been rewritten to capture the intent in
a clearer manner, and has an informative note explaining the intent,
because it's really not obvious on a quick read.  The second bullet
point is meant to ensure that, in the case that the hypothetical
position isn't below the float and so clearance must be applied, but
the act of uncollapsing margins makes the float move so that the
hypothetical position is below the float, clearance still gets applied
properly to put the element at the hypothetical position.

~TJ

Received on Wednesday, 30 June 2010 15:53:40 UTC