Contextmenu opened using keyboard should have .button == 0

RESOLVED FIXED

Status

()

RESOLVED FIXED
11 years ago
11 years ago

People

(Reporter: smaug, Assigned: smaug)

Tracking

({regression})

Trunk
x86
All
regression
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

Created attachment 280096 [details]
testcase

This is a regression from Bug 354694.
Because 1.8 reports .button == 0, I think we should keep that functionality.
Created attachment 280100 [details] [diff] [review]
proposed patch

Neil, could you test this on Windows.
Attachment #280100 - Flags: review?(enndeakin)

Comment 3

11 years ago
Comment on attachment 280100 [details] [diff] [review]
proposed patch

>-      button = eRightButton;
>+      button = (context == eNormal) ? eRightButton : eLeftButton;
>     }
>   }
> #ifdef NS_DEBUG
>   ~nsMouseEvent() {
>-    NS_WARN_IF_FALSE(message != NS_CONTEXTMENU || button == eRightButton,
>+    NS_WARN_IF_FALSE(message != NS_CONTEXTMENU ||
>+                     button ==
>+                       ((context == eNormal) ? eRightButton : eLeftButton),

I think these checks would be easier to understand if there were written as:

(context == eContextMenuKey) ? eLeftButton : eRightButton
Attachment #280100 - Flags: review?(enndeakin) → review+

Updated

11 years ago
Attachment #280100 - Flags: superreview?(jst) → superreview+

Updated

11 years ago
Attachment #280100 - Flags: approval1.9? → approval1.9+
Status: ASSIGNED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.