Open Bug 1793928 Opened 2 years ago Updated 1 year ago

Zooming in Reader View with CTRL+Mouse also scrolls the page

Categories

(Toolkit :: Reader Mode, defect, P3)

Desktop
All
defect

Tracking

()

Tracking Status
firefox105 --- affected
firefox106 --- affected
firefox107 --- affected

People

(Reporter: oardelean, Unassigned)

Details

Found in

  • 106.0b8;

Affected versions

  • 106.0b8;
  • 107.0a1;
  • 105.0;

Tested platforms

  • macOS 12;
  • Windows 10;
  • Ubuntu 22;

Affected platforms

  • macOS 12;
  • Windows 10;
  • Ubuntu 22;

Unaffected platforms

  • N/A;

Steps to reproduce

  1. Launch Firefox.
  2. Go to a page which has the Reader View option, such as https://longform.org/best .
  3. Enable Reader View.
  4. Scroll down the page and zoom in/out the page using CTRL+Mouse Wheel.

Expected result

  • The page zooms in and out without issues.

Actual result

  • Page is also scrolled whilst zooming.

Regression range

  • Not a recent regression since I can reproduce back in 2019 versions.

Notes

  • This does not reproduce in Chrome.
  • When the scroll bar is at the top/bottom, the page zooms in/out normally.
Severity: -- → S4

Hey botond, I seem to recall that there's some smarts inside of Gecko that tries to maintain the scroll position when doing text zoom... in fact, I can see us doing a good job of this when I zoom the text outside of Reader Mode...

Presuming such a mechanism exists and I'm not imagining it, any idea why this might be broken for about:reader? Is this something that about: pages can opt into?

Flags: needinfo?(botond)

(In reply to Mike Conley (:mconley) (:⚙️) from comment #1)

Hey botond, I seem to recall that there's some smarts inside of Gecko that tries to maintain the scroll position when doing text zoom... in fact, I can see us doing a good job of this when I zoom the text outside of Reader Mode...

Presuming such a mechanism exists and I'm not imagining it,

Yep, such a mechanism exists, though it's not specific to full zoom / text zoom, but rather applies to any reflow: scroll frames remember their scroll position before the reflow, and try to scroll to it after the reflow. The remembered scroll position is stored in app units (which are a constant 60:1 ratio to CSS units), so as long as the reflow did not cause too many text lines to wrap, the content that's on-screen should remain relatively stable.

any idea why this might be broken for about:reader? Is this something that about: pages can opt into?

It seems to me like about:reader is opting out of the browser's full-zoom handling altogether, and hooks/implements Ctrl+mousewheel itself. I haven't verified this in the code but my evidence pointing to this is:

  • The indicator that usually shows the zoom level in the URL bar (e.g. "90%") does not appear.
  • The Reader Mode controls (e.g. the Text Size button) do not change their size, only the article contents.
  • window.devicePixelRatio, which usually changes in response to Ctrl+mousewheel, remains constant

I guess about:reader's own implementation of zooming does not take care to preserve the scroll offset the way the browser's native implementation does.

Flags: needinfo?(botond)
Priority: -- → P3

Did we recently disable ctrl+scroll zooming altogether? Or did that only happen for touchpads? ISTR seeing it fly by in release notes. If we disabled it completely perhaps this reader mode code just needs to go away?

(In reply to Botond Ballo [:botond] [away until 02/17] from comment #2)

It seems to me like about:reader is opting out of the browser's full-zoom handling altogether, and hooks/implements Ctrl+mousewheel itself.

Yep, this is right.

I guess about:reader's own implementation of zooming does not take care to preserve the scroll offset the way the browser's native implementation does.

Right - this would be a bit tricky because we're changing the font size used to render the text so the actual scroll position meaning (even in app units / CSS px) also changes.

Flags: needinfo?(botond)

(In reply to :Gijs (he/him) from comment #3)

Did we recently disable ctrl+scroll zooming altogether? Or did that only happen for touchpads?

Only on Mac touchpads I believe (bug 1781960), to align with the behaviour of other browsers on that platform.

Flags: needinfo?(botond)
You need to log in before you can comment on or make changes to this bug.