Closed Bug 292759 Opened 20 years ago Closed 20 years ago

Incorect rendering of table height in XHTML pages when defined by %

Categories

(Core :: Layout: Tables, defect)

1.0 Branch
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: jstoller, Unassigned)

References

()

Details

(Keywords: testcase)

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2

An HTML table with it's height set to 100% will expand to fit the entire browser
window height. However, if you format that same page in XHTML, including the tag
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">, then the table
collapses down to it's minimum allowable height. Removing the DOCTYPE tag, while
keeping all other XHTML formatting intact, fixes the display, but breaks XHTML
standards compliance.

Reproducible: Always

Steps to Reproduce:
1. Create page using the transitional XHTML DTD: <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

2. Insert a table into the body of the page and set it's height equal to 100%
(adding a background color to the table will allow you to see the effects of this).

3. Load the page in FireFox.

Actual Results:  
FireFox ignores the height atribute.

Expected Results:  
The table should expand to fill 100% of the browser window's height.

This appears to be an old bug. I've reproduced it with an older version of
Mozilla on a Mac OS 9 system as well.
Testcase fails for me with Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US;
rv:1.8b2) Gecko/20050503 Firefox/1.0+
Keywords: testcase
Status: UNCONFIRMED → NEW
Component: General → Layout: Tables
Ever confirmed: true
Product: Firefox → Core
QA Contact: general → layout.tables
Version: unspecified → 1.0 Branch
>Expected Results:  
>The table should expand to fill 100% of the browser window's height.
this would only violate CSS2.1 see
http://www.w3.org/TR/CSS21/visudet.html#propdef-height

 The percentage is calculated with respect to the height of the generated box's
containing block. If the height of the containing block is not specified
explicitly (i.e., it depends on content height), and this element is not
absolutely positioned, the value is interpreted like 'auto'. A percentage height
on the root element is relative to the viewport.

what you expect is a quirk so use a quirk doctype rendering or specify the
height of the containing block.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
Because the table, in this case, is the outer most element on the page, it seems
as if the only containing block is the extent of the browser's window. However,
I was able to work around the problem by adding style attributes to both the
<body> and <html> tags, and setting their heights to 100%.

While I understand why it works this way, this approach is unintuitive and
contradictory. For instance if I set the background color attribute of the
<body> tag it fills the entire window, which leads one to expect that the body
block itself fills the entire window. It does not make sense that one
measurement is used for a documents body and an entirely different measurement
is used for that same body's background. In my opinion, the default behavior of
the browser should be to assume that the <body> and <html> tags extend to fill
the browser's window. This would be more consistent with other browser behaviors.
Because people expect something different we have the quirks mode and there it
works. The problem is that by providing a xhtml doctype mozilla assumes there is
a deal between the page author and the browser, that author has coded the page
standard compliant and mozilla should render it standards compliant. (see
http://www.mozilla.org/docs/web-developer/quirks/ and the quirk list
http://www.mozilla.org/docs/web-developer/quirks/quirklist.html )
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: