diff --git a/mozilla/layout/forms/nsComboboxControlFrame.cpp b/mozilla/layout/forms/nsComboboxControlFrame.cpp index 5042a5a6f06..2e5e3a92d61 100644 --- a/mozilla/layout/forms/nsComboboxControlFrame.cpp +++ b/mozilla/layout/forms/nsComboboxControlFrame.cpp @@ -1885,7 +1885,7 @@ nsComboboxControlFrame::GetDropDown(nsIFrame** aDropDownFrame) } NS_IMETHODIMP -nsComboboxControlFrame::ListWasSelected(nsIPresContext* aPresContext, PRBool aForceUpdate) // Added "aForceUpdate" for Bug 42661 +nsComboboxControlFrame::ListWasSelected(nsIPresContext* aPresContext, PRBool aForceUpdate, PRBool aSendEvent) // Added "aForceUpdate" for Bug 42661 { if (aPresContext == nsnull) { aPresContext = mPresContext; @@ -1896,7 +1896,7 @@ nsComboboxControlFrame::ListWasSelected(nsIPresContext* aPresContext, PRBool aFo PRInt32 indx; mListControlFrame->GetSelectedIndex(&indx); - UpdateSelection(PR_TRUE, aForceUpdate, indx); // Added "aForceUpdate" for Bug 42661 + UpdateSelection(aSendEvent, aForceUpdate, indx); // Added "aForceUpdate" for Bug 42661 return NS_OK; } diff --git a/mozilla/layout/forms/nsComboboxControlFrame.h b/mozilla/layout/forms/nsComboboxControlFrame.h index 15f39dc57af..b3402961f57 100644 --- a/mozilla/layout/forms/nsComboboxControlFrame.h +++ b/mozilla/layout/forms/nsComboboxControlFrame.h @@ -162,7 +162,7 @@ public: NS_IMETHOD ShowDropDown(PRBool aDoDropDown); NS_IMETHOD GetDropDown(nsIFrame** aDropDownFrame); NS_IMETHOD SetDropDown(nsIFrame* aDropDownFrame); - NS_IMETHOD ListWasSelected(nsIPresContext* aPresContext, PRBool aForceUpdate); + NS_IMETHOD ListWasSelected(nsIPresContext* aPresContext, PRBool aForceUpdate, PRBool aSendEvent); NS_IMETHOD UpdateSelection(PRBool aDoDispatchEvent, PRBool aForceUpdate, PRInt32 aNewIndex); NS_IMETHOD AbsolutelyPositionDropDown(); NS_IMETHOD GetAbsoluteRect(nsRect* aRect); diff --git a/mozilla/layout/forms/nsIComboboxControlFrame.h b/mozilla/layout/forms/nsIComboboxControlFrame.h index 81ac099086e..3141905438a 100644 --- a/mozilla/layout/forms/nsIComboboxControlFrame.h +++ b/mozilla/layout/forms/nsIComboboxControlFrame.h @@ -77,7 +77,7 @@ public: * Notifies the Combobox the List was selected * */ - NS_IMETHOD ListWasSelected(nsIPresContext* aPresContext, PRBool aForceUpdate) = 0; + NS_IMETHOD ListWasSelected(nsIPresContext* aPresContext, PRBool aForceUpdate, PRBool aSendEvent) = 0; /** * Asks the Combobox to update the display frame diff --git a/mozilla/layout/forms/nsListControlFrame.cpp b/mozilla/layout/forms/nsListControlFrame.cpp index d6205923187..54f2d4a86df 100644 --- a/mozilla/layout/forms/nsListControlFrame.cpp +++ b/mozilla/layout/forms/nsListControlFrame.cpp @@ -2938,6 +2938,10 @@ nsListControlFrame::AboutToRollup() // whatever it was before it was dropped down. if (index != mSelectedIndex) { ResetSelectedItem(); + } else { + if (IsInDropDownMode() == PR_TRUE) { + mComboboxFrame->ListWasSelected(mPresContext, PR_TRUE, PR_TRUE); + } } } return NS_OK; @@ -3089,7 +3093,7 @@ void nsListControlFrame::ResetSelectedItem() if (mIsAllFramesHere) { ToggleSelected(mSelectedIndexWhenPoppedDown); if (IsInDropDownMode() == PR_TRUE) { - mComboboxFrame->ListWasSelected(mPresContext, PR_TRUE); + mComboboxFrame->ListWasSelected(mPresContext, PR_TRUE, PR_FALSE); } } } @@ -3194,7 +3198,7 @@ nsListControlFrame::MouseUp(nsIDOMEvent* aMouseEvent) SetContentSelected(mSelectedIndex, PR_TRUE); } if (mComboboxFrame) { - mComboboxFrame->ListWasSelected(mPresContext, PR_FALSE); + mComboboxFrame->ListWasSelected(mPresContext, PR_FALSE, PR_TRUE); } mouseEvent->clickCount = 1; } else { @@ -3828,7 +3832,7 @@ nsListControlFrame::KeyPress(nsIDOMEvent* aKeyEvent) if (IsInDropDownMode() == PR_TRUE) { PRBool isDroppedDown; mComboboxFrame->IsDroppedDown(&isDroppedDown); - mComboboxFrame->ListWasSelected(mPresContext, isDroppedDown); + mComboboxFrame->ListWasSelected(mPresContext, isDroppedDown, PR_TRUE); } else { UpdateSelection(PR_TRUE, PR_FALSE, mContent); } diff --git a/mozilla/layout/html/forms/public/nsIComboboxControlFrame.h b/mozilla/layout/html/forms/public/nsIComboboxControlFrame.h index 81ac099086e..3141905438a 100644 --- a/mozilla/layout/html/forms/public/nsIComboboxControlFrame.h +++ b/mozilla/layout/html/forms/public/nsIComboboxControlFrame.h @@ -77,7 +77,7 @@ public: * Notifies the Combobox the List was selected * */ - NS_IMETHOD ListWasSelected(nsIPresContext* aPresContext, PRBool aForceUpdate) = 0; + NS_IMETHOD ListWasSelected(nsIPresContext* aPresContext, PRBool aForceUpdate, PRBool aSendEvent) = 0; /** * Asks the Combobox to update the display frame diff --git a/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp b/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp index 5042a5a6f06..2e5e3a92d61 100644 --- a/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsComboboxControlFrame.cpp @@ -1885,7 +1885,7 @@ nsComboboxControlFrame::GetDropDown(nsIFrame** aDropDownFrame) } NS_IMETHODIMP -nsComboboxControlFrame::ListWasSelected(nsIPresContext* aPresContext, PRBool aForceUpdate) // Added "aForceUpdate" for Bug 42661 +nsComboboxControlFrame::ListWasSelected(nsIPresContext* aPresContext, PRBool aForceUpdate, PRBool aSendEvent) // Added "aForceUpdate" for Bug 42661 { if (aPresContext == nsnull) { aPresContext = mPresContext; @@ -1896,7 +1896,7 @@ nsComboboxControlFrame::ListWasSelected(nsIPresContext* aPresContext, PRBool aFo PRInt32 indx; mListControlFrame->GetSelectedIndex(&indx); - UpdateSelection(PR_TRUE, aForceUpdate, indx); // Added "aForceUpdate" for Bug 42661 + UpdateSelection(aSendEvent, aForceUpdate, indx); // Added "aForceUpdate" for Bug 42661 return NS_OK; } diff --git a/mozilla/layout/html/forms/src/nsComboboxControlFrame.h b/mozilla/layout/html/forms/src/nsComboboxControlFrame.h index 15f39dc57af..b3402961f57 100644 --- a/mozilla/layout/html/forms/src/nsComboboxControlFrame.h +++ b/mozilla/layout/html/forms/src/nsComboboxControlFrame.h @@ -162,7 +162,7 @@ public: NS_IMETHOD ShowDropDown(PRBool aDoDropDown); NS_IMETHOD GetDropDown(nsIFrame** aDropDownFrame); NS_IMETHOD SetDropDown(nsIFrame* aDropDownFrame); - NS_IMETHOD ListWasSelected(nsIPresContext* aPresContext, PRBool aForceUpdate); + NS_IMETHOD ListWasSelected(nsIPresContext* aPresContext, PRBool aForceUpdate, PRBool aSendEvent); NS_IMETHOD UpdateSelection(PRBool aDoDispatchEvent, PRBool aForceUpdate, PRInt32 aNewIndex); NS_IMETHOD AbsolutelyPositionDropDown(); NS_IMETHOD GetAbsoluteRect(nsRect* aRect); diff --git a/mozilla/layout/html/forms/src/nsListControlFrame.cpp b/mozilla/layout/html/forms/src/nsListControlFrame.cpp index d6205923187..54f2d4a86df 100644 --- a/mozilla/layout/html/forms/src/nsListControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsListControlFrame.cpp @@ -2938,6 +2938,10 @@ nsListControlFrame::AboutToRollup() // whatever it was before it was dropped down. if (index != mSelectedIndex) { ResetSelectedItem(); + } else { + if (IsInDropDownMode() == PR_TRUE) { + mComboboxFrame->ListWasSelected(mPresContext, PR_TRUE, PR_TRUE); + } } } return NS_OK; @@ -3089,7 +3093,7 @@ void nsListControlFrame::ResetSelectedItem() if (mIsAllFramesHere) { ToggleSelected(mSelectedIndexWhenPoppedDown); if (IsInDropDownMode() == PR_TRUE) { - mComboboxFrame->ListWasSelected(mPresContext, PR_TRUE); + mComboboxFrame->ListWasSelected(mPresContext, PR_TRUE, PR_FALSE); } } } @@ -3194,7 +3198,7 @@ nsListControlFrame::MouseUp(nsIDOMEvent* aMouseEvent) SetContentSelected(mSelectedIndex, PR_TRUE); } if (mComboboxFrame) { - mComboboxFrame->ListWasSelected(mPresContext, PR_FALSE); + mComboboxFrame->ListWasSelected(mPresContext, PR_FALSE, PR_TRUE); } mouseEvent->clickCount = 1; } else { @@ -3828,7 +3832,7 @@ nsListControlFrame::KeyPress(nsIDOMEvent* aKeyEvent) if (IsInDropDownMode() == PR_TRUE) { PRBool isDroppedDown; mComboboxFrame->IsDroppedDown(&isDroppedDown); - mComboboxFrame->ListWasSelected(mPresContext, isDroppedDown); + mComboboxFrame->ListWasSelected(mPresContext, isDroppedDown, PR_TRUE); } else { UpdateSelection(PR_TRUE, PR_FALSE, mContent); }