Support touch event synthesization on OS X

RESOLVED FIXED in Firefox 50

Status

()

Core
Panning and Zooming
P3
normal
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: kats, Assigned: kats)

Tracking

(Blocks: 1 bug)

Trunk
mozilla50
Unspecified
Mac OS X
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox50 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(3 attachments)

Supporting "native" touch event synthesization on all supported platforms would be nice, even on platforms like OS X where we don't support touch-scrolling. One concrete benefit is that devtools would then be able to use this to simulate user touch input. It also benefits the APZ code because we can run touch tests on all platforms. It's also not very hard to implement. I have patches written and that work locally, I have a try push going at [1].

This bug tracks doing this for OS X specifically. We would also need to do it for non-touch Windows devices, where the API currently bails out at [2].

[1] http://searchfox.org/mozilla-central/rev/868b17897f7a7fcd7f6f67fd8185a7370db46604/widget/windows/nsWindowBase.cpp#131
[2] http://searchfox.org/mozilla-central/rev/868b17897f7a7fcd7f6f67fd8185a7370db46604/widget/windows/nsWindowBase.cpp#131
Created attachment 8773074 [details]
Bug 1288187 - Extract a helper function to manage synthetic touch points for widgets that don't have more specific handling.

Review commit: https://reviewboard.mozilla.org/r/65718/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/65718/
Attachment #8773074 - Flags: review?(botond)
Attachment #8773075 - Flags: review?(mstange)
Attachment #8773076 - Flags: review?(botond)
Created attachment 8773075 [details]
Bug 1288187 - Allow synthesizing widget touch events on OS X.

Review commit: https://reviewboard.mozilla.org/r/65720/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/65720/
Created attachment 8773076 [details]
Bug 1288187 - Enable touch tests on OS X.

Also remove a bunch of superfluous window.TouchEvent checks, because the test
harness forces the touch events enabled so the checks are never false.

Review commit: https://reviewboard.mozilla.org/r/65722/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/65722/
Assignee: nobody → bugmail
Blocks: 1282089
There's some failures on the try push that look to be the same root cause as bug 1278009. I should probably fix that before landing this.
Depends on: 1278009
Priority: -- → P3
Attachment #8773074 - Flags: review?(botond) → review+
Comment on attachment 8773074 [details]
Bug 1288187 - Extract a helper function to manage synthetic touch points for widgets that don't have more specific handling.

https://reviewboard.mozilla.org/r/65718/#review63626

::: widget/nsBaseWidget.h:562
(Diff revision 1)
>    // Notify the compositor that a device reset has occurred.
>    void OnRenderingDeviceReset();
>  
>    bool UseAPZ();
>  
> +  mozilla::MultiTouchInput

Perhaps add a brief comment along the lines of "returns the event to be dispatched".
Comment on attachment 8773076 [details]
Bug 1288187 - Enable touch tests on OS X.

https://reviewboard.mozilla.org/r/65722/#review63698

::: gfx/layers/apz/test/mochitest/helper_long_tap.html
(Diff revision 1)
>    <script type="application/javascript" src="apz_test_utils.js"></script>
>    <script type="application/javascript" src="/tests/SimpleTest/paint_listener.js"></script>
>    <script type="application/javascript">
>  
>  function longPressLink() {
> -  if (!window.TouchEvent) {

Perhaps there's value in replacing these with an "ok(window.TouchEvent)", so that if for some reason the test harness changes not to force touch events to be enabled, the tests start failing in a clear way?
Attachment #8773076 - Flags: review?(botond) → review+
Comment on attachment 8773075 [details]
Bug 1288187 - Allow synthesizing widget touch events on OS X.

https://reviewboard.mozilla.org/r/65720/#review63724
Attachment #8773075 - Flags: review?(mstange) → review+
(In reply to Botond Ballo [:botond] from comment #5)
> > +  mozilla::MultiTouchInput
> 
> Perhaps add a brief comment along the lines of "returns the event to be
> dispatched".

Added a comment on this function

(In reply to Botond Ballo [:botond] from comment #6)
> 
> Perhaps there's value in replacing these with an "ok(window.TouchEvent)", so
> that if for some reason the test harness changes not to force touch events
> to be enabled, the tests start failing in a clear way?

Good point, I put on in the test_group_touchevents.html, since all the helper files are part of that test.

Comment 9

a year ago
Pushed by kgupta@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/d5ff28810cde
Extract a helper function to manage synthetic touch points for widgets that don't have more specific handling. r=botond
https://hg.mozilla.org/integration/mozilla-inbound/rev/cf7ea46d68a8
Allow synthesizing widget touch events on OS X. r=mstange
https://hg.mozilla.org/integration/mozilla-inbound/rev/ed792deb7bcb
Enable touch tests on OS X. r=botond

Comment 10

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/d5ff28810cde
https://hg.mozilla.org/mozilla-central/rev/cf7ea46d68a8
https://hg.mozilla.org/mozilla-central/rev/ed792deb7bcb
Status: NEW → RESOLVED
Last Resolved: a year ago
status-firefox50: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
Blocks: 1289435
Depends on: 1307758
You need to log in before you can comment on or make changes to this bug.