We shouldn't use document even as a default, because people will call your functions without ever passing the document, and it will work in tests and during normal usage, but as soon as you try to use it with several windows, it will suddenly break. It's less error prone to alway require a document argument.