Closed Bug 238472 Opened 21 years ago Closed 21 years ago

{inc} table cell too narrow

Categories

(Core :: Layout: Block and Inline, defect, P1)

x86
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla1.8alpha1

People

(Reporter: ajschult784, Assigned: dbaron)

References

()

Details

(Keywords: testcase, Whiteboard: [patch])

Attachments

(4 files)

this bug (mentioned by bryner in bug 232838 comment 20) makes the text at the top of bonsai wrap too much. the problem is that the text's table cell is too narrow. the bug occurs with linux trunk build 2004032208 and older builds back to 1.0, although I didn't see a dupe. The bug's appearance on bonsai is relatively recent, but appears to have simply been exposed as the testcase I'll attach occurs with older builds. also, adding "document.body.offsetHeight" at the appropriate place makes the bug occur with older builds.
Attached file testcase
with linux trunk 2004032208, the text appears as: Mail people it should be Mail people
The problem here is that during incr. reflow the block with the inline reports the available width back as the desired width. And then the table in auto mode sees the small desired width and gives the block what it requires. A block without inline frames reports a larger desired width back and then the text doesnt wrap. Bug 63916 is a similiar issue with inlines.
In the buggy case we're incorrectly setting the "wrapped" bit on the line with the BR, so the check of the previous line's wrapped bit in nsBlockFrame::ReflowLine fails. (I say incorrectly, not because it's documented what it should mean, but because there are two callers that assume that a line terminated by a BR should not have its "wrapped" bit set -- nsBlockFrame::ReflowLine and nsLineLayout::VerticalAlignFrames.)
Attached patch patchSplinter Review
This has some other comments I've added to nsBlockFrame.cpp since I last checked in to the file.
Attachment #144685 - Flags: superreview?(roc)
Attachment #144685 - Flags: review?(roc)
What was going on here is that a BR generates a break-after status, but without NS_FRAME_IS_NOT_COMPLETE. However, when it's inside an inline, the inline reports break-after *and* NS_FRAME_IS_NOT_COMPLETE. So I think it's the first of the two real changes that fixes the bug, but I made the second one anyway (although I'm not really sure when we'd execute that codepath).
Assignee: nobody → dbaron
Component: Layout: Tables → Layout: Block and Inline
Priority: -- → P1
Whiteboard: [patch]
Target Milestone: --- → mozilla1.7final
Comment on attachment 144685 [details] [diff] [review] patch (diff -ub) thanks guys!
Attachment #144685 - Flags: superreview?(roc)
Attachment #144685 - Flags: superreview+
Attachment #144685 - Flags: review?(roc)
Attachment #144685 - Flags: review+
Do you think we should take this for 1.7final? If we're sure it's not a regression than I'd be inclined to say no.
David, do you want to check this in?
Fix checked in to trunk, 2004-04-23 12:27 -0700.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Target Milestone: mozilla1.7final → mozilla1.8alpha
This probably improved perf some on pages with lots of <br>s too.. see bug 240282 .
Blocks: 240282
That's very good!!! I really appreciate your contributions!
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: