Closed Bug 300817 Opened 19 years ago Closed 19 years ago

cloneNode(textarea) will set defaultValue as value.

Categories

(Core :: DOM: Core & HTML, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 230307

People

(Reporter: brunoabdon+moziilabugzilla, Unassigned)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4

When a textarea is cloned with cloneNode, the clone will have it's 'value'
attribute set to the 'defaultValue' from the original.

That is, if you do:

var textarea2 = textearea1.cloneNode(true);

the textarea2.value will be equals to textearea1.defaultValue


If this is expected behaviour (and I believe it isn't), so there's a bug on
<input>s behaviour, as cloned inputs maintain the original value.



Reproducible: Always

Steps to Reproduce:
1.Change a textarea's value (contents)
2.Clone this textarea
3.Check the cloned textarea's value

Actual Results:  
The clone textarea's value is the original textarea's defaultValue (value prior
to change)

Expected Results:  
The clone textarea's value should be the original textarea's value at cloning time.

I'll be attaching a simple test case.

Cloned inputs won't behave this way.
Attached file Simple testcase
Adding a simple testecase with included instructions.
Looks like a dupe of bug 230307 to me.
Surely a dup. I'm moving my testcase there. (They alredy have one, but its too
complicated (IMHO)).

*** This bug has been marked as a duplicate of 230307 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
Component: DOM: Core → DOM: Core & HTML
QA Contact: ian → general
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: