Bugzilla – Bug 15389
Flawed description of float position when a source-preceding box has a negative vertical margin
Last modified: 2012-12-04 00:53:34 UTC
Reported by Anton Prowse, Gérard Talbot
The resolution of Issue 229 (http://wiki.csswg.org/spec/css2.1#issue-229 ; see below) attempted to solve a problem whereby UAs don't obey the the rules for float positioning in certain cases where ource-preceding box has a negative vertical margin.
It did this by appending the following sentence to 9.5.1 after the nine rules for float positioning:
# But in CSS 2.1, if, within the block formatting context,
# there is an in-flow negative vertical margin such that
# the float's position is above the position it would be at
# were all such negative margins set to zero, the position
# of the float is undefined.
This sentence makes undefined cases where we expect float position to be defined. The position of the float is undefined in the following example:
Yet it fails to make undefined some of the cases which led this sentence to be introduced in the first place for reasons of lack of consensus on the desired behaviour and of lack of cross-browser interop. (It's trying to restrict the vertical margins under consideration in order to focus more closely on the specific issues of Issue 229.) The position of the float is defined in the following example:
but this was one of the cases which is handled differently by different UAs (some allowing the float to overlap earlier line boxes and others not).
This sentence serves no purpose if it fails to make undefined these cases. It should be fixed to solve Issue 229 (eg when the position of the float is calculated with the specified negative margins then at least Rule 6 needs to be ignored).
Discussion and proposal needed.
Floats effect on lines above placeholder
2 basic testcases for issue 229 [http://www.gtalbot.org/BrowserBugsSection/css21testsuite/testcase-for-issue-229.html]
Add, “If, within the BFC, there is an in-flow negative vertical margin such that the floats position is above the position it would be at were all such negative margins set to zero, the position of the float is undefined.”
I forgot to include the example of where the float position is defined for a case that was intended to be undefined:
(Note that Bug 15881 discusses an alternative approach to solving Issue 229 that makes fewer easy cases undefined.)