This reverts commit 8e2c8b3e4d954a7a8908b513f4ec7a6eec903046.
Uses `Element.matches` to match selectors, instead of copying the code from our compiler.
Closes #14261