This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 13079 - Having a relatively simple code: <table cellpadding=0 cellspacing=0 align="center" border=0 width=0954> <tr><td><table cellpadding=0 cellspacing=0 align="center" width=100% border=0> <tr> <td width=100% colspan="3" height=2 class="MNinner_line"><img src="
Summary: Having a relatively simple code: <table cellpadding=0 cellspacing=0 align="ce...
Status: RESOLVED INVALID
Alias: None
Product: HTML WG
Classification: Unclassified
Component: LC1 HTML5 spec (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-28 12:06 UTC by contributor
Modified: 2011-08-04 05:35 UTC (History)
6 users (show)

See Also:


Attachments

Description contributor 2011-06-28 12:06:31 UTC
Specification: http://dev.w3.org/html5/spec/Overview.html
Multipage: http://www.whatwg.org/C#top
Complete: http://www.whatwg.org/c#top

Comment:
Having a relatively simple code:
<table cellpadding=0 cellspacing=0 align="center" border=0 width=0954>
	<tr><td><table cellpadding=0 cellspacing=0 align="center" width=100%
border=0>
		<tr>
			<td width=100% colspan="3" height=2
class="MNinner_line"><img src="/Aspacer.gif" width=100% height=2></td>
		</tr>
		<tr>

			<td width=12% >&nbsp;</td>
			<td width=76% align="center"><b>Title</b></td>
			<td width=12% >&nbsp;</td>
		</tr>
		<tr>
			<td width=100% colspan="3" height=2
class="MNinner_line"><img src="/Aspacer.gif" width=100% height=2></td>
		</tr>

we are experiencing a rather perplexing problem. When we set the doctype to
html 5 (<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 5 Transitional//EN"
"http://www.w3.org/TR/html5/loose.dtd">), the background of the rows, with
css-class set to MNinner_line, stretches far beyond the specified height. This
is true for at least FireFox (v4), IE(v9) and Opera(v11.10).
Also, the problem disappears when we change doctype from html 5 to html 4.01.

The class MNinner_line is declared thus:
TD.MNinner_line { background-color:#244c81; }

Posted from: 217.13.17.134
User agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0
Comment 1 Henri Sivonen 2011-06-28 12:39:46 UTC
EDITORIAL ASSISTANT'S RESPONSE: This is an Editorial Assistant's Response to 
your comment. If you are satisfied with this response, please change the 
state of this bug to CLOSED. If you have additional information and would 
like the editor reconsider, please reopen this bug. If you would like to 
escalate the issue to the full HTML Working Group, please add the 
TrackerRequest keyword to this bug, and suggest title and text for the 
tracker issue; or you may create a tracker issue yourself, if you are able 
to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Rejected
Change Description: no spec change
Rationale: This behavior is an interoperable part of the platform now.
Comment 2 Julian Reschke 2011-06-28 13:05:10 UTC
Maybe it should also be mentioned that the doctype in the example is not the "HTML5 doctype".
Comment 3 Tab Atkins Jr. 2011-06-28 16:41:08 UTC
To be more specific, "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 5 Transitional//EN"
"http://www.w3.org/TR/html5/loose.dtd">" is *not* the HTML5 doctype.  The HTML5 doctype is "<!doctype html>".

The doctype you added is instead an unknown doctype, which triggers quirks mode and causes the strange behavior you see.
Comment 4 Simon Pieters 2011-06-29 06:28:27 UTC
(In reply to comment #3)
> The doctype you added is instead an unknown doctype, which triggers quirks mode

No it doesn't.
Comment 5 Tab Atkins Jr. 2011-06-29 18:33:36 UTC
Oh, derp, perhaps I should actually look at the code first.  You are of course right, zcorpan.

I hesitate to "correct" such horrible code, but the reason this happens is because <img> are inline by default.  Inline elements generate a linebox, which computes its height from the font-size.  Thus, the <td> is forced to be at least as tall as the linebox.  To fix this, make the <img>s be display:block instead.

The reason the "HTML 4.01" doctype worked is because the HTML4 Loose doctype triggers quirks-mode, where <img>s are display:block by default.
Comment 6 Michael[tm] Smith 2011-08-04 05:35:23 UTC
mass-move component to LC1