The spec says that all node types other than element, text and comment
should be treated as `None`. We were panicking on a few instead.
Testing: This change adds a simple crashtest
Fixes: https://github.com/servo/servo/issues/40719
---------
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>