Removing and adding SVG causes the style attribute to be serialized and reparsed. This seems inefficient. Combined with serialization bugs such as bug 475216, this can lead to strange things happening!
Yes, SVG does this very very purposefully. See nsSVGElement::BindToTree. We could try to make this better by, say, storing the base URI in the attr value or something, and not doing the reparse if the base URI didn't change.... We wouldn't serialize the CSS decl if we actually have a string it came from, but in this case we don't, since it was built up programmatically.
You need to log in before you can comment on or make changes to this bug.