style: Reduce allocations in selector matching.

This is a 27% improvement in CSS selector matching performance.

r? @SimonSapin