[BUG #7326] Check for document mode if necessary