Opened 11 years ago

Last modified 11 years ago

#11372 closed enhancement

dojo.addClass causes performance problems in IE6 and 7 by assigning identical CSS class — at Initial Version

Reported by: Shane O'Sullivan Owned by: anonymous
Priority: high Milestone: 1.5
Component: Core Version: 1.5.0b2
Keywords: Cc:
Blocked By: Blocking:

Description

When dojo.addClass is called, and the resulting class string is identical to the class already on the node, it still modifies the class.

This causes severe performance issues in IE6 and 7, which I presume comes from forcing a redraw.

dojo.removeClass does not do this, and uses

if(node[_className] != cls){ node[_className] = cls; }

dojo.addClass should also do this. Performance tests have shown, when creating a TabContainer?, the average time for each dojo.addClass call goes from 14ms to 10ms, a huge saving

Instatiating a TabContainer? with many (> 30) tabs in IE 6 and 7 is very slow, and this one line fix speeds it up a lot.

Change History (0)

Note: See TracTickets for help on using tickets.