Closed Bug 1446724 Opened 2 years ago Closed 2 years ago

Plugins should still receive original delta values if the default action for wheel scrolling is horizontalizing vertical wheel.

Categories

(Core :: DOM: UI Events & Focus Handling, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

(Reporter: zjz, Assigned: zjz)

Details

Attachments

(1 file, 3 obsolete files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:58.0) Gecko/20100101 Firefox/58.0
Build ID: 20180123231643
Unlike a DOM wheel event listeners which receive original delta values, plugins receive horizontalized ones. However, the result for the plugin isn't quite reasonable.

Plugin developers can do any delta adjustment if they want, because they are capable of DIRECTLY getting what IO the user is manipulating; conversely, they aren't capable of getting what delta adjustment their upstream has already encapsulated for them.

So we need to restore adjusted delta values to the original for plugins.
Attachment #8959925 - Attachment is obsolete: true
Attachment #8959931 - Attachment is obsolete: true
Attachment #8960078 - Attachment is obsolete: true
Oops, I tried uploading it twice but the reviewers were all empty in the two patches, and then I realized I miswrote ? instead of r?

Finally got it done.
Hmm, good point.

It's difficult to say which is better, consistent behavior with browser vs. native behavior on plugin (currently, only Flash).

The motivation to treat vertical wheel operation as horizontal scroll is, we should support legacy mouse devices better. So, from a point of view of original purpose, this patch makes killing support of legacy mice only on Flash Player again.

On the other hand, IIRC, Flash Player didn't support horizontal wheel events. Does Flash Player support horizontal scroll now? If not, perhaps, your patch is better than keeping current behavior.
(In reply to Masayuki Nakano [:masayuki] (JST, +0900) from comment #7)
> Hmm, good point.
> 
> It's difficult to say which is better, consistent behavior with browser vs.
> native behavior on plugin (currently, only Flash).
> 
> The motivation to treat vertical wheel operation as horizontal scroll is, we
> should support legacy mouse devices better. So, from a point of view of
> original purpose, this patch makes killing support of legacy mice only on
> Flash Player again.
> 
> On the other hand, IIRC, Flash Player didn't support horizontal wheel
> events. Does Flash Player support horizontal scroll now? If not, perhaps,
> your patch is better than keeping current behavior.

FLASH developers can make a logical horizontalized scroll for a vertical wheel in FLASH programmes for themselves if they want to.

The point is, are FLASH developers capable of getting keyboard events? If they are, then just let they horizontalize a vertical scroll if the inputs are [Shift+Vertical Wheel] or any other inputs they like. So there is no need for us to adjust delta for them.
Comment on attachment 8960082 [details]
Bug 1446724 - Lets plugins still receive original delta values instead of horizontalized values if the default action for wheel scrolling is horizontalizing vertical wheel scrolling.

https://reviewboard.mozilla.org/r/228870/#review234528

Okay, as far as I've tested, wheel operation isn't supported on macOS and only vertical wheel operation is supported on Windows. So, we don't need to keep the hack on Flash Player.
Attachment #8960082 - Flags: review?(masayuki) → review+
Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/38f424da5620
Lets plugins still receive original delta values instead of horizontalized values if the default action for wheel scrolling is horizontalizing vertical wheel scrolling. r=masayuki
https://hg.mozilla.org/mozilla-central/rev/38f424da5620
Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Assignee: nobody → zjz
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.