Mobile/TouchScreen/MouseEvents

From MozillaWiki
Jump to: navigation, search

Problem

Touchscreen devices have no concept of "hover" or "mouseover" and "mouseout". This can be a problem for websites with menu systems that depend on "hover" capabilities.

Fennec needs a plan for dealing with these types of sites. Mobile Safari (iPhone) has a special implementation of mouse events that allows for some "hover" capabilities. mobile Safari also introduces new types of touch-related and gesture-related events.

Bugs and Patches

Currently, we have several bugs and patches that affect mouse event behavior:

  • bug 492831 attachment 382735 (hover to some elements)
  • bug 492831 attachment 382964 (hover to all elements)
  • bug 460966 attachments 383082 + 383083 (gecko c++ and fennec JS)
  • bug 460966 attachment 383164 (hover fires after a timeout)
  • there may be more...

Current Touch Behaviors

  1. For chrome, a quick touch will send mousedown/mouseup events to the tapped item.
  2. For chrome, a touch on a pannable item will result in going into pan mode until the finger is lifted. If the move was short enough, this will turn into mousedown/mouseup.
  3. For content, any touch starts a pan of the browser. If you move sufficiently far, the pan will continue and no extra events will be sent when you lift your finger.
  4. For content, a touch without moving far will result in a single click. This will be sent after a short delay.
  5. If another tap arrives before the click delay is expired, we abort sending a click. This new click will call a double click handler that performs zooming operations on the canvas.

Desired Behaviors

  1. Application of CSS hover style to elements that are tapped
  2. Sending of additional mouseover/mouseout events based on tap location