Fix live highlight when starting from a CSSDocument

For #7453.
I wonder whether there's a nicer solution.