Closed Bug 47958 Opened 25 years ago Closed 25 years ago

XHTML ignores <td> height definitions

Categories

(Core :: Layout, defect, P3)

defect

Tracking

()

VERIFIED INVALID

People

(Reporter: unger, Assigned: nisheeth_mozilla)

References

()

Details

From Bugzilla Helper: User-Agent: Mozilla/4.7 [en] (Win98; I) BuildID: 2000089712 The height definition in a <td> tag is ignored. This bug occurs only in XHTML 1.0, not in HTML 4.0 Reproducible: Always Steps to Reproduce: 1.<td height="1"><img src="./figs/dot.gif" alt="Line" width="1" height="1" /></td> 2. 3. Actual Results: The table cell height is not 1 or 3 pixels but is of height of a normal character. Expected Results: The table cell has the height of 1 pixel. Tested with M16 and M17.
This is a duplicate of bug 47165. It has nothing to do with the element 'td' specifically. The problem is still present in M18 2000080620.. Somebody change status to DUPL.
Actually, change to DUPL 43570.
Bah. Actually, change to DUPL 29135.
Sorry the last comment was a typo. Should be DUPL 29125.
Caused by the bug 48351. *** This bug has been marked as a duplicate of 48351 ***
Status: UNCONFIRMED → RESOLVED
Closed: 25 years ago
Resolution: --- → DUPLICATE
Reopening. 1) This isn't a duplicate of 48351. Even if it weren't for (2), this should've been made to depend on 48351. 2) I think this is caused by the "standards" layout. xhtml gets standards layout by default, as does html 4.0 with a strict doctype specified. A quick test using the same code with Transitional and Strict doctypes gives a table 1px high and 19px high respectively. I take it the reference to ``HTML 4.0'' here was with a transitional/unspecified doctype? The height of a table cell is max("height",MIN) where "height" is the table cell's height attribute and MIN is the minimum height required by its content. It seems like the minimum height required by the <img> is treated as if it's a non-replaced inline element, for which the height is determined by "line-height" (see CSS2 $10.8). It should be treated as a replaced inline element, I think. This is XP, changing to All All, setting severity to normal, changing component to Layout.
Severity: major → normal
Status: RESOLVED → UNCONFIRMED
Component: XML → Layout
OS: Windows 98 → All
Hardware: PC → All
Resolution: DUPLICATE → ---
The practice has been to mark bugs caused by XHTML being parsed with the StrictDTD duplicates of bug 48351. (Look at the other duplicates of bug 48351.) This isn't caused by layout. The test case is being served as text/html. As a result, it gets parsed with the StrictDTD (bug 48351). The StrictDTD zaps the height attribute so that the attribute never gets to layout.
Are you sure those attributes are stripped? I just fed mozilla 2000-08-07-12-M17 (the one mentioned by the reporter) an xhtml document (<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">) served as text/html, containing a one cell table, with the td's height and width attributes set to 100, and it definitely showed a 100x100 cell. Same for html 4.0 strict btw. Hence I think it's a layout thing.
So, I missed something previously which renders this bug invalid. The <img> is correctly treated, and its inline box is indeed 1x1. It's the (root) inline box containing the <img>'s inline box which is more relevant here. For that inline box, "line-height" is the overriding value, making its height be 1.2*font-size, which makes MIN in my earlier comment for font-size=16 be 1.2*16=19.2, and thus max(1, 19.2) be 19.2, and the <td> be 19 pixels high (add padding etc.) A work-around for this is to use CSS to make the img act like a block level element instead of an inline element so the line-height stuff doesn't apply: img { display : block; } Marking this bug invalid.
Status: UNCONFIRMED → RESOLVED
Closed: 25 years ago25 years ago
Resolution: --- → INVALID
jag: Well, something like that anyway ;-)
Status: RESOLVED → VERIFIED
QA Contact: petersen → py8ieh=bugzilla
Of course, if you want the completely correct explanation, including all the messy bits, the gory details and the parts where you just have to pretend things make sense until they really do make sense, Hixie will gladly give this to you :-)
*** Bug 51319 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.