Gecko:Mouse Wheel Scrolling
Overview
Gecko can have many scrollable frames at one time. This documents the detail of mouse wheel scrolling processing in Gecko.
Gecko honors mouse cursor position
Basically, turning mouse wheel scrolls a scrollable view under mouse cursor. This behavior was designed in bug 97283.
Note that on Windows, most mouse drivers honors keyboard focus rather than mouse cursor position. However, Internet Explorer and other web browsers honor the cursor position too. So, it's not a problem, probably.
Deciding a scrolling target from cursor position
There can be two or more scrollable frames at a point (i.e., under mouse cursor). Gecko decides one scrolling target by following rules:
- Finds a frame under mouse cursor.
- Checks whether the frame is scrollable to the direction by user operation.
- If the frame is scrollable, Gecko scrolls the frame.
- Otherwise, repeats the steps with its ancestor frames.
There is a special case. If gecko finds a drop down frame of a select element, it stops going up the frame hierarchy.