Op7-8 and IE7-/Win: Incorrect spacing between a float and a clear caused by an earlier margin

In Op7-8 the first test below shows a 30px space between B and C, while there should be no space. It seems that the bottom-margin of A is repeated there. Indeed in the second test the margin-bottom of A is 50px and in Op7 there is a 50px space between B and C. The problem has been corrected in Op9.

block A with 30px margin-bottom
floated block B with zero margins
cleared block C with zero margins
block A with 50px margin-bottom
floated block B with zero margins
cleared block C with zero margins

The problem doesn't occur if there is content beside the float, before the clear. An empty box, which doesn't have any visual effect (even when the float is 100% wide) is sufficient. (Of course this is not a pure CSS fix since it implies adding something to the markup, So it's probably better to simply avoid this construction and get the desired space between A and B in a different way.)

block A with 30px margin-bottom
floated block B with zero margins, followed by an empty div
cleared block C with zero margins

IE7-/Win has the same problem, but only when the clear doesn't have hasLayout. In the below test the clear doesn't have any dimension, and the problem occurs in IE7-/Win as well.

block A with 30px margin-bottom
floated block B with zero margins
cleared block C with zero margins

Similar bugs:

CSS tests home