CSS complete improvements

Check document exists.
Define completions on first completion.