doc fix: q optionally accepts window and document objects
[BUG #6636] element manipulation methods must ignore document nodes and window objects