Open Bug 1686737 Opened 3 years ago Updated 3 years ago

Scroll position should be maintained when changing settings that take effect in print preview

Categories

(Toolkit :: Printing, defect)

defect

Tracking

()

Tracking Status
firefox84 --- affected
firefox85 --- affected
firefox86 --- affected

People

(Reporter: asoncutean, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [print2021_v86] [old-ui+])

Affected versions

  • 85.0b8
  • 86.0a1 (2021-01-13)

Affected platforms

  • Windows 7
  • Windows 10
  • Ubuntu 20.04
  • macOS 10.15

Steps to reproduce

  1. Open https://www.mozilla.org/en-US/privacy/firefox/
  2. Hit Ctrl + P
  3. Scroll down the preview until the page footer
  4. Select Print backgrounds

Expected result

  • The Print preview refreshes, background is applied, the scroll position is maintained

Actual result

  • The Print preview refreshes, user has to scroll down again to see the background being applied on the footer

Regression range

  • Not a regression, reproducible way back to Fx 30.0a1

Additional notes

  • Scroll position inside the preview is maintained on other browsers
  • Issue reproducible for all the options that takes effect in preview
  • Reproducible with the old UI as well
Has STR: --- → yes
Summary: Scroll position should be maintained when changing settings that takes effect in print preview → Scroll position should be maintained when changing settings that take effect in print preview

I think we can handle this on the frontend. Perhaps we can get the scroll % scrollY / document.body.clientHeight and restore that when the preview is updated.

Testing in Chrome on Windows 10, it looks like it tries to determine what sheet is being shown and it restores to that. So if you're scrolled to page 28.75 (so page 29 is nearly flush to the top of the viewport) and you change the page range to something like 25-35 you'll be right at the end of the document. Setting it back to all pages will drop you on page 11 since that's what sheet you had visible before.

Component: Print Preview → Printing
Product: Core → Toolkit
You need to log in before you can comment on or make changes to this bug.