nsIContent* mTargetContent = mContent;
RootContentFrame::HandleEvent(nsIPresContext& aPresContext,                               nsGUIEvent* aEvent,                              nsEventStatus& aEventStatus){#if 0  mContent->HandleDOMEvent(aPresContext, (nsEvent*)aEvent, nsnull, DOM_EVENT_INIT, aEventStatus);#else  nsContainerFrame::HandleEvent(aPresContext, aEvent, aEventStatus);#endif    if (aEventStatus != nsEventStatus_eConsumeNoDefault) {    switch (aEvent->message) {    case NS_MOUSE_MOVE:    case NS_MOUSE_ENTER:      {        nsIFrame* target = this;        nsIContent* mTargetContent = mContent;        PRInt32 cursor;               GetCursorAndContentAt(aPresContext, aEvent->point, &target, &mTargetContent, cursor);        if (cursor == NS_STYLE_CURSOR_INHERIT) {          cursor = NS_STYLE_CURSOR_DEFAULT;        }        nsCursor c;        switch (cursor) {        default:        case NS_STYLE_CURSOR_DEFAULT:          c = eCursor_standard;          break;        case NS_STYLE_CURSOR_POINTER:          c = eCursor_hyperlink;          break;        case NS_STYLE_CURSOR_TEXT:          c = eCursor_select;          break;        }        nsIWidget* window;        target->GetWindow(window);        window->SetCursor(c);        NS_RELEASE(window);        //If the content object under the cursor has changed, fire a mouseover/out        nsIEventStateManager *mStateManager;        nsIContent *mLastContent;        if (NS_OK == aPresContext.GetEventStateManager(&mStateManager)) {          mStateManager->GetLastMouseOverContent(&mLastContent);          if (mLastContent != mTargetContent) {            if (nsnull != mLastContent) {              //fire mouseout              nsEventStatus mStatus = nsEventStatus_eIgnore;              nsMouseEvent mEvent;              mEvent.eventStructType = NS_MOUSE_EVENT;              mEvent.message = NS_MOUSE_EXIT;              mLastContent->HandleDOMEvent(aPresContext, &mEvent, nsnull, DOM_EVENT_INIT, mStatus);             }            //fire mouseover            nsEventStatus mStatus = nsEventStatus_eIgnore;            nsMouseEvent mEvent;            mEvent.eventStructType = NS_MOUSE_EVENT;            mEvent.message = NS_MOUSE_ENTER;            mTargetContent->HandleDOMEvent(aPresContext, &mEvent, nsnull, DOM_EVENT_INIT, mStatus);            mStateManager->SetLastMouseOverContent(mTargetContent);          }          NS_RELEASE(mStateManager);          NS_IF_RELEASE(mLastContent);        }      }      break;    case NS_MOUSE_EXIT:      //Don't know if this is actually hooked up.      {        //Fire of mouseout to the last content object.        nsIEventStateManager *mStateManager;        nsIContent *mLastContent;        if (NS_OK == aPresContext.GetEventStateManager(&mStateManager)) {          mStateManager->GetLastMouseOverContent(&mLastContent);          if (nsnull != mLastContent) {            //fire mouseout            nsEventStatus mStatus = nsEventStatus_eIgnore;            nsMouseEvent mEvent;            mEvent.eventStructType = NS_MOUSE_EVENT;            mEvent.message = NS_MOUSE_EXIT;            mLastContent->HandleDOMEvent(aPresContext, &mEvent, nsnull, DOM_EVENT_INIT, mStatus);            mStateManager->SetLastMouseOverContent(nsnull);            NS_RELEASE(mLastContent);          }          NS_RELEASE(mStateManager);        }      }      break;    case NS_MOUSE_LEFT_BUTTON_UP:      {        nsIEventStateManager *mStateManager;        if (NS_OK == aPresContext.GetEventStateManager(&mStateManager)) {          mStateManager->SetActiveLink(nsnull);          NS_RELEASE(mStateManager);        }      }      break;    }  }  return NS_OK;}