Open Bug 1952595 Opened 18 days ago Updated 16 hours ago

Improve activation of axis lock with touchpad input (use a buffer of recent events, like with touchscreen input)

Categories

(Core :: Panning and Zooming, defect, P3)

Firefox 136
defect

Tracking

()

People

(Reporter: billdillensrevenge, Unassigned, NeedInfo)

Details

Attachments

(2 files)

Issue in version 136 that's making me feel a bit sea sick: when doing vertically scrolling via touchpad, if there is a horizontal scrollbar, I'm seeing elastic scrolling if I don't scroll perfectly straight (and no one scrolls perfectly straight on the touchpad because it's too difficult and not as ergonomic). Seems similar to https://bugzilla.mozilla.org/show_bug.cgi?id=1712874

To repro, go to https://en.wikipedia.org/wiki/Main_Page and pinch-zoom in slightly, which will make the horizontal scrollbar appear. Though I can repro on any site that has a horizontal scrollbar, not just ones I've pinch zoomed in.

The Bugbug bot thinks this bug should belong to the 'Core::Layout: Scrolling and Overflow' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: General → Layout: Scrolling and Overflow
Product: Firefox → Core

Does changing the value of apz.axis_lock.mode from 2 to 1 in about:config help?

Nope :(

To provide some context on what I would expect to happen in this situation: we have an "axis lock" feature where if you are scrolling close to vertically (at a "slight angle" as you say), we lock the scroll into being vertical only (and similarly if you're scrolling close to horizontally), and this is enabled for touchpad scrolling.

The preference apz.axis_lock.mode governs whether the axis locking is "strict" (1), meaning once you are locked to an axis for a given gesture you remain locked, or "sticky" (2), meaning you can change the angle within the same gesture and get unlocked. I thought perhaps you were inadvertently breaking the axis lock.

But if setting the preference value to 1 does not help, that sounds like axis locking may not be working for you at all, which is surprising.

Could you share some logs for further diagnosis? The easiest way to do this is to share a profile with logs enabled, as follows:

  • Paste about:logging?modules=apz.controller:4&output=profiler into the URL bar
  • Click "Start logging"
  • Reproduce the bug
  • Switch back to the about:logging tab and click "Stop logging". A profiler.firefox.com page will open.
  • In the top right corner of the page, click "Upload Local Profile" and share the resulting links

This laptop belongs to my work and the IT guy refuses to let me do profiles but this is a bone stock Surface Laptop 6 and I haven't tinkered in about:config either, everything is default. But here is a screen recording of what this looks like. I'm not scrolling at a perfectly straight 90 degree angle but it's not like I'm scrolling at a 45 degree angle either, so this really shouldn't be happening.

(In reply to Will from comment #5)

I'm not scrolling at a perfectly straight 90 degree angle but it's not like I'm scrolling at a 45 degree angle either, so this really shouldn't be happening.

Let's try one more thing as an experiment: in about:config, can you try changing the value of the apz.axis_lock.lock_angle preference to 0.8, and see if that helps?

(The preference value is in radians; the default value of 0.523599 is 30 degrees in radians, meaning that axis lock is activated if the angle of scrolling is within 30 degrees of a given axis. By increasing it to 0.8, we're making it larger than 45 degrees, essentially making it so that it always activates relative to one axis or another.)

Changing it to 0.8 fixes it but it's also made me realize that I'm often scrolling closer to horizontal than I realized, because I'd say about 1/5 times I initiate a scroll, it's locked to horizontal scrolling when I intended to scroll vertically! I know this might seem silly but I quickly made a picture of how my fingers scroll on the touchpad when I'm scrolling vertically. Yes, I know I should try to scroll more straight up and down but it feels so intuitive and more ergonomic to scroll vertically this way (it's basically diagonal, or a very large circle).

(In reply to Will from comment #7)

I quickly made a picture of how my fingers scroll on the touchpad when I'm scrolling vertically

Just to make sure I'm interpreting this correctly: the start of the gesture is the left side of the diagram (the part of the circle that's closer to vertical), and the end is the right side (closer to horizontal)?

If so, then I think that in principle, we should be able to make this work well, by using the angle near the beginning of the gesture to determine the axis lock, and then keeping it locked to that axis (at least in strict mode) even as the angle starts to tend towards the horizontal.

Looking at the code a bit, I suspect the reason this does not currently work very well is that we're calculating the angle based on a single pan gesture event (here and here), which ends up being overly sensitive to small variations in the gesture shape and possibly even the touchpad hardware sensitivity. For touchscreen scrolling, we do something more sophisticated (buffer up recent events and calculate the angle based on the events in the buffer here), which we could consider doing for touchpad scrolling as well.

Oh yes sorry for not specifying, I start scrolling from the bottom of the touchpad and as my fingers goes more and more horizontally (to the right) as they go up.

I'll be happy to help try out anything to help get this right, especially because currently it's an odd situation where: if there is no horizontal scrollbar, there are no problems, but if you come across a webpage that has a horizontal scrollbar, this undesirable elastic scrolling happens, which is very inconsistent from a UX perspective.

(In reply to Will from comment #9)

currently it's an odd situation where: if there is no horizontal scrollbar, there are no problems, but if you come across a webpage that has a horizontal scrollbar, this undesirable elastic scrolling happens, which is very inconsistent from a UX perspective.

Well, the fact that a page is horizontally scrollable naturally means that the code has to consider the possibility that you're trying to scroll it horizontally, in ways that it doesn't on pages which are not scrollable horizontally.

Let's put aside elastic scroll for a moment, and suppose that the page in question was actually scrolled a bit away from the left edge horizontally. Would you consider it surprising/unintuitive if a touchpad gesture of the shape shown in your diagram had the effect of scrolling the page back to the left edge, in addition to any vertical movement?

(In reply to Botond Ballo [:botond] from comment #10)

(In reply to Will from comment #9)

currently it's an odd situation where: if there is no horizontal scrollbar, there are no problems, but if you come across a webpage that has a horizontal scrollbar, this undesirable elastic scrolling happens, which is very inconsistent from a UX perspective.

Well, the fact that a page is horizontally scrollable naturally means that the code has to consider the possibility that you're trying to scroll it horizontally, in ways that it doesn't on pages which are not scrollable horizontally.

Let's put aside elastic scroll for a moment, and suppose that the page in question was actually scrolled a bit away from the left edge horizontally. Would you consider it surprising/unintuitive if a touchpad gesture of the shape shown in your diagram had the effect of scrolling the page back to the left edge, in addition to any vertical movement?

Good point and I understand what you mean.
And hopefully changing to something more like what you do with touchscreen could help this issue.
I give yous credit though, Chrome for Windows has a worse touchpad scrolling experience than Firefox when scrolling up a page if there's a horizontal scrollbar because if you move your fingers diagonally/quarter circle (which I'm confident is very common because it's more natural and ergonomic), it'll scroll to the right! It's awful, you must scroll up nearly in a completely straight line (90 degrees) in Chrome for Windows if there is a horizontal scrollbar. Yous are doing a great job here, thank you. I'm sure many Firefox users appreciate it the thought and work yous have put into this type of stuff.

(Btw, Chrome for Windows also hasn't shipped elastic scrolling yet. I'm curious to see how they handle this scenario when they do ship it. Edge for Windows has elastic scrolling but it's a joke, they always have elastic scrolling for touchpad even if there is no horizontal scrollbar! There's many complains about that but Microsoft doesn't seem to care.)

The severity field is not set for this bug.
:hiro, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(hikezoe.birchill)
Severity: -- → S3
Component: Layout: Scrolling and Overflow → Panning and Zooming
Priority: -- → P3
Summary: Undesireable elastic scrolling when scrolling vertically at a slight angle if there is a horizontal scrollbar → Improve activation of axis lock with touchpad input (use a buffer of recent events, like with touchscreen input)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: