2
Vote

Issues with Remove -- lack of refreshing, asymmetry

description

First of all, such operations should be the same
node.Remove() and node.Parent.RemoveChild(node)
 
but they are not, first one does not call RemoveChild on its parent, instead it directly removes its own node from children nodes. This is bug in terms of code design (very easy to fix though).
 
Second -- removing node does not refresh (does not invalidates internal members "changed") content of parents, grandparents, and so on. Luckily the method which dynamically creates InnerHtml is public, so after
node.Remove()
you can call
node.Parent.Parent.WriteContentTo()
instead
node.Parent.Parent.InnerHtml

comments