layout: Small vector optimize CSS selector matching

12% improvement on style recalc for the rainbow page.

r? @larsbergstrom