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

VERIFIED FIXED in Future

Status

()

Core
Layout: Tables
P2
normal
VERIFIED FIXED
15 years ago
14 years ago

People

(Reporter: Matias Larsson, Assigned: Bernd)

Tracking

({testcase})

Trunk
Future
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(2 attachments, 2 obsolete attachments)

(Reporter)

Description

15 years ago
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

Comment 2

15 years ago
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

Comment 3

15 years ago
Created attachment 114927 [details]
testcase ... with <table border="0">

reporter's 1st testcase provided as a bugzilla attachment (shows the bug)

Comment 4

15 years ago
Created attachment 114928 [details]
testcase ..... with <table border="1">

reporter's 2nd testcase provided as a bugzilla attachment. (renders correctly)

Comment 5

15 years ago
Created attachment 116574 [details]
testcase - showing cellpadding problem

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

Updated

15 years ago
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)

Updated

15 years ago
Target Milestone: --- → Future
(Assignee)

Comment 6

15 years ago
this bug can be fixed by backing out
http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&file=BasicTableLayoutStrategy.cpp&root=/cvsroot&subdir=mozilla/layout/html/table/src&command=DIFF_FRAMESET&rev1=3.200&rev2=3.201
(Assignee)

Comment 7

15 years ago
Created attachment 118849 [details] [diff] [review]
patch

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.
(Assignee)

Comment 8

15 years ago
*** Bug 199526 has been marked as a duplicate of this bug. ***
(Assignee)

Comment 9

15 years ago
mine
Assignee: table → bernd_mozilla
(Assignee)

Updated

15 years ago
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+
(Assignee)

Comment 11

14 years ago
fix and testcase checked in
Status: NEW → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED

Comment 12

14 years ago
v
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.