nsCOMPtr<nsIPresContext> aPresContext; shell->GetPresContext(getter_AddRefs(aPresContext));  NS_RELEASE(shell);
if (! Matches(updater->mTargets, id)) continue;
XULCommandDispatcherImpl::UpdateCommands(){  if (mFocusListeners) {    PRInt32 count = mFocusListeners->Count();    for (PRInt32 i = 0; i < count; i++) {      nsIDOMElement* domElement = (nsIDOMElement*)mFocusListeners->ElementAt(i);      nsCOMPtr<nsIContent> content;      content = do_QueryInterface(domElement);          nsCOMPtr<nsIDocument> document;      content->GetDocument(*getter_AddRefs(document));      PRInt32 count = document->GetNumberOfShells();      for (PRInt32 i = 0; i < count; i++) {        nsIPresShell* shell = document->GetShellAt(i);        if (nsnull == shell)            continue;        // Retrieve the context in which our DOM event will fire.        nsCOMPtr<nsIPresContext> aPresContext;        shell->GetPresContext(getter_AddRefs(aPresContext));          NS_RELEASE(shell);        // Handle the DOM event        nsEventStatus status = nsEventStatus_eIgnore;        nsEvent event;        event.eventStructType = NS_EVENT;        event.message = NS_FORM_CHANGE; // XXX: I feel dirty and evil for subverting this.        content->HandleDOMEvent(*aPresContext, &event, nsnull, NS_EVENT_FLAG_INIT, status);      }    }  }  return NS_OK;}