Closed Bug 309431 Opened 19 years ago Closed 19 years ago

tBodies collection doesn't include implicit tbody in XHTML DOM

Categories

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

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: stryker330, Unassigned)

Details

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050908 Firefox/1.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050908 Firefox/1.4

In a table without a tbody, the tBodies collection is empty. Although this is
probably the correct behavior, the W3C specs are ambiguous here.

The XHTML 1.0 spec states:

Also, some XHTML elements may or may not
appear in the object tree because they are optional in the content model (e.g.
the tbody
element within table). This occurs because in HTML 4 some elements were permitted to
be minimized such that their start and end tags are both omitted (an SGML
feature). This is
not possible in XML. Rather than require document authors to insert extraneous
elements,
XHTML has made the elements optional. User agents need to adapt to this
accordingly. For
further information on this topic, see [DOM2 [p.31] ]

And the DOM2 HTML spec states:

tBodies of type HTMLCollection [p.13] , readonly
Returns a collection of the table bodies (including implicit ones).

I couldn't find a section in either the DOM2 Core or HTML spec that provides
more clarification. The section on XHTML vs. HTML compatibility in the DOM2 HTML
spec doesn't mention the issue at all.

A good case can be made for backwards compatibility. At least a couple scripts
have code like |table.tBodies[0]|.

Opera 8 also has the same behavior here.

Reproducible: Always

Steps to Reproduce:
This is most likely INVALID. Could you please attach a proper testcase?
Attached file testcase
In XHTML the DOM is how you write it. (As in XML.) No implied elements and other
fancy tricks.

-> INVALID
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
Component: DOM: HTML → DOM: Core & HTML
QA Contact: ian → general
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: