Propage TreeScope into the shadow trees too.

When updating the tree scope of a subtree we need to go into the shadow root subtree to update its parent.

Fixes #397