if (mRCCreatedDuringLoad == 0 && mDummyLayoutRequest && !mIsReflowing && !mIsDestroying && !mDummyLayoutRequestEventPosted) {  nsCOMPtr<nsIEventQueue> eventQueue; mEventQueueService-> GetSpecialEventQueue(nsIEventQueueService::UI_THREAD_EVENT_QUEUE, getter_AddRefs(eventQueue)); if (!eventQueue) { NS_WARNING("onload won't fire, due to failure to get event queue."); return; }  DummyLayoutRequestEvent* evt = new DummyLayoutRequestEvent(this); if (!evt) { NS_WARNING("onload won't fire, due to failure to create event."); return; }  nsresult rv = eventQueue->PostEvent(evt); if (NS_FAILED(rv)) { NS_WARNING("onload won't fire, due to failure to post dummy layout " "request event"); PL_DestroyEvent(evt); return; }  mDummyLayoutRequestEventPosted = PR_TRUE;
if (mRCCreatedDuringLoad == 0 && mDocumentOnloadBlocked) { mDocument->UnblockOnload(); mDocumentOnloadBlocked = PR_FALSE;
PresShell::DoneRemovingReflowCommands(){  if (mRCCreatedDuringLoad == 0 && mDummyLayoutRequest && !mIsReflowing &&      !mIsDestroying && !mDummyLayoutRequestEventPosted) {    // Post an event to remove mDummyLayoutRequest from the loadgroup    nsCOMPtr<nsIEventQueue> eventQueue;    mEventQueueService->      GetSpecialEventQueue(nsIEventQueueService::UI_THREAD_EVENT_QUEUE,                           getter_AddRefs(eventQueue));    if (!eventQueue) {      NS_WARNING("onload won't fire, due to failure to get event queue.");      return;    }    DummyLayoutRequestEvent* evt = new DummyLayoutRequestEvent(this);    if (!evt) {      NS_WARNING("onload won't fire, due to failure to create event.");      return;    }    nsresult rv = eventQueue->PostEvent(evt);    if (NS_FAILED(rv)) {      NS_WARNING("onload won't fire, due to failure to post dummy layout "                 "request event");      PL_DestroyEvent(evt);      return;    }    mDummyLayoutRequestEventPosted = PR_TRUE;  }}