Open Bug 824870 Opened 12 years ago Updated 1 year ago

Provide preference to set deltaMode value of DOM WheelEvent

Categories

(Core :: DOM: Events, defect, P3)

17 Branch
x86
Linux
defect

Tracking

()

UNCONFIRMED

People

(Reporter: lida.tang, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20100101 Firefox/17.0 Build ID: 20121128204232 Steps to reproduce: As documented in https://wiki.mozilla.org/Gecko:Mouse_Wheel_Scrolling#Mozilla_17_.28Firefox_17.29_or_later Firefox 17 no longer provide a way to scroll by pixel in response to a mouse wheel event Actual results: In Firefox 16 and below, setting mousewheel.withnokey.action to 4 allows per pixel scrolling in response to a mouse wheel event. I use this under Linux to have Firefox respond to trackpad scrolling events by translating them into mouse wheel events. Expected results: Please provide a preference like mousewheel.default.deltaMode which can be set to pixel, line or page to override the OS specific behavior that is currently specified.
OS: Mac OS X → Linux
Component: Untriaged → DOM: Events
Product: Firefox → Core
See Also: → 1392460
Priority: -- → P3
Severity: normal → S3

When working with the DOM WheelEvent, the deltaMode property specifies the unit of measurement for the delta values. It can have three possible values:

deltaMode = 0: This value indicates that the delta values are defined in pixels. In this mode, you can use the delta values directly for scrolling calculations or other pixel-based operations.

deltaMode = 1: This value indicates that the delta values are defined in lines. It is typically used for scrolling purposes. If you want to convert the delta values to pixels, you can multiply them by the height of a line.

deltaMode = 2: This value indicates that the delta values are defined in pages. It means that the user has scrolled an entire page up or down. To convert the delta values to pixels, you can multiply them by the height of the page.

When choosing the appropriate deltaMode value for your specific scenario, consider the context in which the WheelEvent is being used. Here are some general guidelines:

Scrolling: If you are implementing custom scrolling behavior, it's usually best to use deltaMode = 0 (pixels) to have finer control over the scrolling experience. You can directly use the delta values to adjust the scroll position based on the pixel measurement.

Text-based interfaces: If your application primarily deals with text-based content, such as a text editor or document viewer, deltaMode = 1 (lines) might be more suitable. This ensures that scrolling behaves consistently with line-based navigation, making it easier for users to read and interact with the content.

Pagination or multi-page views: If your application involves displaying content in a paginated or multi-page format, deltaMode = 2 (pages) can provide a more intuitive scrolling experience. By multiplying the delta values by the height of a page, you can easily navigate through entire pages.

Ultimately, the choice of deltaMode depends on the specific requirements and user experience goals of your application. Consider the type of content, the desired scrolling behavior, and how you want users to interact with your interface. By selecting the appropriate deltaMode value, you can ensure that your application handles scrolling events accurately and provides a seamless user experience. by https://yesornowheel.net/

You need to log in before you can comment on or make changes to this bug.