Fix 61336, call onchange event for changes made by scripts. sr:jst, r:pollmann

This commit is contained in:
joki%netscape.com 2001-05-14 01:57:33 +00:00
parent 83de3b5600
commit 8244142e1c
3 changed files with 5 additions and 2 deletions

View File

@ -2753,7 +2753,7 @@ nsListControlFrame::SetProperty(nsIPresContext* aPresContext, nsIAtom* aName,
if (mSelectedIndex != selectedIndex) {
ToggleSelected(selectedIndex); // sets mSelectedIndex
if (nsnull != mComboboxFrame && mIsAllFramesHere) {
mComboboxFrame->UpdateSelection(PR_FALSE, PR_TRUE, selectedIndex); // don't dispatch event
mComboboxFrame->UpdateSelection(PR_TRUE, PR_TRUE, selectedIndex); // do dispatch event
}
}
}

View File

@ -3311,6 +3311,9 @@ nsGfxTextControlFrame2::SetTextControlFrameState(const nsAReadableString& aValue
mEditor->SetFlags(savedFlags);
if (selPriv)
selPriv->EndBatchChanges();
// send onchange here to ctach DOM based changes
CallOnChange();
}
if (mScrollableView)

View File

@ -2753,7 +2753,7 @@ nsListControlFrame::SetProperty(nsIPresContext* aPresContext, nsIAtom* aName,
if (mSelectedIndex != selectedIndex) {
ToggleSelected(selectedIndex); // sets mSelectedIndex
if (nsnull != mComboboxFrame && mIsAllFramesHere) {
mComboboxFrame->UpdateSelection(PR_FALSE, PR_TRUE, selectedIndex); // don't dispatch event
mComboboxFrame->UpdateSelection(PR_TRUE, PR_TRUE, selectedIndex); // do dispatch event
}
}
}