Closed Bug 193529 Opened 22 years ago Closed 21 years ago

background-color attribute for table rows not being rendered when constructed with DOM

Categories

(Core :: Layout: Tables, defect, P3)

defect

Tracking

()

RESOLVED DUPLICATE of bug 68061
Future

People

(Reporter: maly, Unassigned)

References

Details

(Keywords: testcase)

Attachments

(1 file, 3 obsolete files)

User-Agent:       Mozilla (X11; I; Linux 2.0.32 i586)
Build Identifier: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.2.1) Gecko/20021130

Attached are 2 testcases of achieving the same thing.  Click on the button
Insert Rows a couple of times to generate several rows of a simple table.  In
the first testcase, javascript creates a onmouseover="this.bgcolor='blue'"
attribute for the table row through the DOM.  In the second testcase, javascript
assigns a callback function to the onmouseover event, which calls a function
highlight2 to set the the background colour of this row to blue via
style="background-color='blue' through DOM.

Neither approaches work, yet they both should.  Both work if you do it on cells
(i.e. TD elements), but not rows (TR elements).

At the bottom of each testcase, you get the expected behaviour.  The static
version works just fine.

Reproducible: Always

Steps to Reproduce:
See details
Actual Results:  
see details

Expected Results:  
see details

This appears not to have anything with the onmouseover event, because I can set
other attributes via same code in both test cases.  This is definitely 
background-color for table rows not being rendered when it gets constructed
through DOM.
Attached file testcase1 to reproduce bug (obsolete) —
just move the mouse over the expected table and the constucted table from
hitting Insert Rows button.
Attached file testcase2 of the same bug (obsolete) —
just move the mouse over the expected table and the constucted table from
hitting Insert Rows button.
Attachment #114588 - Attachment mime type: text/plain → text/html
The problem is that you're appending <tr> elements directly to the <table>
element instead of the <tbody> inside the <table>... If you append the table
rows in the right place, things work.

That said, table layout _should_ be coping with a DOM like that (without a
tbody).  It could happen in XHTML, after all....  (if you could write such an
XHTML testcase with both the test table and the "expected" table having no
<tbody>, that would be great).

I suspect that something in the frame construction gets messed up, which leads
to issues.

Seeing this on Linux too.
Assignee: jst → table
Status: UNCONFIRMED → NEW
Component: DOM HTML → Layout: Tables
Ever confirmed: true
OS: Windows 98 → All
QA Contact: desale → madhur
Hardware: PC → All
... and 1.3b OS X
Component: Layout: Tables → DOM HTML
Actually both testcases that I submitted have no <tbody> in either the expected
or  in the dynamically created table.  However, after reading what you said, I
fired up the DOM inspector for kicks, and I noticed that Mozilla automatically
puts in the <tbody> tag, and sticks the rows under <tbody> for the static table.

Also I hacked the testcase1 to append to <tbody> and it works as you said it would.
Yeah, in HTML the <tbody> tag is implied (the opening and closing tags are
optional, but <tr> can't be a child of <table>, so the parser auto-opens the
<tbody>).  This is not the case in XHTML, which is why I'd love an XHTML
testcase (as application/xhtml+xml)
Attached file XHTML version of testcase 1 (obsolete) —
Here is the XHTML version of testcase 1 with appending the the rows directly to
<table> and not <tbody>.    File passed xmllint and checks out.
As this testcase shows, this is purely a table layout problem.
Attachment #114588 - Attachment is obsolete: true
Attachment #114590 - Attachment is obsolete: true
Attachment #114631 - Attachment is obsolete: true
tables.
Component: DOM HTML → Layout: Tables
is this a dupe of bug 68061 ? or does it depend on bug 68061?
Fixing that bug would likely fix this.....
Depends on: 68061
Keywords: testcase
Priority: -- → P3
Target Milestone: --- → Future
this looks fixed now... care to comment bz?
This was fixed by bug 68061 because we were mapping the style for the BODY into
the table cell instead of the style for the TABLE.

*** This bug has been marked as a duplicate of 68061 ***
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: