Open Bug 1997120 Opened 1 year ago Updated 8 months ago

www.digitalcitizen.life - The scroll position resets to the top of the page when resizing the browser window size

Categories

(Web Compatibility :: Site Reports, defect, P3)

Desktop
All

Tracking

(Webcompat Priority:P3, Webcompat Score:2, firefox144 affected, firefox145 affected, firefox146 affected)

Webcompat Priority P3
Webcompat Score 2
Tracking Status
firefox144 --- affected
firefox145 --- affected
firefox146 --- affected

People

(Reporter: rbucata, Unassigned)

References

(Depends on 1 open bug, )

Details

(Keywords: webcompat:platform-bug, webcompat:site-report, Whiteboard: [webcompat-source:web-bugs])

User Story

platform:windows,mac,linux
impact:annoyance
configuration:general
affects:all
branch:release
diagnosis-team:apz
user-impact-score:20

Attachments

(1 file)

Environment:
Operating system: Windows 10
Firefox version: Firefox 144.0

Steps to reproduce:

  1. Navigate to:https://www.digitalcitizen.life/minimize-maximize-apps-windows/
  2. Scroll a bit
  3. Resize the browser window size and observe

Expected Behavior:
The scroll position is mainly kept

Actual Behavior:
The scroll position is reset to the top

Notes:

  • Reproduces regardless of the status of ETP
  • Reproduces in firefox-nightly, and firefox-release
  • Does not reproduce in chrome

Created from https://github.com/webcompat/web-bugs/issues/185682

This happens because the page reloads when resizing the browser window, in both Chrome and Firefox, but Chrome kind of keeps the scroll position.

Attached video Chr vs ff —

So the page is just... reloading itself on resize. I don't know why either. It's doing that in Chrome, too, but Chrome is keeping the scroll position.

Severity: -- → S4
User Story: (updated)
Webcompat Priority: --- → P3
Webcompat Score: --- → 3
Priority: -- → P3
  • When manually reloading the page without resizing, the scroll position appears to be preserved.
  • However, when reloading via resizing in STR, the scroll position is not preserved.
Webcompat Score: 3 → 2

It's not easy to diagnose. While I was wondering how Chrome handles this case, the site started blocking my request. I get "Exceeded the maximum number of page requests per minute for humans.".

The reason why we don't restore the scroll position is we get null history state here in nsDocShell::GetLayoutHistoryState after reloading.

It doesn't look apz related.

OS: Windows 10 → All

When the window gets resized, the following function is called.

  function reloadPage() {
    window.location.reload(true); 
  }

With the boolean argument we set LOAD_FLAGS_BYPASS_CACHE|LOAD_FLAGS_BYPASS_PROXY. That's the reason why we've lost the scroll position.

Depends on: 1037721
No longer blocks: 1570566
See Also: → 1570566
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: