diff --git a/mozilla/layout/forms/nsListControlFrame.cpp b/mozilla/layout/forms/nsListControlFrame.cpp index 7a32ab5a2ab..4e06a3a0b6f 100644 --- a/mozilla/layout/forms/nsListControlFrame.cpp +++ b/mozilla/layout/forms/nsListControlFrame.cpp @@ -1607,10 +1607,10 @@ nsListControlFrame::RemoveOption(PRInt32 aIndex) GetSelectedIndexFromDOM(&selectedIndex); // comes from the DOM if (aIndex == mSelectedIndex) { - ToggleSelected(selectedIndex); // sets mSelectedIndex - } else { - mSelectedIndex = selectedIndex; + // Don't need to deselect option as it is being removed anyway. + SetContentSelected(selectedIndex, PR_TRUE); // Select the new selectedIndex } + mSelectedIndex = selectedIndex; if (nsnull != mComboboxFrame) { mComboboxFrame->UpdateSelection(PR_FALSE, PR_TRUE, selectedIndex); // don't dispatch event } diff --git a/mozilla/layout/html/forms/src/nsListControlFrame.cpp b/mozilla/layout/html/forms/src/nsListControlFrame.cpp index 7a32ab5a2ab..4e06a3a0b6f 100644 --- a/mozilla/layout/html/forms/src/nsListControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsListControlFrame.cpp @@ -1607,10 +1607,10 @@ nsListControlFrame::RemoveOption(PRInt32 aIndex) GetSelectedIndexFromDOM(&selectedIndex); // comes from the DOM if (aIndex == mSelectedIndex) { - ToggleSelected(selectedIndex); // sets mSelectedIndex - } else { - mSelectedIndex = selectedIndex; + // Don't need to deselect option as it is being removed anyway. + SetContentSelected(selectedIndex, PR_TRUE); // Select the new selectedIndex } + mSelectedIndex = selectedIndex; if (nsnull != mComboboxFrame) { mComboboxFrame->UpdateSelection(PR_FALSE, PR_TRUE, selectedIndex); // don't dispatch event }