Check `documentMode` and combine checks.

I'm not certain of browser support for `documentMode`.  /cc @jdalton