Platform/Input/Touch: Difference between revisions

Update B2G parent process stuff
(Update platform info)
(Update B2G parent process stuff)
Line 7: Line 7:
Pointer events were proposed by Microsoft. Initially it had support from Google but then they changed their mind and as of this writing they do not plan to support it. Microsoft is trying to push pointer events and people from MS Open Tech are actively implementing pointer events support in Gecko. In Gecko we would like to have pointer events and would also like Google to support them for better interoperability. There is some code in nsPresShell in Gecko which can generate and dispatch appropriate pointer events based on touch/mouse input.
Pointer events were proposed by Microsoft. Initially it had support from Google but then they changed their mind and as of this writing they do not plan to support it. Microsoft is trying to push pointer events and people from MS Open Tech are actively implementing pointer events support in Gecko. In Gecko we would like to have pointer events and would also like Google to support them for better interoperability. There is some code in nsPresShell in Gecko which can generate and dispatch appropriate pointer events based on touch/mouse input.


Mouse events are also dispatched for backwards compatibility with non-touch-aware web content. The only cases where mouse events need to be dispatched to content are when the user does a "tap" and the resulting touch events are not prevent-defaulted by web content. In this case four mouse events (mousemove, mousedown, mouseup, click) need to be dispatched to the point of the tap. Note that there must be some sort of gesture detection that happens somewhere in order to determine that a sequence of touch input corresponds to a "tap".
Mouse events are also dispatched for backwards compatibility with non-touch-aware web content. The only cases where mouse events need to be dispatched to content are when the user does a "tap" and the resulting touch events are not prevent-defaulted by web content. In this case three mouse events (mousemove, mousedown, mouseup) need to be dispatched to the point of the tap. A fourth event (click) is created by the EventStateManager from the mousedown/mouseup pair. Note that there must be some sort of gesture detection that happens somewhere in order to determine that a sequence of touch input corresponds to a "tap".


= B2G =
= B2G =


On B2G we receive only touch input from the OS. The B2G widget code converts the touch input into touch events and dispatches it to web content. After that there are different code paths that take effect for the parent process and the child process.
On B2G we receive only touch input from the OS. The B2G widget code converts the touch input into touch events and dispatches it to web content. After that there are different code paths that take effect for the parent process and the child process.
* On the parent process... (to be documented)
* On the parent process, if the touch events are not prevent-defaulted, the B2G widget code (GeckoTouchDispatcher::DispatchMouseEvent) will dispatch mouse events corresponding to the touch input. Note that in this case there is no tap gesture detection - all of the touch input triggers mouse events in the widget.
* On the child process, if the touch events are not prevent-defaulted, the APZ code (or code in TabChild if APZ is disabled) will run gesture detection code. If the touch input correspond to a tap, it will trigger dispatch of mouse events as required.
* On the child process, if the touch events are not prevent-defaulted, the APZ code (or code in TabChild if APZ is disabled) will run gesture detection code. If the touch input correspond to a tap, it will trigger dispatch of mouse events as required.


Confirmed users
586

edits