Right now, we composite then dispatch touch events. We originally had to do this with silk because touch events were processed on the main thread and we didn't want to block composition on the main thread. Since bug 930939, we dispatch touch events on the compositor through straight through to the APZ. We can remove one frame of latency by dispatching touch events first, then composting with the updated touch input data.

Created attachment 8585849[details][diff][review]
Dispatch touch events before composites v2.2
[Approval Request Comment]
Bug caused by (feature/regressing bug #): Silk
User impact if declined: This patch is a performance improvement which reduces touch latency by 16 ms.
Testing completed: Manual, mochitest
Risk to taking this patch (and alternatives if risky): Low, we already dispatch touch events. Now we just do it before composites so touch events are rendered on the screen sooner, making it feel more responsive.
String or UUID changes made by this patch: None