Closed Bug 363150 Opened 18 years ago Closed 18 years ago

[FIX]Colspanning cell containing div with specified width makes table too wide

Categories

(Core :: Layout: Tables, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

()

Details

Attachments

(1 file, 1 obsolete file)

See testcase gavin posted in bug 363146 comment 4.  Patch coming up.
Attached patch Fix (obsolete) — Splinter Review
Pretty self-explanatory.  Alternately, we could set the pref coord before the min coord...
Attachment #247951 - Flags: superreview?(dbaron)
Attachment #247951 - Flags: review?(dbaron)
I'm no longer sure this is the right fix, by the way; I'll need to think about it a little bit more and make sure I understand the logic here.
Summary: [FIX]Colspanning cells with specified width make table too wide → [FIX]Colspanning cell containing div with specified width makes table too wide
Oh, no, I think this is the right fix, although the easier solution is just to switch the two lines.

That said, maybe a better fix is to remove the code I added that made AddMinCoord affect the pref coord and do it manually in the one place that needs it, which I think is actually right here.
Er, actually, this was not the reason I added that code to nsTableColFrame.h.  I was thinking of the PR_MAX that's right in the middle of the patch.  (It's a slightly confusing space-optimization, perhaps -- AddPrefCoord really tracks two different numbers, but only stores one since only one ever matters.)
And I realize I didn't comment the Span* variables very well -- I'll write a comment explaining what those actually do.

(The basic idea is that column-spanning cells distribute the *extra* space that they need to take up over the columns that they span, so the Span* variables include only the extra amount in adddition to what's done by non-spanning cells.  I think IE uses a 1-pass algorithm that only considers extra relative to non-spanning cells in earlier rows, though, but I don't like that since it's not row-order-invariant, and IE is the only browser that's not row-order-invariant.)
The patch looks fine; here's a version with additional comments.  At some point I should probably revisit what I wrote in an XXX comment (accumulating the specified coord as a width rather than as a boolean), which I think may make things a bit simpler.
Attachment #247951 - Attachment is obsolete: true
Attachment #248013 - Flags: superreview+
Attachment #248013 - Flags: review+
Attachment #247951 - Flags: superreview?(dbaron)
Attachment #247951 - Flags: review?(dbaron)
Comment on attachment 248013 [details] [diff] [review]
patch with comments

Looks good.  Thanks for the comments!  Please feel free to land this; I don't know when I'll be able to, but definitely not till Monday.
Attachment #248013 - Flags: review?(bzbarsky) → review+
Checked in to trunk.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: