Closed Bug 368932 Opened 13 years ago Closed 11 years ago

Repeatedly using appendChild with rows in a empty table breaks layout

Categories

(Core :: Layout: Tables, defect)

defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: mail, Assigned: bzbarsky)

References

Details

(Keywords: testcase)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a2pre) Gecko/20070131 Minefield/3.0a2pre
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a2pre) Gecko/20070131 Minefield/3.0a2pre

Each time you append a new row into a previously emptied table the row is displayed lower on the page.

Reproducible: Always

Steps to Reproduce:
use testcase

1. remove all children in table element.
2. append a row with cells into the table.
3. repeat.
Actual Results:  
Each time the row is added to the table it's displayed lower on the page.
Yet nothing unexpected is visible in DOM Inspector.

Expected Results:  
It should appear in the same spot every time.

This doesn't occur with DIVs, only with tables.

Discovered this in FF 2.0.0.1. Also found it happens in the latest nightly. Hope this isn't some stupid mistake of mine, but really a gecko/dom/layout/whatever bug. :))
Component: General → Layout
OS: Windows 2000 → All
Product: Firefox → Core
QA Contact: general → layout
Hardware: PC → All
Version: unspecified → Trunk
Confirmed with Mac trunk.

I think I've run into this bug, but I never took the time to make a reduced testcase.  Thanks :)
Status: UNCONFIRMED → NEW
Component: Layout → Layout: Tables
Ever confirmed: true
Keywords: testcase
QA Contact: layout → layout.tables
I'm still seeing this in

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1a1pre) Gecko/2008070102 Minefield/3.1a1pre

Someone with editbug care to confirm this? Thanks.
It's already confirmed. My guess would be this depends on a fix for bug 148810.
Depends on: 148810
> It's already confirmed.

Sure. What I meant is: change bug status to CONFIRMED.
There is no bug status CONFIRMED, that is what NEW means and this bug is currently in the NEW state.
/me crawls into hole... sorry for the spam.
(In reply to comment #1)
> Created an attachment (id=253571) [details]
> Testcase demonstrating the problem

Running the testcase on IE7 results in "Unknown runtime error" on line 15

   document.getElementById("targettablebody").innerHTML = "";

Obviously IE don't like a <table> without child nodes...

Is it really allowed to add a <tr> element as a child to a <table> element?
An implicit <tbody> is always generated from HTML.
Fixed by checkin for bug 148810.  Added tests.
Assignee: nobody → bzbarsky
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.