Closed Bug 865452 Opened 7 years ago Closed 7 years ago

[AccessFu] Don't capture scripted mouse events

Categories

(Core :: Disability Access APIs, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla23

People

(Reporter: eeejay, Assigned: eeejay)

References

Details

Attachments

(1 file, 1 obsolete file)

Scripted mouse events should not be captured since they are not directly caused by the user's mouse or touch.
Attachment #741517 - Flags: review?(yura.zenevich)
Depends on: 865449
Comment on attachment 741517 [details] [diff] [review]
Don't capture scripted mouse events.

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

Looks good. Not sure if you need a bug number in the commit message as well.

::: accessible/src/jsat/TouchAdapter.jsm
@@ +97,5 @@
>      if (Utils.MozBuildApp == 'browser' &&
>          aEvent.view.top instanceof Ci.nsIDOMChromeWindow)
>        return;
>  
> +    if (aEvent.mozInputSource == Ci.nsIDOMMouseEvent.MOZ_SOURCE_UNKNOWN)

Nit: Could this possibly be wrapped in a block statement. I realize that there are plenty of cases like that in the code base already, but it would be slightly less prone to bugs.

::: accessible/src/jsat/content-script.js
@@ +120,5 @@
>  
>        let x = Math.round((objX.value - docX.value) + objW.value / 2);
>        let y = Math.round((objY.value - docY.value) + objH.value / 2);
>  
> +      var node = aAccessible.DOMNode || aAccessible.parent.DOMNode;

Nit: Should probably use let instead of var for consistency.

@@ +122,5 @@
>        let y = Math.round((objY.value - docY.value) + objH.value / 2);
>  
> +      var node = aAccessible.DOMNode || aAccessible.parent.DOMNode;
> +
> +      var evt = content.document.createEvent("MouseEvents");

Perhaps this could be folded into a function, what do you think?
Depends on: 865430
Comments addressed
Attachment #741517 - Attachment is obsolete: true
Attachment #741517 - Flags: review?(yura.zenevich)
Attachment #741895 - Flags: review?(yura.zenevich)
Attachment #741895 - Flags: review?(yura.zenevich) → review+
https://hg.mozilla.org/mozilla-central/rev/38cac63b52b3
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
You need to log in before you can comment on or make changes to this bug.