Closed Bug 1288187 Opened 8 years ago Closed 8 years ago

Support touch event synthesization on OS X

Categories

(Core :: Panning and Zooming, defect, P3)

Unspecified
macOS
defect

Tracking

()

RESOLVED FIXED
mozilla50
Tracking Status
firefox50 --- fixed

People

(Reporter: kats, Assigned: kats)

References

Details

Attachments

(3 files)

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
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.
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
You need to log in before you can comment on or make changes to this bug.