Closed Bug 1386777 Opened 2 years ago Closed 2 years ago

Mouse position relative to autoscroll indicator is not interpreted correctly (possibly due to devicePixelRatio)

Categories

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

All
Windows 10
defect

Tracking

()

VERIFIED FIXED
mozilla57
Tracking Status
firefox55 --- unaffected
firefox56 --- verified
firefox57 --- verified

People

(Reporter: kats, Assigned: botond)

References

Details

(Whiteboard: [gfx-noted])

Attachments

(1 file)

I just tried the APZ autoscroll on my Surface tablet, and it looks like the mouse position is not being interpeted properly. The device has a window.devicePixelRatio of 1.5 which I suspect is not handled correctly.

If I middle-click to start autoscroll near the bottom of the window, the content immediately autoscrolls super-fast to the bottom of the page. If I middle-click near the top of the content area, it still autoscrolls down to the bottom, but less fast. In all cases I have to my mouse cursor sigificantly farther up than the indicator in order to get it scroll upwards, and if I keep the mouse near the indicator or even just above it, it scrolls downwards. ("Above" and "below" here refer to y-axis).
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #0)
> If I middle-click to start autoscroll near the bottom of the window, the
> content immediately autoscrolls super-fast to the bottom of the page. If I
> middle-click near the top of the content area, it still autoscrolls down to
> the bottom, but less fast. In all cases I have to my mouse cursor
> sigificantly farther up than the indicator in order to get it scroll
> upwards, and if I keep the mouse near the indicator or even just above it,
> it scrolls downwards.

That matches the symptoms I saw with full zoom > 100% before I fixed the patch to handle full zoom correctly. I guess that fix did not correctly handle other sources of a device pixel ratio.
I can reproduce this on a regular desktop machine by setting the pref layout.css.devPixelsPerPx to 1.5. Will investigate.
Assignee: nobody → botond
This patch fixes the issue for me when layout.css.devPixelPerPx is modified.

Kats, when a get you chance, could you try the patch on your tablet as well?
Flags: needinfo?(bugmail)
Yup, this patch fixes the issue for me.
Flags: needinfo?(bugmail)
Great, thanks for testing!
Attachment #8893151 - Flags: review?(bugmail)
Comment on attachment 8893151 [details]
Bug 1386777 - Interpret autoscroll anchor coordinates correctly when there is a device scale.

https://reviewboard.mozilla.org/r/164148/#review169822
Attachment #8893151 - Flags: review?(bugmail) → review+
Pushed by bballo@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3af71fa1f3dd
Interpret autoscroll anchor coordinates correctly when there is a device scale. r=kats
Priority: -- → P3
Whiteboard: [gfx-noted]
https://hg.mozilla.org/mozilla-central/rev/3af71fa1f3dd
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Comment on attachment 8893151 [details]
Bug 1386777 - Interpret autoscroll anchor coordinates correctly when there is a device scale.

Approval Request Comment
[Feature/Bug causing the regression]:
  Bug 1105109

[User impact if declined]:
  Users who would like to try out APZ autoscrolling in 56 Beta
  on devices with a pixel density > 1 will not be able to.

[Is this code covered by automated tests?]:
  Not that I'm aware of

[Has the fix been verified in Nightly?]:
  Yes

[Needs manual test from QE? If yes, steps to reproduce]: 
  No

[List of other uplifts needed for the feature/fix]:
  None

[Is the change risky?]:
  Very low risk

[Why is the change risky/not risky?]:
  It's a small fix to a codepath that's prefed off by default.

[String changes made/needed]:
  None
Attachment #8893151 - Flags: approval-mozilla-beta?
https://hg.mozilla.org/projects/date/rev/3af71fa1f3dd1cf6083f84612c2fb99ed765d2fb
Bug 1386777 - Interpret autoscroll anchor coordinates correctly when there is a device scale. r=kats
Comment on attachment 8893151 [details]
Bug 1386777 - Interpret autoscroll anchor coordinates correctly when there is a device scale.

Another tweak useful for APZ testing in beta 56. This should land in beta 2.
Attachment #8893151 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Verified as fixed using Firefox 56.0 beta 2 and latest Nightly 57.0a1 2017-08-11.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.