Opened 17 years ago

Closed 16 years ago

#1492 closed Bug (invalid)

element.attributes not correctly updated in IE after cloneNode

Reported by: Jon Håvard Gundersen Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:


This is not a specific FCKeditor bug, but I need some help.

I have implemented a "following paragraphstyle" functionality. This works by altering the class name to the new element that is created in fckenterkey. But I have met a strange IE7 bug(?). When I alter the className attribute to the element (with either element.className or element.setAttribute) that are cloned from the previous block this value seems to be updated as expected. BUT the attributes nodemapArray are not updated. This causes the check in FCKDomTools.GetAttributeValue to fail because it returns the old classname and not the new one.

Therefore the style class label are not updated to new style, and when I switch edit mode to source view the old class value (that is stored in the attributes array) is still used.

It seems to me that there is a bug in the clone method in IE that causes the two elements to reference the same attribute map, but I can be wrong...

Do you have any hints to how I can set a class name and be sure that element.attributesclass?.nodeValue is updated?

Change History (3)

comment:1 Changed 17 years ago by Jon Håvard Gundersen

Research has proven that the attributes nodemap are not cloned but reference the same object. Therefor this map is not updated as it should be when setting classname to the new cloned element. If I alter the old element both element are updated.

Maybe you could add a fix for this in FCKDomTools.CloneElement()?

comment:2 Changed 17 years ago by Jon Håvard Gundersen

It does not work with element.cloneNode(true) either. The attributes object are still the same. This work ok in firefox, IE7 bug.

comment:3 Changed 16 years ago by Wojciech Olchawa

Resolution: invalid
Status: newclosed


This site is used strictly for reporting FCKeditor and its sister projects bugs and new feature requests. So if you want to gain support please visit our support page at:

Thanks and enjoy working with FCKeditor.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy