WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
16657
Acid3 failure since table.caption and table.thead do not work for nodes added by appendChild
https://bugs.webkit.org/show_bug.cgi?id=16657
Summary
Acid3 failure since table.caption and table.thead do not work for nodes added...
Eric Seidel (no email)
Reported
2007-12-28 22:09:58 PST
Acid3 expects empty table caption to produce (!table.caption == false) Likewise an empty tHead to produce (!table.tHead == false) These both evaluate to empty strings in WebKit when set, but set to empty. We'll have to check other browsers to see what they do (or check the spec(s). function () { // test 65: construct a table, and see if the table is as expected var ok = true; var table = document.createElement('table'); table.appendChild(document.createElement('tbody')); var tr1 = document.createElement('tr'); table.appendChild(tr1); table.appendChild(document.createElement('caption')); table.appendChild(document.createElement('thead')); // <table><tbody/><tr/><caption/><thead/> table.insertBefore(table.firstChild.nextSibling, null); // move the <tr/> to the end // <table><tbody/><caption/><thead/><tr/> table.replaceChild(table.firstChild, table.lastChild); // move the <tbody/> to the end and remove the <tr> // <table><caption/><thead/><tbody/> var tr2 = table.tBodies[0].insertRow(0); // <table><caption/><thead/><tbody><tr/></tbody> if ((table.tBodies[0].rows[0].rowIndex != 0) || (table.tBodies[0].rows[0].sectionRowIndex != 0) || (table.childNodes.length != 3) || (!table.caption) || (!table.tHead) || (table.tFoot) || (table.tBodies.length != 1) || (table.rows.length != 1)) ok = false; if (tr1.parentNode) ok = false; if ((table.caption != table.createCaption()) || (table.tFoot != null) || (table.tHead != table.createTHead())) ok = false; if (table.createTFoot() != table.tFoot) ok = false; // either: <table><caption/><thead/><tbody><tr/></tbody><tfoot/> // or: <table><caption/><thead/><tfoot/><tbody><tr/></tbody> table.tHead.appendChild(tr1); // either: <table><caption/><thead><tr/></thead><tbody><tr/></tbody><tfoot/> // or: <table><caption/><thead><tr/></thead><tfoot/><tbody><tr/></tbody> if ((table.rows[0] != table.tHead.firstChild) || (table.rows.length != 2) || (table.rows[1] != table.tBodies[0].firstChild)) ok = false; if (ok) return 5; },
Attachments
patch (fixes this and bug 16659 too)
(88.22 KB, patch)
2008-01-01 22:38 PST
,
Darin Adler
mjs
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Eric Seidel (no email)
Comment 1
2007-12-30 23:45:23 PST
It looks like the addChild logic is never called for appendChild, thus the HTMLTableElement doesn't know to fix up its m_caption pointer.
Darin Adler
Comment 2
2008-01-01 21:58:26 PST
I've got a fix for this.
Darin Adler
Comment 3
2008-01-01 22:38:30 PST
Created
attachment 18233
[details]
patch (fixes this and
bug 16659
too)
Eric Seidel (no email)
Comment 4
2008-01-01 22:53:55 PST
Comment on
attachment 18233
[details]
patch (fixes this and
bug 16659
too) I think this patch looks great. I wondered what our testing coverage is for multiple <tfoot> <thead> elements is, since those look like edge cases we need to support (and looks like we try to currently). I'd r+ this, except that I don't 100% trust my review given my fatigue and lack of table knowledge. A second pair of eyes is recommended before landing.
Maciej Stachowiak
Comment 5
2008-01-02 15:45:14 PST
Comment on
attachment 18233
[details]
patch (fixes this and
bug 16659
too) r=me
Darin Adler
Comment 6
2008-01-02 17:26:19 PST
r29101
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug