Closed Bug 307053 Opened 19 years ago Closed 19 years ago

Firefox does not add implicit tbody when document is served as application/xhtml+xml

Categories

(Core :: DOM: Core & HTML, defect)

1.7 Branch
x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: infinity0x, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.7.10) Gecko/20050717 Firefox/1.0.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.7.10) Gecko/20050717 Firefox/1.0.6

Firefox does not add an implicit TBODY when document is served as
application/xhtml+xml

and notice 



Reproducible: Always

Steps to Reproduce:
1.View the provided document
2.open up DOM inspector
3.Navigate to the second table

Actual Results:  
There is no tbody node between table and tr nodes. This does not happen when the
document is served as text/html.

This also disrupts application of CSS2. The CSS does not apply properly and
there is a border on the td nodes of the second table.

Expected Results:  
An implicit tbody should have been inserted as per the xhtml standards, and the
CSS should show no borders on the tables.

I have tried this on the version of Deer Park Alpha as of 23/08/2005, bug still
exists there.
<tbody> is optional in XHTML, not implicit.  See http://www.w3.org/TR/xhtml1/#C_11

->invalid
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Component: General → DOM: HTML
Product: Firefox → Core
Resolution: --- → INVALID
Version: unspecified → 1.7 Branch
I see... so why does firefox add a <TBODY> node when the file is served as HTML?
TBODY is optional in HTML too.

http://www.w3.org/TR/html4/struct/tables.html#h-11.2.3
<tbody> is implicit in HTML, not optional.  The start/end tags are optional,
which is what you linked to in the HTML4 spec.  This is made clear when you look
at the DTD fragments; <table> cannot directly contain any <tr> elements. 
<tbody> and related elements can contain them.  So the HTML parser will add a
tbody as needed.

The XHTML DTD was changed to allow <tr> children of <table>, in accordance with
<tbody>'s optional status in XHTML.  See the table section in
http://www.w3.org/TR/xhtml1/dtds.html#a_dtd_XHTML-1.0-Strict and compare to the
HTML4 DTD.
Component: DOM: HTML → DOM: Core & HTML
QA Contact: general → general
You need to log in before you can comment on or make changes to this bug.