Closed Bug 1757410 Opened 3 years ago Closed 2 years ago

Scroll thumb disappears if Firefox is moved between screens of different resolutions

Categories

(Core :: Panning and Zooming, defect)

All
macOS
defect

Tracking

()

RESOLVED FIXED
105 Branch
Tracking Status
firefox-esr91 --- unaffected
firefox-esr102 --- wontfix
firefox97 --- wontfix
firefox98 --- wontfix
firefox99 --- wontfix
firefox100 --- wontfix
firefox101 --- wontfix
firefox104 --- wontfix
firefox105 --- verified

People

(Reporter: bmaris, Assigned: hiro)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

Affected versions

  • Firefox 92.0a1
  • Firefox 97.0.1
  • Firefox 98.0b9
  • Latest Nightly 99.0a1

Affected platforms

  • MacOS 11.6

Steps to reproduce

  1. Open Firefox on MacBook screen
  2. Visit a website with scroll, best reproducible on Wikipedia.org homepage
  3. Scroll inside the webpage
  4. Move Firefox to the external screen
  5. Scroll inside Firefox
  6. Refresh the website
  7. Move Firefox back to MacBook screen
  8. Scroll inside Firefox

Expected result

  • Step 5 and step 8 - Scrollbar is visible and the page can be scrolled. Scroll elevator has the same height on both screens.

Actual result

  • Step 5 - Scrollbar is invisible though the page can be scrolled. Scroll elevator is not visible and can`t be clicked.
  • Step 8 - Scrollbar is visible but the scroll elevator has a significant shorter height and does not move through the entire height of the scrollbar.

Regression range

Additional notes

  • MacBook Pro with 1792x1120 resolution, one or two external screens with 1920x1080 resolution.
  • I am not sure if this is also reproducible using windows machine, I don't have one at my disposal.
Flags: needinfo?(hikezoe.birchill)
Has Regression Range: --- → yes
Has STR: --- → yes

Set release status flags based on info from the regressing bug 1718012

Bogdan, I'd assume the browser window size wasn't changed but the DPI for each screen is different, right? I'd guess the macbook pro is HiDPI mode, rather the external ones are normal DPI.

Flags: needinfo?(hikezoe.birchill) → needinfo?(bogdan.maris)

(In reply to Hiroyuki Ikezoe (:hiro) from comment #2)

Bogdan, I'd assume the browser window size wasn't changed but the DPI for each screen is different, right? I'd guess the macbook pro is HiDPI mode, rather the external ones are normal DPI.

Correct, the browser window did not change after moving from one screen to another. The Mac I'm using is MacBook Pro (16-inch, 2019); CPU: 2,3 GHz 8-Core Intel Core i9; GPU: Intel UHD Graphics 630 1536 MB with the display set to Default scale (1792x1120 resolution) and the external monitors are set to Default scale as well, FullHD max (1920x1080 resolution).

Flags: needinfo?(bogdan.maris)

Thanks!

I suppose when the DPI is changed, nsPresContext::AppUnitsPerDevPixelChanged ensures at least one reflow, but there seems a race condition it doesn't work as expected.

Summary: Scroll elevator changes height if Firefox is moved between screens of different resolutions → Scroll thumb changes height if Firefox is moved between screens of different resolutions

For me the scroll thumb completely disappears and does not reappear even after scrolling the page.

Summary: Scroll thumb changes height if Firefox is moved between screens of different resolutions → Scroll thumb disappears if Firefox is moved between screens of different resolutions

:hiro is this something that can be fixed?

Flags: needinfo?(hikezoe.birchill)

Yes, I believe so.

In bug 1718012 I moved mMobileViewportManager->UpdateSizesBeforeReflow() call into PresShell::SimpleResizeReflow(), but now I think it should be moved into PresShell::ResizeReflowIgnoreOverride, SimpleResizeReflow is a special case in ResizeReflowIgnoreOverride. With the change, I think mobile viewport stuff works for the DPI changes case. But I don't have any setup to test it locally.

Flags: needinfo?(hikezoe.birchill)

I can look into this.

This is probably Mac specific (as the bug reporter filed originally).

Today I tested my Linux box with Wayland where I can setup different scale on multiple monitors. I have been using 4K monitor which can be divided as two monitors side-by-side. On the GNOME settings I changed one of the monitors scale to 200% and the other is 100%, but I don't see any issues while moving Firefox window in between the monitors.

See Also: → 1780559

The change does trigger reflows, it doesn't change the root frame size, but it
needs to change MobileViewportManager metrics, specifically mDisplaySize.

The reason why we invoke UpdateSizesBeforeReflow in
FlushPendingMediaFeatureValuesChanged rather than UIResolutionChangedInternal
is UIResolutionChangedInternal gets called just before changing the widget size
and position in BrowserChild::RecvUIResolutionChanged so that
MobileViewportManager will pick the old size if it's used in
UIResolutionChangedInternal.

Assignee: nobody → hikezoe.birchill
Status: NEW → ASSIGNED

Unfortunately this test doesn't run as expected on our CI since macs on our CI
are running normal DPI mode.

I tested this test works properly on my macbook, it fails without the fix in the
previous commit and it passes with the fix.

Depends on D153687

Attachment #9288404 - Attachment description: Bug 1757410 - Invoke MobileViewportManager::UpdateSizesBeforeReflow in the case of MediaFeatureChangeReason::ResolutionChange. r?tnikkel → Bug 1757410 - Ensure MobileViewportManager::UpdateSizesBeforeReflow gets called with up-to-date app-units-per-dev-pixel and CV bounds in UIResolutionChangedInternal. r?emilio

I am going to land D153687 without tests (D153688).

Keywords: leave-open
Pushed by hikezoe.birchill@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3459b021f7a5 Ensure MobileViewportManager::UpdateSizesBeforeReflow gets called with up-to-date app-units-per-dev-pixel and CV bounds in UIResolutionChangedInternal. r=emilio
Blocks: 1780559
See Also: 1780559

Can we move the tests to a new bug so we can close this out as resolved?

Flags: needinfo?(hikezoe.birchill)
Blocks: 1786668

Comment on attachment 9288405 [details]
Bug 1757410 - Add a test case that MobileViewportManager is properly updated when browser window moves from a HiDPI monitor to normal one. r?tnikkel

Revision D153688 was moved to bug 1786668. Setting attachment 9288405 [details] to obsolete.

Attachment #9288405 - Attachment is obsolete: true

Done!

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Flags: needinfo?(hikezoe.birchill)
Resolution: --- → FIXED
Keywords: leave-open
Target Milestone: --- → 105 Branch
Regressions: 1787079

I can confirm that the issue here is fixed for me on macOS 11.6 using the latest Nightly 106.0a1 and Firefox 105.0b8.

Regressions: 1797170
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: