Bug 258193 nsIDOMMouseEvent::GetButton() broken with contextmenu event

p=trev@gtchat.de r=jst sr=bzbarsky
This commit is contained in:
bugzilla%arlen.demon.co.uk 2004-09-17 10:48:59 +00:00
Родитель ddee974556
Коммит f728846b40
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -152,7 +152,7 @@ nsDOMMouseEvent::GetButton(PRUint16* aButton)
}
// If button has been set then use that instead.
if (mButton > 0) {
if (mButton >= 0) {
*aButton = (PRUint16)mButton;
}
else {
@ -173,9 +173,12 @@ nsDOMMouseEvent::GetButton(PRUint16* aButton)
case NS_MOUSE_RIGHT_BUTTON_DOWN:
case NS_MOUSE_RIGHT_CLICK:
case NS_MOUSE_RIGHT_DOUBLECLICK:
case NS_CONTEXTMENU:
*aButton = 2;
break;
default:
// This event doesn't have a mouse button associated with it
*aButton = (PRUint16)-1;
break;
}
}