Check `documentMode` and combine checks.