Implements the :matches CSS pseudo-selector for rework.