Fix infinite while loop and reset regex
the while loop that iterates over a single pseudo style was causing webkit browsers to crash. It seems like this while loop's original purpose was to select a pseudo style missed by the first pass through of the test() regex function. Resetting the last index of the regex on each style iteration fixes this issue so this while loop is no longer needed and can be replaced by an if statement.