RESOLVED FIXED 33245
Second right floated image misplacment
https://bugs.webkit.org/show_bug.cgi?id=33245
Summary Second right floated image misplacment
Benjamin Jay Young
Reported 2010-01-05 18:17:24 PST
In firefox, ie, opera the page (http://www.blahertech.org/about/staff) displays fine. However when using a webkit browser such as chrome and safari, my left floated images are displaying in misplaced areas. There is no known CSS issue that I know of that would be causing this, since I have cleared both sides.
Attachments
Test case (742 bytes, text/html)
2010-01-17 20:46 PST, mitz
no flags
Test case (794 bytes, text/html)
2010-01-17 21:29 PST, mitz
no flags
Work in progress (1.60 KB, patch)
2010-01-18 01:09 PST, mitz
no flags
Create a root line box for trailing floats after the line break on the last line (30.92 KB, patch)
2010-01-18 12:38 PST, mitz
darin: review+
Benjamin Jay Young
Comment 1 2010-01-05 18:18:57 PST
Excuse me, I meant right floated.
mitz
Comment 2 2010-01-05 20:49:12 PST
This behaves the way I would expect it to behave, given the <br> elements with "clear: both;" but perhaps I am missing something. A reduction would help.
Benjamin Jay Young
Comment 3 2010-01-06 06:14:53 PST
The br element is before the floated image. It should behave just as the image above it and have the text wrap around it. Yet the text seems to be behaving as if the br element is below the image, which it's not. The only reason I would expect this behavior is if the h3 tag would be clearing it, however this is not the case since the above method is repeated above and everything responds normally.
Benjamin Jay Young
Comment 4 2010-01-06 06:15:42 PST
Excuse me again, I meant the br element is above the image.
mitz
Comment 5 2010-01-15 08:35:36 PST
mitz
Comment 6 2010-01-17 20:46:05 PST
Created attachment 46784 [details] Test case This is based on the original page. It demonstrates how incremental layout can lead to wrong behavior.
mitz
Comment 7 2010-01-17 21:29:06 PST
Created attachment 46787 [details] Test case Simplified test case
mitz
Comment 8 2010-01-17 22:30:58 PST
See bug 19278. When the last line contains a line break, the floats vector for that line may potentially contain both floats occurring before the line break and floats occurring after the line break. For example, <img align="right"><br><img align="right"> Later, during incremental layout, when the line with the line break happens to be the last clean line, both kinds of floats are “restored”. If the <br> happens to be clearing, it will try to clear both, although it should not clear the image that comes after it. Perhaps the solution is not to put the “after the line break” floats in the next line box’s floats vector. When there is no next line box, make one.
mitz
Comment 9 2010-01-17 22:31:43 PST
(In reply to comment #8) > Perhaps the solution is not to put I meant “…the solution is to put…”.
mitz
Comment 10 2010-01-18 01:09:27 PST
Created attachment 46797 [details] Work in progress First cut. Breaks repaint and hit-testing due to the extra line. May want to have a RootInlineBox subclass for that, with virtualHeight().
mitz
Comment 11 2010-01-18 12:38:09 PST
Created attachment 46837 [details] Create a root line box for trailing floats after the line break on the last line
Darin Adler
Comment 12 2010-01-18 12:44:30 PST
Comment on attachment 46837 [details] Create a root line box for trailing floats after the line break on the last line Neither the change log nor the source files explain the role of this additional box. I think you need a one-sentence comment stating what, to you, is obvious. > + TrailingFloatsRootInlineBox(RenderObject* obj) : RootInlineBox(obj) I would call this "object", not "obj". > + virtual int virtualHeight() const { return 0; } I would make this member function private. It would be a programming error to call this with a TrailingFloatsRootInlineBox*.
Eric Seidel (no email)
Comment 14 2010-01-18 18:02:13 PST
Note You need to log in before you can comment on or make changes to this bug.