OnOptionSelected(selectFrame, presContext, i, PR_TRUE);
OnOptionSelected(selectFrame, presContext, i, PR_TRUE, PR_TRUE);
nsHTMLSelectElement::InsertOptionsIntoList(nsIContent* aOptions,                                           PRInt32 aListIndex,                                           PRInt32 aLevel){  PRInt32 insertIndex = aListIndex;  InsertOptionsIntoListRecurse(aOptions, &insertIndex, aLevel);  // Deal with the selected list  if (insertIndex - aListIndex) {    // Fix the currently selected index    if (aListIndex <= mSelectedIndex) {      mSelectedIndex += (insertIndex - aListIndex);    }    // Get the frame stuff for notification. No need to flush here    // since if there's no frame for the select yet the select will    // get into the right state once it's created.    nsISelectControlFrame* selectFrame = GetSelectFrame();    nsCOMPtr<nsIPresContext> presContext;    if (selectFrame) {      GetPresContext(this, getter_AddRefs(presContext));    }    // Actually select the options if the added options warrant it    nsCOMPtr<nsIDOMNode> optionNode;    nsCOMPtr<nsIOptionElement> option;    for (PRInt32 i=aListIndex;i<insertIndex;i++) {      // Notify the frame that the option is added      if (selectFrame) {        selectFrame->AddOption(presContext, i);      }      Item(i, getter_AddRefs(optionNode));      option = do_QueryInterface(optionNode);      if (option) {        PRBool selected;        option->GetSelectedInternal(&selected);        if (selected) {          // Clear all other options          PRBool isMultiple;          GetMultiple(&isMultiple);          if (!isMultiple) {            SetOptionsSelectedByIndex(i, i, PR_TRUE, PR_TRUE, PR_TRUE, nsnull);          }          // This is sort of a hack ... we need to notify that the option was          // set and change selectedIndex even though we didn't really change          // its value.          OnOptionSelected(selectFrame, presContext, i, PR_TRUE);        }      }    }    CheckSelectSomething();  }  return NS_OK;}