Fix selector creation for the real elements belonging to pseudo-elements.

The selector was created by taking the string just up until the first
colon, but that's incorrect in the case of other pseudoclasses like
:checked, or in the case of complex rules that involve multiple
selectors like "foo:before, bar:before".  The way we do it now is to
remove the :after/:before string we're looking for using the same
regex that tests for it.

This got broken in commit 8bea01b81dc329977bd02e43aa81fe4942535cb3
(the original code appears to simply have used the parentNode)