Closed Bug 309433 Opened 19 years ago Closed 18 years ago

[FIX]tr children of tables don't register in the rows collection XHTML

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: stryker330, Assigned: bzbarsky)

Details

(Keywords: testcase)

Attachments

(2 files, 1 obsolete file)

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

tr children of table elements, i.e. tr that aren't inside tbody, thead, or tfoot
elements, aren't in the rows collection.

This is probably related to bug 309431.

Opera 8 has the correct behavior.


Reproducible: Always

Steps to Reproduce:
Attached file testcase
Keywords: testcase
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached patch Proposed fix (obsolete) — Splinter Review
This basically lists the rows in the following order:

thead
tbodies
orphans (not in table section)
tfoot

As long as a page doesn't mix tbodies and orphan rows, there's no issue, of course.  ;)

Given that the DOM spec doesn't specify order for this collection, I'm perfectly happy with the behavior...
Assignee: general → bzbarsky
Status: NEW → ASSIGNED
Attachment #217907 - Flags: superreview?(bugmail)
Attachment #217907 - Flags: review?(bugmail)
OS: Windows XP → All
Priority: -- → P2
Hardware: PC → All
Summary: tr children of tables don't register in the rows collection XHTML → [FIX]tr children of tables don't register in the rows collection XHTML
Target Milestone: --- → mozilla1.9alpha
Why not instead make the DO_FOR_EACH_ROWGROUP macro provide the rows collection rather then the rowgroup. So something like

 #define DO_FOR_EACH_ROWGROUP(_code)                                  \
   PR_BEGIN_MACRO                                                     \
     if (mParent) {                                                   \
       /* THead */                                                    \
       nsCOMPtr<nsIDOMHTMLTableSectionElement> rowGroup;              \
       rv = mParent->GetTHead(getter_AddRefs(rowGroup));              \
       NS_ENSURE_SUCCESS(rv, rv);                                     \
       nsCOMPtr<nsIDOMHTMLCollection> rows;                           \
       if (rowGroup) {                                                \
         rowGroup->GetRows(getter_AddRefs(rows));                     \
         do { /* gives scoping */                                     \
           _code                                                      \
         } while (0);                                                 \


Then you can simply do

      /* orphan rows */                                              \
      rows = mOrphanRows;                                            \
      do { /* gives scoping */                                       \
        _code                                                        \
      } while (0);                                                   \

Attached patch With that changeSplinter Review
Attachment #217907 - Attachment is obsolete: true
Attachment #219204 - Flags: superreview?(bugmail)
Attachment #219204 - Flags: review?(bugmail)
Attachment #217907 - Flags: superreview?(bugmail)
Attachment #217907 - Flags: review?(bugmail)
Attachment #219204 - Flags: superreview?(bugmail)
Attachment #219204 - Flags: superreview+
Attachment #219204 - Flags: review?(bugmail)
Attachment #219204 - Flags: review+
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
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: