Jacek Caban (@jacek) commented about dlls/mshtml/nsio.c:
if(FAILED(hres)) return NS_ERROR_UNEXPECTED;
gecko_initiated = !This->uri->channel_bsc;
channelbsc_set_channel(bscallback, This, listener, context);
if(is_doc_channel) {
if (gecko_initiated && window->browser->doc->doc_object_service) /* only fire for gecko calls */
{
hres = fire_beforenavigate2(window);
if (FAILED(hres))
return hres;
}
Doing that here would cause the window to have a moniker set in case of cancellation (and would leak `bscallback`). It would probably be better to move it earlier, perhaps to `nsChannel_AsyncOpen`, where we already handle cancellations.