Open Bug 901151 Opened 6 years ago Updated 6 years ago

Sent mouse event source

Categories

(Firefox for Android :: General, defect)

Other
Linux
defect
Not set

Tracking

()

People

(Reporter: wesj, Unassigned)

Details

Attachments

(1 file, 2 obsolete files)

Attached file WIP Patch (obsolete) —
The platform uses the source of the mouse event to determine if it should do fluffing (i.e. only fluff mouse events that come from touches). We should set the source. While we're doing it, I thought I'd try to get us sending normal mouse events as well.
Attached patch Patch (obsolete) — Splinter Review
Trying to send mouse events through the platform is getting there, but will need some work and is lower priority. This part is needed for bug 788073 and is easy.
Attachment #785280 - Attachment is obsolete: true
Attachment #785941 - Flags: review?(bugmail.mozilla)
Attached patch PatchSplinter Review
Ran into an error in the last guy. Fixed
Attachment #785941 - Attachment is obsolete: true
Attachment #785941 - Flags: review?(bugmail.mozilla)
Attachment #785992 - Flags: review?(bugmail.mozilla)
Comment on attachment 785992 [details] [diff] [review]
Patch

Review of attachment 785992 [details] [diff] [review]:
-----------------------------------------------------------------

::: mobile/android/chrome/content/browser.js
@@ +4251,5 @@
>  
>              // the target should already have been fluffed by the platform touch event code, but
>              // will be fluffed out again by the platform mouse event code as well
> +            let window = element.ownerDocument.defaultView;
> +            let cwu = window.top.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);

Not your fault, but it might be a good idea to rename "window" to "win" or something else so we don't have a local variable hiding a built-in global variable. That seems like a potential footgun.

@@ +4515,2 @@
>      try {
> +      cwu.sendMouseEventToWindow(aName, aX, aY, 0, 1, 0, true, 1.0, aSource);

Maybe it makes sense to just inline this function? I don't know if it's worth catching exceptions on each of these events individually, we could just do it as a block around all three of them. If one throws I double the other two won't anyway.
Attachment #785992 - Flags: review?(bugmail.mozilla) → review+
You need to log in before you can comment on or make changes to this bug.