If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

DOM can't see the value contained in tHead of a Table

VERIFIED FIXED in M13

Status

()

Core
DOM: Core & HTML
P3
normal
VERIFIED FIXED
19 years ago
9 years ago

People

(Reporter: Jan Carpenter, Assigned: vidur (gone))

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [TESTCASE] patch added)

Attachments

(2 attachments)

(Reporter)

Description

19 years ago
Build:  1999-07-01-08-M8
All platforms

- In the spec for HTMLTableElement under tHead it says:  "Returns the table's
THEAD, or null if none exists."
- Using the following code, I get "null"
- I am uncertain whether I should be getting the actual value in tHead, or if I
should be getting "[object HTMLTableSectionElement]", but I know I should not be
getting "null"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>test</TITLE></HEAD>
<BODY>
<TABLE border=1>
  <THEAD>tHead text</THEAD>
  <TR><TD>The spec says: </TD>
      <TD>Returns the table's THEAD, or null if none exists.</TD></TR>
  <TR><TD>stuff</TD>
      <TD>More stuff</TD></TR>
</TABLE>
<SCRIPT TYPE="text/javascript">
document.write(oList=document.firstChild.childNodes[1].childNodes[2].tHead);
</SCRIPT>
</BODY></HTML>
(Reporter)

Updated

19 years ago
QA Contact: gerardok → janc
(Reporter)

Comment 1

19 years ago
same goes for tFoot
(Reporter)

Comment 2

19 years ago
Oops, the previous code had an error, this is the correct HTML code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>test</TITLE></HEAD>
<BODY>
<TABLE border=1>
  <THEAD><TR>tHead text</TR></THEAD>
  <TR><TD>The spec says: </TD>
      <TD>Returns the table's THEAD, or null if none exists.</TD></TR>
  <TR><TD>stuff</TD>
      <TD>More stuff</TD></TR>
</TABLE>
<SCRIPT TYPE="text/javascript">
document.write(document.firstChild.childNodes[1].childNodes[2].tHead);
</SCRIPT>
</BODY></HTML>

Comment 3

18 years ago
Created attachment 1284 [details]
Demonstration of error

Updated

18 years ago
Whiteboard: [TESTCASE] tHead (and tFoot) properties not implemented

Comment 4

18 years ago
Directly accessing a thead works - document.getElementsByTagName( "thead" )[0];
Using the tHead property doesn't - tablenode.tHead;
Tested on Win98 19990816 nightly build
Target Milestone: M11
Do we need this for beta?  Tentatively saying ``yes''.
Target Milestone: M11 → M12
Moving to M12.

Comment 7

18 years ago
This is the problem:
nsHTMLTableElement::GetTHead iterates over all children of the table and
compares the tagnames until it finds a <thead> tag. The problem is that the
tagnames are retrieved using GetTagName and compared to the thead tag in
nsHTMLAtoms.
The former returns elements in upper case and the latter contains elements in
lower case.

Inserting
	theadAsString.ToUpperCase()
after
	nsHTMLAtoms::thead->ToString(theadAsString);

fixes the problem but it should maybe be fixed elsewhere?

(There is a new implementation in the method commented out there because
GetElementsByTagName wasn't implemented, maybe this can be uncommented now?)

Updated

18 years ago
Blocks: 19509
(Assignee)

Comment 8

18 years ago
Moving off M12 radar for the time being. One or more might get back once I get a
chance to really look at them.
(Assignee)

Comment 9

18 years ago
In an attempt to get my bug list in order again, marking all the bugs I have
currently as ASSIGNED.

Updated

18 years ago
Whiteboard: [TESTCASE] tHead (and tFoot) properties not implemented → [TESTCASE] tHead (and tFoot) properties not implemented [WIP]

Comment 10

18 years ago
working on it...

Comment 11

18 years ago
Created attachment 3349 [details] [diff] [review]
patch that fixes this problem

Updated

18 years ago
Whiteboard: [TESTCASE] tHead (and tFoot) properties not implemented [WIP] → [TESTCASE] patch added

Comment 12

18 years ago
I added a patch that fixes this bug for thead and tfoot.  added some extra error
checking while I was at it.  only took a few minutes, since GetElementsByTagName
has been implemented.

awaiting your review, v.
(Assignee)

Comment 13

18 years ago
*** Bug 22678 has been marked as a duplicate of this bug. ***
(Assignee)

Updated

18 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED
(Assignee)

Comment 14

18 years ago
Fixed on 1/18/2000.
*** Bug 39214 has been marked as a duplicate of this bug. ***
Component: DOM Level 1 → DOM HTML

Updated

17 years ago
QA Contact: janc → desale

Comment 16

17 years ago
QA contact Update

Comment 17

17 years ago
Updating QA contact to Shivakiran Tummala.
QA Contact: desale → stummala

Comment 18

17 years ago
verified on build 2001-06-21-11-0.9.1 (windows 2000)...marking as verified
Status: RESOLVED → VERIFIED

Comment 19

17 years ago
verified on linux

Comment 20

17 years ago
verified on linux

Updated

9 years ago
Component: DOM: HTML → DOM: Core & HTML
QA Contact: stummala → general
You need to log in before you can comment on or make changes to this bug.