Bug 776030 (apz-fennec)

Allow Fennec to use the AsyncPanZoomController




Firefox for Android
Graphics, Panning and Zooming
5 years ago
a month ago


(Reporter: kats, Assigned: rbarker)


(Depends on: 10 bugs, Blocks: 3 bugs)

Firefox Tracking Flags

(Not tracked)


(Whiteboard: [technical-debt])


(2 attachments)

Fennec's PanZoomController was forked into AsyncPanZoomController for B2G work. Eventually we should reconcile the two and merge them into a unified pan/zoom controller. This bug is to track the work that needs to be done for that.

A general outline of the work that needs to be done is:
- Extract an interface from the java PanZoomController
- Implement a "native" version of the interface that delegates calls to an instance of AsyncPanZoomController stored in nsWindow
- Eventually move the TouchEventHandler code into c++ as well. Currently some of this is merged into the C++ AsyncPanZoomController but it should probably be broken out into a separate class

Also fennec's PanZoomController deals with viewport information mostly in device pixels, but the AsyncPanZoomController uses CSS pixels. Going forward it's probably best to stick to CSS pixels (although this may change depending on discussions with layout/gfx people) so switching java over to use CSS pixels might be a good idea as a first step.
Depends on: 777075
Depends on: 777351
Depends on: 777468
Depends on: 777896
Blocks: 830750
Whiteboard: [technical-debt]
kats, is this bug a dupe or a blocker of bug 745136?
I'll go with blocker. There might be some overlap between this bug and some of the other blockers of that bug though.
Blocks: 745136
No longer blocks: 830750
Renaming this bug to scope it down to something a little more precise and manageable.
Summary: Merge the fennec PanZoomController.java and the gecko AsyncPanZoomController.cpp → Allow Fennec to use the AsyncPanZoomController
Depends on: 839641
Depends on: 859929
Depends on: 859935
Depends on: 859939
Depends on: 859951
Depends on: 859962
Depends on: 860162
Depends on: 860455
Depends on: 860613
Depends on: 860940
Blocks: 775452
Depends on: 867269
Created attachment 744260 [details] [diff] [review]
WIP - Add flag to switch to native APZC

Making it a pref is a bit harder than I thought since we currently create the PZC before gecko is up, and there's a bunch of code in GeckoLayerClient that could potentially NPE if we move the creation to later. I can fix that up but probably won't have time to test it all today, so I'm posting this temporary WIP that adds a compile-time flag for it.
Depends on: 880578
Depends on: 880932
Depends on: 880024
Depends on: 895904
Depends on: 897017


4 years ago
Depends on: 881451
Depends on: 890280
No longer blocks: 775452
Blocks: 657054
Duplicate of this bug: 933094
Depends on: 943557


4 years ago
Blocks: 943206
No longer blocks: 657054
Duplicate of this bug: 657054
Duplicate of this bug: 750857
Depends on: 988858
Alias: apz-fennec
Blocks: 999663
Blocks: 1035876
Blocks: 1042914
Depends on: 1046344
Blocks: 1047127
Blocks: 951746
Depends on: 1049136
Depends on: 1055548
Depends on: 1055557
Blocks: 795811
Blocks: 978438

Comment 8

3 years ago
Related to 978438 and FWIW: -

I think it is important for the accompanying documentation to point out that, when trying to disable default mouse event emulation from touch events, event.preventDefault() should ONLY be called from the touchend event. Otherwise any touchcancel or touchleave events are just not gonna happen.

To me https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Touch_events lacks clarity on this.
No longer blocks: 978438
Blocks: 1041833

Comment 9

3 years ago
Can someone please describe the behavior of the following on Gecko?

On every other browser Chrome, Opera, Android, IE (pointerend), and Safari, a preventDefault() call on a touchend event prevents the mouse emulation. FireFox Android is failing again :-(
If by "mouse emulation" you are referring to the click event, then yes, that is a bug - we have bug 1016480 on file for that. The issue was only reported relatively recently so nobody has put together a fix for it yet, but if you're willing to help contribute I'd be happy to mentor you through fixing it.

Comment 11

3 years ago
Yes, that's what I mean. Well actually mousedown, mouseup, and click (maybe even a mouseover can't remember).

I don't think I'm up for the challenge sorry. Cheers Richard Maher
Blocks: 1074442


3 years ago
Blocks: 1070512
No longer depends on: 897017
Blocks: 1104280
Depends on: 1137872
tracking-fennec: --- → 39+
Depends on: 886969
Assignee: bugmail.mozilla → nobody
Blocks: 886969
No longer depends on: 886969
No longer depends on: 988858
Depends on: 1146020
Depends on: 1146024
Depends on: 1131359
Created attachment 8581864 [details]
Current plan of work

I put together a plan of how to tackle this, and Danilo is going to be working his way through this, starting this week. Posting it here just for reference if anybody else cares (and so that I can reference if it need be).
Assignee: nobody → danilo.eu
Depends on: 1156392
Depends on: 1156401
Depends on: 1158424
Depends on: 1159405
tracking-fennec: 39+ → 42+
Depends on: 1162701
Depends on: 1163572
Blocks: 1167854


2 years ago
Blocks: 976531
Blocks: 1174492
Depends on: 1175282
Blocks: 1168867
No longer blocks: 1168867
Depends on: 1178847
Depends on: 1180267
No longer depends on: 1178847
Blocks: 1176912
Blocks: 1186765
Depends on: 1188225
No longer depends on: 1131359
Depends on: 1189875
Depends on: 1190988
Depends on: 1190979
Depends on: 1122804


2 years ago
Depends on: 1195553
Depends on: 1197824


2 years ago
Depends on: 1200393


2 years ago
Depends on: 1200397


2 years ago
Depends on: 1200399
Depends on: 1201100
Assignee: danilo.eu → rbarker
tracking-fennec: 42+ → Nightly+
Depends on: 1201130
Depends on: 1201217
Depends on: 1201529
Depends on: 1201581
Depends on: 1202020
No longer depends on: 1189875
Blocks: 1203349
Depends on: 1206872
Depends on: 1206874
No longer depends on: 1122804
Blocks: 1219583
Blocks: 1221241
Depends on: 1225936
No longer depends on: 1225936
Blocks: 1206620
No longer depends on: 1202020
No longer blocks: 886969
No longer blocks: 1035876
Depends on: 1229462
No longer blocks: 1041833
No longer blocks: 1047127
No longer blocks: 1070512
No longer blocks: 1104280
No longer blocks: 1174492
No longer blocks: 1167854
No longer blocks: 1203349
No longer blocks: 1186765
No longer blocks: 1221241
Depends on: 1230176
Depends on: 1248014
Depends on: 1229349
No longer blocks: 1206620
Depends on: 1260905
Depends on: 1229439
Depends on: 1230081
Depends on: 1230085
Depends on: 1240065
Depends on: 1260534
Depends on: 1262807
Depends on: 1265372


a year ago
Depends on: 1272478
tracking-fennec: Nightly+ → 48+
Depends on: 1280666
Depends on: 1281042
Depends on: 1278390
Depends on: 1202020
Depends on: 1206620
Depends on: 1229840
Depends on: 1274597
Depends on: 1291678
Depends on: 1297148


11 months ago
Depends on: 1302150


5 months ago
Duplicate of this bug: 775437


5 months ago
No longer blocks: 745136
tracking-fennec: 48+ → ---
I'm going to close this bug, since Fennec is (and has been for a while now) using the C++ APZ code.
Last Resolved: a month ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.