Closed Bug 1610960 Opened 4 years ago Closed 4 years ago

pinch to zoom jumps to top left if text is selected

Categories

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

74 Branch
Unspecified
All
defect

Tracking

()

RESOLVED FIXED
Tracking Status
firefox-esr68 --- unaffected
firefox73 --- wontfix
firefox74 --- fixed
firefox75 --- fixed

People

(Reporter: j, Assigned: botond)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 obsolete file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:74.0) Gecko/20100101 Firefox/74.0

Steps to reproduce:

  1. Open Firefox Preview;
  2. Go to a page with text(ex. wikipedia.org/wiki/Main_Page);
  3. Select any plain text;
  4. Start to pinch-zoom but don't leave the fingers from the screen.

https://github.com/mozilla-mobile/fenix/issues/6945

Actual results:

The page will zoom in but jump on the top-left part of the site.

Expected results:

The page will zoom in.

This might be another bug that is related?
https://github.com/mozilla-mobile/fenix/issues/7042

Botond, is this APZ or text selection (or both)?

Flags: needinfo?(botond)

I can reproduce this in Fenix but not in GVE. Makes me suspect perhaps some JS code in a component that's part of Fenix but not GVE.

It does not seem to be triggered by JS, at least not directly.

Let's provisionally treat this as an APZ issue.

Component: General → Panning and Zooming
Flags: needinfo?(botond)
Product: GeckoView → Core

Ahh, this is caused by the "force-disable APZ" mechanism.

Something related to text selection is causing AccessibleCaretManager to force-disable APZ for a portion of the pinch gesture. This has the effect of forcing the scroll offset to jump from the visual scroll offset to the layout scroll offset (since the visual scroll offset "only exists in APZ").

Basically, the "force-disable APZ" mechanism was designed with desktop in mind, and does bad things on mobile when we're zoomed in and the visaul and layout viewports diverge.

This is technically a regression from bug 1526268, and there may be an underlying text selection issue here (i.e. I'm not sure if we legitimately want to force-disable APZ in this scenario), but we definitely need an APZ fix here as well (to make the force-disable mechanism behave reasonably on mobile).

Regressed by: 1526268
Has Regression Range: --- → yes

I suspect that this bug is worse than the bugs which motivated the use of the "force-disable APZ" mechanism, so I think we should disable that mechanism on Android for the time being. I'll file a follow-up bug for a proper APZ fix.

Assignee: nobody → botond
Priority: -- → P1

Force-disabling APZ currently has the effect of forcing the visual viewport
offset to be the same as the layout viewport offset, which breaks zooming
on Android.

See Also: → 1612750

(In reply to Botond Ballo [:botond] [spotty responses until Feb 19] from comment #6)

I'll file a follow-up bug for a proper APZ fix.

Tracking this in bug 1612750.

See Also: → 1612983

This is technically a regression from bug 1526268, and there may be an underlying text selection issue here (i.e. I'm not sure if we legitimately want to force-disable APZ in this scenario), but we definitely need an APZ fix here as well (to make the force-disable mechanism behave reasonably on mobile).

bug 1526268 is designed to only disable APZ when AccessibleCaret is in position:fixed subtree or when its position is changed. The reporter's STR in comment 0 shouldn't disable APZ because the selection is not on position:fixed. I filed bug 1612983 with an analysis of a bug in AccessibleCaret.

Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #9123974 - Attachment is obsolete: true

(In reply to Botond Ballo [:botond] [spotty responses until Feb 19] from comment #6)

I suspect that this bug is worse than the bugs which motivated the use of the "force-disable APZ" mechanism, so I think we should disable that mechanism on Android for the time being. I'll file a follow-up bug for a proper APZ fix.

We now have proper fixes in bug 1612983 and bug 1612750, so we don't need to land this stop-gap measure.

Depends on: 1612750, 1612983
See Also: 1612750, 1612983

I'm going to mark this as fixed by bug 1612983 and bug 1612750.

Bug 1612983 landed in 74, and bug 1612750 landed in 75; since for the STR in this bug, bug 1612983 alone is enough to fix it, I'm going to mark this bug as status-firefox74:fixed.

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: