Closed
Bug 340429
Opened 19 years ago
Closed 19 years ago
cloneNode fails to clone non-xhtml attributes
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
People
(Reporter: digitalpacman, Unassigned)
Details
Attachments
(1 file)
445 bytes,
text/html
|
Details |
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4
I am using HTML elements on the page as objects, assigning them custom attributes, and referencing them in my script. Such as a DIV element, I am setting an ORDER to it. So div.order = 5
This all works fine and dandy till I attempt to do cloneNode(true) to copy the element. The custom fields I created are not cloned to the new element. This works properly in MSIE.
var a = document.createElement("DIV")
a.order = 50;
alert(a.order);
b = a.cloneNode(true);
alert(b.order);
a.order is defined, but b.order is undefined
Reproducible: Always
Steps to Reproduce:
var a = document.createElement("DIV")
a.order = 50;
alert(a.order);
b = a.cloneNode(true);
alert(b.order);
Actual Results:
The custom attributes are undefined.
Expected Results:
The custom attributes should be defined.
cloneNode is supposed to make it clone the node, so this really should be adapted, quickly. This just totaly ruined everthing I coded for weeks using MSIE, expecting to be able to Xfer my code to FF with minor changes. But this makes it virtually impossible to do as I wanted, without MAJOR implications.
NOTE:
If you set the attributes using setAttribute and getAttribute it works as intended. But if you set it using the . operator they are not copied. So obviously this is just something that was simply overlooked.
Comment 1•19 years ago
|
||
Testcase from authors comment.
Updated•19 years ago
|
Status: UNCONFIRMED → NEW
Component: General → DOM
Ever confirmed: true
Product: Firefox → Core
Version: unspecified → 1.0 Branch
Comment 2•19 years ago
|
||
*** This bug has been marked as a duplicate of 50533 ***
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
Assignee | ||
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•