Replacing/removing a DOM tree with a stylesheet with a call such as
will result in a leak as the stylesheet is not removed from Document.styleSheets. There's a TODO in core.Document.prototype.__defineGetter__ for the styleSheets property that suggests a solution:
// TODO: each style and link element should register its sheet on creation
// nad remove it on removal.
For a workaround, I'm iterating through ownerDocument.styleSheets and deleting its (array) properties, then setting styleSheets._length=0
Replacing/removing a DOM tree with a stylesheet with a call such as
will result in a leak as the stylesheet is not removed from
Document.styleSheets. There's a TODO incore.Document.prototype.__defineGetter__for thestyleSheetsproperty that suggests a solution:For a workaround, I'm iterating through
ownerDocument.styleSheetsand deleting its (array) properties, then settingstyleSheets._length=0