Bug 14827 - Floats can overlap the last line of the previous block
Summary: Floats can overlap the last line of the previous block
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-31 10:21 PDT by Brett Wilson (Google)
Modified: 2008-01-11 19:40 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brett Wilson (Google) 2007-07-31 10:21:01 PDT
Load the layout test:
  fast/block/float/multiple-float-positioning.html
The layout will be correct, the red boxes will not interfere with the text in the green box, although the borders will overlap.

Make the font bigger a couple of times (it takes 3 for me). Once the last word ("text") goes on its own line, the red boxes move up and interfere with the text, pushing the word to the right.
Comment 1 Eric Seidel (no email) 2008-01-11 15:28:40 PST
So this seems like a text-scaling issue, no?  The current text-scale is not taken into account by all layout calculations perhaps?
Comment 2 mitz 2008-01-11 15:33:55 PST
(In reply to comment #1)
> So this seems like a text-scaling issue, no?  The current text-scale is not
> taken into account by all layout calculations perhaps?
> 

No it's not. If you add "body { font-size: 28px; }" to the <style> element you get the same result.
Comment 3 Dave Hyatt 2008-01-11 19:40:40 PST
There's nothing wrong with this result.  It's exactly what you'd expect.  The floats occur after the word "text."  That means they can and will sit on the same line if possible.  At certain sizes, there is enough space available, and so the first left float is able to co-exist on the same line as "text."

The basic rule here is that floats should be positioned as high as possible, without occurring on a line prior to where they are declared.  Firefox and IE both bungle this rule and often put floats on the line *below* where they are declared.

See section 9.5.1 of the CSS2.1 spec.

http://www.w3.org/TR/CSS21/visuren.html#float-position

In particular rule 6 effectively defines the highest point of the float and rule 8 establishes that the float should be on the same line.