Opened 11 years ago
Closed 11 years ago
#11372 closed enhancement (fixed)
dojo.addClass causes performance problems in IE6 and 7 by assigning identical CSS class
Reported by: | Shane O'Sullivan | Owned by: | Eugene Lazutkin |
---|---|---|---|
Priority: | high | Milestone: | 1.5 |
Component: | Core | Version: | 1.5.0b2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description (last modified by )
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
Instantiating a TabContainer? with many (> 30) tabs in IE 6 and 7 is very slow, and this one line fix speeds it up a lot.
Attachments (1)
Change History (4)
comment:1 Changed 11 years ago by
Description: | modified (diff) |
---|
Changed 11 years ago by
Attachment: | dojo.addClass.patch added |
---|
comment:2 Changed 11 years ago by
Owner: | changed from anonymous to Eugene Lazutkin |
---|---|
Priority: | high → normal |
severity: | major → minor |
Status: | new → assigned |
comment:3 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Type: | defect → enhancement |
Fix for this issue