Widget: Ensure window and document are defined in _getCreateOptions()

Closes gh-1320