void HandleEvent() { nsCOMPtr<nsIPresShell> presShell = do_QueryReferent(mPresShell); if (presShell) { #ifdef DEBUG if (VERIFY_REFLOW_NOISY_RC & gVerifyReflowFlags) { printf("\n*** Handling reflow event: PresShell=%p, event=%p\n", presShell, this);
PresShell::HandleEvent(nsIView         *aView, nsGUIEvent*     aEvent, nsEventStatus*  aEventStatus, PRBool          aForceHandle, PRBool&         aHandled) { void*     clientData; nsIFrame* frame; nsresult  rv = NS_OK;  NS_ASSERTION(!(nsnull == aView), "null view");  aHandled = PR_TRUE;  if (mIsDestroying || mIsReflowing) { return NS_OK; }  aView->GetClientData(clientData); frame = (nsIFrame *)clientData;   if (nsnull != frame) { PushCurrentEventInfo(nsnull, nsnull);  nsIEventStateManager *manager; if (NS_OK == mPresContext->GetEventStateManager(&manager)) {  if (NS_IS_KEY_EVENT(aEvent) || NS_IS_IME_EVENT(aEvent)) {  manager->GetFocusedContent(&mCurrentEventContent); if (mCurrentEventContent) GetPrimaryFrameFor(mCurrentEventContent, &mCurrentEventFrame); else {             nsPoint eventPoint; frame->GetOrigin(eventPoint); eventPoint += aEvent->point; rv = frame->GetFrameForPoint(mPresContext, eventPoint, NS_FRAME_PAINT_LAYER_FOREGROUND, &mCurrentEventFrame); if (rv != NS_OK) { rv = frame->GetFrameForPoint(mPresContext, eventPoint, NS_FRAME_PAINT_LAYER_FLOATERS, &mCurrentEventFrame); if (rv != NS_OK) { rv = frame->GetFrameForPoint(mPresContext, eventPoint, NS_FRAME_PAINT_LAYER_BACKGROUND, &mCurrentEventFrame); if (rv != NS_OK) { #ifdef XP_MAC    mCurrentEventContent = mDocument->GetRootContent(); mCurrentEventFrame = nsnull; #else if (aForceHandle) { mCurrentEventFrame = frame; } else { mCurrentEventFrame = nsnull; } aHandled = PR_FALSE; #endif rv = NS_OK; } } } }
  void HandleEvent() {        nsCOMPtr<nsIPresShell> presShell = do_QueryReferent(mPresShell);    if (presShell) {#ifdef DEBUG      if (VERIFY_REFLOW_NOISY_RC & gVerifyReflowFlags) {         printf("\n*** Handling reflow event: PresShell=%p, event=%p\n", presShell, this);      }#endif      // XXX Statically cast the pres shell pointer so that we can call      // protected methods on the pres shell. (the ReflowEvent struct      // is a friend of the PresShell class)      PresShell* ps = NS_REINTERPRET_CAST(PresShell*, presShell.get());      PRBool isBatching;      ps->SetReflowEventStatus(PR_FALSE);      ps->GetReflowBatchingStatus(&isBatching);      if (!isBatching) ps->ProcessReflowCommands(PR_TRUE);    }    else      mPresShell = 0;  }