>Inspired by Jesper’s patch, I did a bit of work on the code folding for the XML editor. Bug 269600, helps with the XML code folding performance on large xml files. In the past, it could take several minutes for a large XML file with many sub nodes, to render in the editor. With the patch applied, this renders a 500K XML file in about 3 seconds with all folding enabled.
The bottle neck seemed to be the fact that the code was trying to add adaptor notifications even if the call to get nextSibling or nextChild returned Null. This patch adds a check first before adding adaptorNotifications to the nodes, to make sure that it isn’t null.
It’s one of the annoying things about the W3C DOM, too many items return nulls, and there has to be too many checks for Nulls.