Bug 13960: Combo box must not be dropped down before mouse moves update the selected option.
git-svn-id: svn://10.0.0.236/trunk@48253 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
d8598dc787
commit
3e62029e1d
@ -2099,18 +2099,22 @@ nsListControlFrame::MouseDown(nsIDOMEvent* aMouseEvent)
|
||||
nsresult
|
||||
nsListControlFrame::MouseMove(nsIDOMEvent* aMouseEvent)
|
||||
{
|
||||
if (IsInDropDownMode() == PR_TRUE) {
|
||||
PRInt32 oldIndex;
|
||||
PRInt32 curIndex = mSelectedIndex;
|
||||
if (NS_SUCCEEDED(GetIndexFromDOMEvent(aMouseEvent, oldIndex, curIndex))) {
|
||||
mSelectedIndex = curIndex;
|
||||
mOldSelectedIndex = oldIndex;
|
||||
if (kNothingSelected != mSelectedIndex) {
|
||||
if (mOldSelectedIndex != mSelectedIndex) {
|
||||
if (mOldSelectedIndex != kNothingSelected) {
|
||||
SetContentSelected(mOldSelectedIndex, PR_FALSE);
|
||||
if (mComboboxFrame) { // Synonym for IsInDropDownMode()
|
||||
PRBool isDroppedDown = PR_FALSE;
|
||||
mComboboxFrame->IsDroppedDown(&isDroppedDown);
|
||||
if (isDroppedDown) {
|
||||
PRInt32 oldIndex;
|
||||
PRInt32 curIndex = mSelectedIndex;
|
||||
if (NS_SUCCEEDED(GetIndexFromDOMEvent(aMouseEvent, oldIndex, curIndex))) {
|
||||
mSelectedIndex = curIndex;
|
||||
mOldSelectedIndex = oldIndex;
|
||||
if (kNothingSelected != mSelectedIndex) {
|
||||
if (mOldSelectedIndex != mSelectedIndex) {
|
||||
if (mOldSelectedIndex != kNothingSelected) {
|
||||
SetContentSelected(mOldSelectedIndex, PR_FALSE);
|
||||
}
|
||||
SetContentSelected(mSelectedIndex, PR_TRUE);
|
||||
}
|
||||
SetContentSelected(mSelectedIndex, PR_TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2099,18 +2099,22 @@ nsListControlFrame::MouseDown(nsIDOMEvent* aMouseEvent)
|
||||
nsresult
|
||||
nsListControlFrame::MouseMove(nsIDOMEvent* aMouseEvent)
|
||||
{
|
||||
if (IsInDropDownMode() == PR_TRUE) {
|
||||
PRInt32 oldIndex;
|
||||
PRInt32 curIndex = mSelectedIndex;
|
||||
if (NS_SUCCEEDED(GetIndexFromDOMEvent(aMouseEvent, oldIndex, curIndex))) {
|
||||
mSelectedIndex = curIndex;
|
||||
mOldSelectedIndex = oldIndex;
|
||||
if (kNothingSelected != mSelectedIndex) {
|
||||
if (mOldSelectedIndex != mSelectedIndex) {
|
||||
if (mOldSelectedIndex != kNothingSelected) {
|
||||
SetContentSelected(mOldSelectedIndex, PR_FALSE);
|
||||
if (mComboboxFrame) { // Synonym for IsInDropDownMode()
|
||||
PRBool isDroppedDown = PR_FALSE;
|
||||
mComboboxFrame->IsDroppedDown(&isDroppedDown);
|
||||
if (isDroppedDown) {
|
||||
PRInt32 oldIndex;
|
||||
PRInt32 curIndex = mSelectedIndex;
|
||||
if (NS_SUCCEEDED(GetIndexFromDOMEvent(aMouseEvent, oldIndex, curIndex))) {
|
||||
mSelectedIndex = curIndex;
|
||||
mOldSelectedIndex = oldIndex;
|
||||
if (kNothingSelected != mSelectedIndex) {
|
||||
if (mOldSelectedIndex != mSelectedIndex) {
|
||||
if (mOldSelectedIndex != kNothingSelected) {
|
||||
SetContentSelected(mOldSelectedIndex, PR_FALSE);
|
||||
}
|
||||
SetContentSelected(mSelectedIndex, PR_TRUE);
|
||||
}
|
||||
SetContentSelected(mSelectedIndex, PR_TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user