Closed Bug 386147 Opened 19 years ago Closed 19 years ago

Don't cut off floats at the bottom of the page

Categories

(Core :: Layout: Floats, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: sharparrow1, Assigned: sharparrow1)

References

Details

Attachments

(4 files)

Attached patch Partial fixSplinter Review
Simple testcase: <div style="font-size: 1in"> <div style="float:left;"> a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br>a<br></div> <div style="float:left"> bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb The issue with the partial fix is that it doesn't actually make this testcase render quite right; it seems the continued float ends up with a width of zero for some reason I haven't figured out.
The rest of the problem is really fun: continuations have a preferred width of zero! (The reason is that continuations don't have any children until they are reflowed.) dbaron: any suggestions as to the correct way to fix this?
Comment on attachment 270141 [details] [diff] [review] Partial fix (Since this part of the fix is independent, I might as well get it reviewed separately.)
Attachment #270141 - Flags: review?(roc)
Shouldn't the continuation automatically use the same width as the prev-in-flow? Though maybe we should make its intrinsic width methods work anyway. That said, we need to make the first-in-flow's intrinsic width calculation function consider the contents of the next-in-flows once we've already done a reflow. (Consider incremental reflow inside columns.)
(In reply to comment #3) > Shouldn't the continuation automatically use the same width as the > prev-in-flow? Though maybe we should make its intrinsic width methods work > anyway. Possibly, but maybe not; if we ever support anything like putting even pages into landscape, we wouldn't want that. It's not too hard anyway; I think we can just make the method forward to the first-in-flow. > That said, we need to make the first-in-flow's intrinsic width calculation > function consider the contents of the next-in-flows once we've already done a > reflow. (Consider incremental reflow inside columns.) Right... maybe add nsBlockFrame::GetMin/PrefWidthInternal and call through all the continuations from the first-in-flow? I'd like to know whether this approach sounds reasonable before I start coding it.
That would work -- not sure if there's even a need for an extra method. You could just get the first-in-flow and use its member variables, and then make the loop loop over in-flows. You'd also need to fix MarkIntrinsicWidthsDirty to mark them dirty on the first-in-flow.
Attached patch Second partSplinter Review
Okay, patch using outlined method. (I'll also attach a diff -w to make reviewing easier.)
Assignee: nobody → sharparrow1
Status: NEW → ASSIGNED
Attachment #270200 - Flags: review?(dbaron)
First part checked in.
Flags: in-testsuite?
Depends on: 386900
Depends on: 386988
Comment on attachment 270200 [details] [diff] [review] Second part I think you want to traverse the continuation chain, not the in-flow chain. Currently I don't think there's a difference, but if we implement forced breaks at some point in a way that causes blocks to be continuations but not in-flows, we'd want this to traverse them too. (And we'd certainly want that for text-indent, so if you don't make that change, you need to undo the GetPrevContinuation() changes you made regarding text-indent.) > #ifdef IBMBIDI >- ResolveBidi(); >+ > #endif // IBMBIDI Remove the ifdefs, too? r+sr=dbaron with that
Attachment #270200 - Flags: superreview+
Attachment #270200 - Flags: review?(dbaron)
Attachment #270200 - Flags: review+
And thanks for cleaning up after me on this one, and sorry for the delay reviewing it.
Checked in with reftest.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Flags: in-testsuite? → in-testsuite+
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: