From 3a374455ca3bcec81f030213e1bcfe7d27d22b9b Mon Sep 17 00:00:00 2001 From: "joki%netscape.com" Date: Mon, 14 May 2001 01:57:33 +0000 Subject: [PATCH] Fix 61336, call onchange event for changes made by scripts. sr:jst, r:pollmann git-svn-id: svn://10.0.0.236/trunk@94841 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/forms/nsListControlFrame.cpp | 2 +- mozilla/layout/html/forms/src/nsGfxTextControlFrame2.cpp | 3 +++ mozilla/layout/html/forms/src/nsListControlFrame.cpp | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mozilla/layout/forms/nsListControlFrame.cpp b/mozilla/layout/forms/nsListControlFrame.cpp index d0307c50ac7..be058e6e861 100644 --- a/mozilla/layout/forms/nsListControlFrame.cpp +++ b/mozilla/layout/forms/nsListControlFrame.cpp @@ -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 } } } diff --git a/mozilla/layout/html/forms/src/nsGfxTextControlFrame2.cpp b/mozilla/layout/html/forms/src/nsGfxTextControlFrame2.cpp index af01a674158..a13cd663eee 100644 --- a/mozilla/layout/html/forms/src/nsGfxTextControlFrame2.cpp +++ b/mozilla/layout/html/forms/src/nsGfxTextControlFrame2.cpp @@ -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) diff --git a/mozilla/layout/html/forms/src/nsListControlFrame.cpp b/mozilla/layout/html/forms/src/nsListControlFrame.cpp index d0307c50ac7..be058e6e861 100644 --- a/mozilla/layout/html/forms/src/nsListControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsListControlFrame.cpp @@ -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 } } }