Closed
Bug 119786
Opened 23 years ago
Closed 22 years ago
table created with dom methods is not displayed when a caption is inserted
Categories
(Core :: DOM: Core & HTML, defect, P4)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla1.3beta
People
(Reporter: martin.honnen, Assigned: karnaze)
References
Details
(Keywords: testcase, Whiteboard: PATCH)
Attachments
(2 files, 1 obsolete file)
1.65 KB,
text/html
|
Details | |
1.56 KB,
patch
|
karnaze
:
review+
karnaze
:
superreview+
|
Details | Diff | Splinter Review |
The following test page creates two tables with DOM methods, the only difference being that for the first table a caption is created while for the second no caption is created. Mozilla 0.9.7 for the first table only displays the caption but not the table itself while the second table displays fine. <html> <head> <title> table creation </title> <style type="text/css"> caption { color: green; background-color: lightyellow; } </style> <script type="text/javascript"> function createTable (caption) { var table = document.createElement('table'); table.border = 1; document.body.appendChild(table); if (caption) { table.createCaption(); table.caption.appendChild(document.createTextNode(caption)); } table.createTHead(); var row = table.tHead.insertRow(table.tHead.rows.length); row.insertCell(0).appendChild(document.createTextNode('Header')); table.appendChild(document.createElement('tbody')); row = table.tBodies[0].insertRow(table.tBodies[0].rows.length); row.insertCell(0).appendChild(document.createTextNode('Kibology')); } </script> </head> <body> <script type="text/javascript"> createTable('Where is the table?'); document.body.appendChild(document.createElement('hr')); createTable(); </script> </body> </html> The problem doesn't occur if you first construct the whole table and then append it to the document.body but I think the Mozilla DOM implementation should by now be mature enough to not require the scripter to check which order of calls Mozilla works with and which not. <html> <head> <title> table creation </title> <style type="text/css"> caption { color: green; background-color: lightyellow; } </style> <script type="text/javascript"> function createTable (caption) { var table = document.createElement('table'); table.border = 1; document.body.appendChild(table); if (caption) { table.createCaption(); table.caption.appendChild(document.createTextNode(caption)); } table.createTHead(); var row = table.tHead.insertRow(table.tHead.rows.length); row.insertCell(0).appendChild(document.createTextNode('Header')); table.appendChild(document.createElement('tbody')); row = table.tBodies[0].insertRow(table.tBodies[0].rows.length); row.insertCell(0).appendChild(document.createTextNode('Kibology')); } function createTable1 (caption) { var table = document.createElement('table'); table.border = 1; if (caption) { table.createCaption(); table.caption.appendChild(document.createTextNode(caption)); } table.createTHead(); var row = table.tHead.insertRow(table.tHead.rows.length); row.insertCell(0).appendChild(document.createTextNode('Header')); table.appendChild(document.createElement('tbody')); row = table.tBodies[0].insertRow(table.tBodies[0].rows.length); row.insertCell(0).appendChild(document.createTextNode('Kibology')); document.body.appendChild(table); }</script> </head> <body> <script type="text/javascript"> createTable('Where is the table?'); document.body.appendChild(document.createElement('hr')); createTable(); document.body.appendChild(document.createElement('hr')); createTable1('Here is the table'); </script> </body> </html>
Reporter | ||
Comment 1•23 years ago
|
||
The page contains both the code not working and the workaround (which changes the time at which the table is inserted into the document.body)
Comment 2•23 years ago
|
||
Seeing this on Linux too. We create an invalid DOM (THEAD before CAPTION) but that's not the issue here -- I fixed that in my tree and it did not help. It looks like calling InsertBefore on a table that's already in the DOM does not lead to frames getting created... I switched createCaption to use InsertBefore instead of AppendChildTo and the caption disappeared as well. Note that the elements _are_ in the DOM. They are just not shown.
OS: Windows XP → All
Hardware: PC → All
Comment 3•23 years ago
|
||
And loading the testcase in a debug build gives me: ###!!! ASSERTION: unexpected child frame type: 'PR_FALSE', file nsTableOuterFrame.cpp, line 271 ###!!! Break: at file nsTableOuterFrame.cpp, line 271 ###!!! ASSERTION: invalid previous frame: '!aPrevFrame', file nsTableOuterFrame.cpp, line 285 ###!!! Break: at file nsTableOuterFrame.cpp, line 285 ###!!! ASSERTION: unexpected child frame type: 'PR_FALSE', file nsTableOuterFrame.cpp, line 271 ###!!! Break: at file nsTableOuterFrame.cpp, line 271 are we constructing the wrong types of frames? Or is the outer frame confused?
these assertions show that CSSFrameConstructor is trying to insert a rowgroupframe into a outertableframe instead of innertableframe. nsCSSFrameConstructor::ContentInserted seems to be very long and difficult to understand ( the russian saying for this is: without a half litre you won't understand)
Updated•23 years ago
|
Priority: -- → P5
*** Bug 149190 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 6•22 years ago
|
||
taking the bug.
Assignee: jst → karnaze
Priority: P5 → P4
Target Milestone: --- → mozilla1.3beta
Assignee | ||
Comment 7•22 years ago
|
||
Comment on attachment 104654 [details] [diff] [review] patch to fix the bug r=bernd the patch works great, it also improves the situation at the composer bug, while I can't enter there anything because a bunch of assertions fire before
Attachment #104654 -
Flags: review+
Assignee | ||
Updated•22 years ago
|
Status: NEW → ASSIGNED
Whiteboard: PATCH
Comment on attachment 104654 [details] [diff] [review] patch to fix the bug sr=kin@netscape.com ... though the following comment threw me off a bit: + // A caption has no siblings Can we change the comment to say something to the effect that caption is not a valid sibling in the context that the IsValidSibling() method is used in?
Attachment #104654 -
Flags: superreview+
Assignee | ||
Comment 10•22 years ago
|
||
Attachment #104654 -
Attachment is obsolete: true
Assignee | ||
Updated•22 years ago
|
Attachment #105938 -
Flags: superreview+
Attachment #105938 -
Flags: review+
Comment 11•22 years ago
|
||
*** Bug 132628 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 12•22 years ago
|
||
The patch was checked in on 11/12/2.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
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.
Description
•