You need to
before you can comment on or make changes to this bug.
If you have an element set to float:right; and you follow it with another element set to clear:right; float:right; and then follow those first two elements with a third element set to float:left; the third element will not float next to the first element, even though it is not being cleared.
This bug is also present when the float directions are reversed from the example described above.
Created an attachment (id=12224) [details]
Test case of the clearing bug.
See the following link for a more real-world example of this bug:
Created an attachment (id=12229) [details]
Patch that does left/right y-computations separately.
This patch makes sure the "don't go above the previous float" rule treats left and right separately.
(From update of attachment 12229 [details])
+ FloatingObject* lastFloat = f;
Might as well initialize this to f->prev() to save an unnecessary pass through the while loop.
This bug is invalid. The previous behavior was correct. CSS2 9.5.1 rule 5 says:
The outer top of a floating box may not be higher than the outer top of any block or floated box generated by an element earlier in the source document.
(Below the rules, it says:
References to other elements in these rules refer only to other elements in the same block formatting context as the float.)
Can we get clarification on this?
Yeah, rule 5 is clear. I missed that. This bug was invalid. Will attach a new patch that backs out the behavior but retains the code cleanup.
For what it's worth, I do like the behavior I just implemented. Too bad it doesn't match the spec. :(
Created an attachment (id=12246) [details]
Patch that backs out this behavior and reverts to old behavior (while keeping code cleanup)
(From update of attachment 12246 [details])