Changes

Jump to: navigation, search

Gecko:Mouse Wheel Scrolling

16 bytes added, 15:19, 26 January 2010
Mouse wheel transaction
For example, there is a page body which is scrollable and has a scrollable sub-frame (e.g., listbox of select element with multiple attribute, div element with overflow property, iframe element). When an user is scrolling down the sub-frame, it will be reached to the end of its content. However, some mouse wheel events which were fired after that will scroll the body unexpectedly.
And there is another example, when the user is scrolling the page body, the sub-frame may come under the mouse cursor. Then, the sub-frame intercepts the mouse wheel events unexpectedly.
We can fix these problems by a simple idea. That is, all users may want to scroll only one scrollable frame at one time. So, we can assume that two or more mouse wheel events which are fired between short term should scroll only one scrollable frame. The frame must be the frame under the cursor at the first mouse wheel event.
Gecko manages this transaction by nsMouseWheelTransaction which is in [http://mxr.mozilla.org/mozilla-central/source/content/events/src/nsEventStateManager.cpp nsEventStateManager.cpp]. This was implemented in [https://bugzilla.mozilla.org/show_bug.cgi?id=312831 bug 312831].
* When no mouse wheel events are fired during specified term after latest mouse wheel event. The length is defined by '''mousewheel.transaction.timeout'''. The value means millisecond and the default value is 1500.
* When the mouse cursor moves to outside of the targeted scrollable frame.* When the mouse cursor moves inside the targeted frame. However, we need to ignore some mouse move events which are fired unexpectedly when the user turned wheel. '''mousewheel.transaction.ignoremovedelay''' defines the time of ignoring mouse move events before and after a mouse wheel event. The value is millisecond, the default value is 100.
* When a keydown or keyup or keypress event is fired.
* When a mouse button down or mouse button up or click or double click event is fired.
87
edits

Navigation menu