Selector parsing+first child

Fixes #1133, fixes #1134.

This is a rebase and clean-up of these two pull requests that have been reviewed individually. Additionally, 5c59699 disables parsing of `display: list-item` which is not supported yet and may have been the cause of the hangs when testing #1134.