You mean <code>doc.parentWindow.attachEvent( "onbeforeunload", setDocument );</code>?

If so, it's not going to work, because of document check in the same L181 <a href="https://github.com/orkel/sizzle/blob/8207a90f4dad704d2591d1fb03e4d05dc7fd1e23/sizzle.js#L181">line</a>.

<blockquote> because we interpret it as default context and may later skip a necessary setDocument (see L181).</blockquote>
mmm, how? I could add test for it.