Mozilla crashes when copying an element from a div element into the same element with JavaScript

VERIFIED DUPLICATE of bug 238906

Status

()

Core
DOM: Core & HTML
VERIFIED DUPLICATE of bug 238906
14 years ago
10 years ago

People

(Reporter: gerben, Unassigned)

Tracking

Trunk
x86
Windows 2000
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

14 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007

An input type file is duplicated into a div element with JavaScript. Mozilla
does NOT crash with other input types (like text), only with input type="file".

code:
---
<html>
<head>
	<title>Causes mozilla 1.5 to crash</title>
	<script language="JavaScript" type="text/javascript">
	<!-- 
	function getHandle(myparam) {
		return(document.getElementById(myparam));
	}		
	function addToElement(target, source) {
		target.innerHTML+=source.innerHTML;
	}
	// (c) Gerben Versluis // 2004 - http://www.gerben.info --></script>
</head>
<body>
	<form enctype="multipart/form-data" method="POST" >
		<div id="form" style="position:relative; width:100%; border: 1px solid #000000;">
			<span id="repeat">
				<input type="file" name="upload[]"><br />
			</span>
		</div>
		<input type="button" name="more" value="more"
onclick="addToElement(getHandle('form'), getHandle('repeat'));">
	</form>
</body>
</html>

Reproducible: Always
Steps to Reproduce:
1. Create a div with a span tag. Define <input type="file" name="upload[]"> in
that span tag.
2. Do the following in JavaScript: divHandle.innerHTML+=spanHandle.innerHTML;
3. Done

Actual Results:  
Complete crash

Expected Results:  
Duplication of the existing span tag into the div tag with input type file.
(Reporter)

Comment 1

14 years ago

*** This bug has been marked as a duplicate of 238906 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → DUPLICATE

Comment 2

14 years ago
.
Status: RESOLVED → VERIFIED

Updated

10 years ago
Component: DOM: HTML → DOM: Core & HTML
QA Contact: ian → general
You need to log in before you can comment on or make changes to this bug.