Ticket #1492 (closed Bug: invalid)

Opened 2 years ago

Last modified 2 years ago

element.attributes not correctly updated in IE after cloneNode

Reported by: jonhg Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

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

Changed 2 years ago by jonhg

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()?

Changed 2 years ago by jonhg

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

Changed 2 years ago by w.olchawa

  • status changed from new to closed
  • resolution set to invalid

Hi

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:

 http://www.fckeditor.net/support

Thanks and enjoy working with FCKeditor.

Note: See TracTickets for help on using tickets.