Inner tags lost from innerHTML on off-screen TR

RESOLVED DUPLICATE of bug 277407

Status

()

Firefox
General
RESOLVED DUPLICATE of bug 277407
13 years ago
13 years ago

People

(Reporter: Per Persson, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

13 years ago
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

In the following document, the td-tags in the innerHTML are lost, so the words
are shown without any space between them.

If you mark the text shown on the webpage, right-click and select Show Selection
Source, you will see that the tags are not in the DOM-tree.

BTW, there seems to be similar problems in Internet Explorer.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
            "http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-1">
<title>TR.innerHTML-test</title>
<script type="text/javascript">
function init()
{
	var row = document.getElementById('r');
	row.removeAttribute('id');

	var tbody = document.getElementById('b');

	var r = row.cloneNode(true);
	r.innerHTML = '<td>New</td><td>content</td><td>looses</td><td>the cells</td>';
	tbody.appendChild(r);
}
</script>

<style type="text/css">
th {
	width: 4cm;
	text-align: left;
}
</style>

<body onload="init()">
<table>
<thead>
	<tr>
		<th>Ord 1</th>
		<th>Ord 2</th>
		<th>Ord 3</th>
		<th>Ord 4</th>
	</tr>
</thead>
<tbody id="b">
	<tr id="r">
		<td>Original</td>
		<td>content</td>
		<td>with</td>
		<td>cells</td>
	</tr>
</tbody>
</table>
</body>

Reproducible: Always
Duplicate of bug 277407.

*** This bug has been marked as a duplicate of 277407 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.