PRBool useCapture = PR_FALSE; nsAutoString capturer; child->GetAttribute(kNameSpaceID_None, kCapturerAtom, capturer); if (capturer.EqualsWithConversion("true")) useCapture = PR_TRUE;
PRBool useCapture = (curr->GetPhase() == NS_PHASE_CAPTURING);
nsXBLBinding::InstallEventHandlers(nsIContent* aBoundElement){  // Fetch the handlers element for this binding.  nsCOMPtr<nsIContent> handlers;  GetImmediateChild(kHandlersAtom, getter_AddRefs(handlers));  if (handlers) {    // Now walk the handlers and add event listeners to the bound    // element.    PRInt32 childCount;    handlers->ChildCount(childCount);    for (PRInt32 i = 0; i < childCount; i++) {      nsCOMPtr<nsIContent> child;      handlers->ChildAt(i, *getter_AddRefs(child));      // Fetch the type attribute.      // XXX Deal with a comma-separated list of types      nsAutoString type;      child->GetAttribute(kNameSpaceID_None, kTypeAtom, type);          if (!type.IsEmpty()) {        nsCOMPtr<nsIAtom> eventAtom = getter_AddRefs(NS_NewAtom(type));        PRBool found = PR_FALSE;        nsIID iid;        GetEventHandlerIID(eventAtom, &iid, &found);        if (found) {          // Add an event listener for mouse and key events only.          PRBool mouse = IsMouseHandler(type);          PRBool key = IsKeyHandler(type);          PRBool focus = IsFocusHandler(type);          PRBool xul = IsXULHandler(type);          nsCOMPtr<nsIDOMEventReceiver> receiver = do_QueryInterface(mBoundElement);                      if (mouse || key || focus || xul) {            // Create a new nsXBLEventHandler.            nsXBLEventHandler* handler;            NS_NewXBLEventHandler(mBoundElement, child, type, &handler);            // Figure out if we're using capturing or not.            PRBool useCapture = PR_FALSE;            nsAutoString capturer;            child->GetAttribute(kNameSpaceID_None, kCapturerAtom, capturer);            if (capturer.EqualsWithConversion("true"))              useCapture = PR_TRUE;            // Add the event listener.            if (mouse)              receiver->AddEventListener(type, (nsIDOMMouseListener*)handler, useCapture);            else if(key)              receiver->AddEventListener(type, (nsIDOMKeyListener*)handler, useCapture);            else if(focus)              receiver->AddEventListener(type, (nsIDOMFocusListener*)handler, useCapture);            else              receiver->AddEventListener(type, (nsIDOMMenuListener*)handler, useCapture);            NS_RELEASE(handler);          }          else {            // Call AddScriptEventListener for other IID types            nsAutoString value;            child->GetAttribute(kNameSpaceID_None, kValueAtom, value);            if (value.IsEmpty())                GetTextData(child, value);            AddScriptEventListener(mBoundElement, eventAtom, value, iid);          }        }      }    }  }  if (mNextBinding)    mNextBinding->InstallEventHandlers(aBoundElement);  return NS_OK;}