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

p=trev@gtchat.de r=jst sr=bzbarsky


git-svn-id: svn://10.0.0.236/trunk@162492 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bugzilla%arlen.demon.co.uk
2004-09-17 10:48:59 +00:00
parent 3b27d433b4
commit ac04d5df23

View File

@@ -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;
}
}