Closed Bug 194024 Opened 22 years ago Closed 21 years ago

Table cell not calculated correctly if cellpadding=0 and border=(0 or undefined)

Categories

(Core :: Layout: Tables, defect, P2)

defect

Tracking

()

VERIFIED FIXED
Future

People

(Reporter: matiasnu, Assigned: bernd_mozilla)

References

()

Details

(Keywords: testcase)

Attachments

(2 files, 2 obsolete files)

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.0.1) Gecko/20021220 Chimera/0.6+
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.0.1) Gecko/20021220 Chimera/0.6+

The first example will render with too wide td's. (the green stuff) The second
(the only change being border="1") will render as expected.

If you swap the textarea for a 100% wide div, it works as expected too, so I'm
not sure where this problem lies.

The rendering problem occurs in 1.3b, Chimera (Moz1.0) on both Mac and PC

Reproducible: Always

Steps to Reproduce:
1.Click on the provided URL ( http://homepage.mac.com/matias/bugs/bug.html )
2.Look at the first example
3.Look at the second example (which works as expected)

Actual Results:  
The outer table renders with too wide td's

Expected Results:  
Render it with td's with a witdh of 12px each (give or take a couple of pixels)
Seeing this with current trunk linux builds too...
Status: UNCONFIRMED → NEW
Ever confirmed: true
see this on winXP as well. I checked this on 1.2beta, 1.3 alpha and 1.3 beta.
All render the table width incorrectly for the first testcase.

IE renders the table width fine. 
Keywords: testcase
Priority: -- → P2
Attached file testcase ... with <table border="0"> (obsolete) —
reporter's 1st testcase provided as a bugzilla attachment (shows the bug)
Attached file testcase ..... with <table border="1"> (obsolete) —
reporter's 2nd testcase provided as a bugzilla attachment. (renders correctly)
Cell width is not calculated correctly if cellpadding=0 and border=0/undefined
Attachment #114927 - Attachment is obsolete: true
Attachment #114928 - Attachment is obsolete: true
Summary: The first example will render with too wide td's (the green stuff). The second (the only change being border="1") will render as expected. → Table cell not calculated correctly if cellpadding=0 and border=(0 or undefined)
Target Milestone: --- → Future
Attached patch patchSplinter Review
The problem here IMHO is that auto cells that contain only percentage based
childs will still have a non zero desired width but can have a zero min-, fix-
and pct width. Before checkin 201 we tried to avoid to assign widths to bogus
columns at the end, this happens when a colspan at the end spans columns that
are not populated with cells on other rows. Checkin 201 changed that behaviour
trying to avoid to give widths to columns that contain empty cells like a
<td></td>. As soon as the table cells have a padding or a border there minimum
content width is > 0 and the situation will be as before the checkin. The
attached patch expands that mechanism also to columns with a nonzero desired
width. To go further with this patch I would need access to testcases that the
checkin 201 tried to fix.
*** Bug 199526 has been marked as a duplicate of this bug. ***
mine
Assignee: table → bernd_mozilla
Attachment #118849 - Flags: superreview?(bzbarsky)
Attachment #118849 - Flags: review?(jkeiser)
Attachment #118849 - Flags: superreview?(bzbarsky) → superreview+
Comment on attachment 118849 [details] [diff] [review]
patch

You don't need to check GetMinWidth() or GetFixWidth() anymore, because desired
width will always be bigger than either of them.  Maybe the others too, but
those two are the obvious ones I can see.

The change is a good one though.  Racking my brain I can't think of things this
would fail on (because of the fact that we checked min width before already). 
Make darn sure this one goes through the regression tests though, please.
Attachment #118849 - Flags: review?(jkeiser) → review+
fix and testcase checked in
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
v
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: