Closed Bug 1947223 Opened 13 days ago Closed 4 days ago

Scrolling hangs since Firefox 137

Categories

(Core :: Layout: Scrolling and Overflow, defect)

Firefox 137
defect

Tracking

()

RESOLVED FIXED
137 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- unaffected
firefox135 --- unaffected
firefox136 --- unaffected
firefox137 + fixed

People

(Reporter: Moritz.Hedtke, Assigned: hiro)

References

(Regression)

Details

(Keywords: nightly-community, regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:137.0) Gecko/20100101 Firefox/137.0

Steps to reproduce:

  1. Go to https://school.moodledemo.net/course/view.php?id=56
  2. Press X on left side to close course index
  3. Try to scroll

Actual results:

Scrolling does not work and instead it always jump back to the top of the page

Expected results:

Scrolling should work as normal

Note: This seems to affect Moodle in general (The moodle of my university is also affected)

Status: UNCONFIRMED → NEW
Component: Untriaged → Layout: Scrolling and Overflow
Ever confirmed: true
Product: Firefox → Core
Regressed by: 1943865

I see the same behavior on my universities moodle instance, and was just about to file a bug as well. Interestingly, I don't see the behavior on https://school.moodledemo.net/course/view.php?id=56, but only on the moodle instance of my university.

:hiro, since you are the author of the regressor, bug 1943865, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Flags: needinfo?(hikezoe.birchill)

The bug is marked as tracked for firefox137 (nightly). However, the bug still isn't assigned.

:fgriffith, could you please find an assignee for this tracked bug? Given that it is a regression and we know the cause, we could also simply backout the regressor. If you disagree with the tracking decision, please talk with the release managers.

For more information, please visit BugBot documentation.

Flags: needinfo?(fgriffith)

This is strange in that scrolling seems fine when the side panel is open. Will discuss with Hiro when he is back online.

Assignee: nobody → hikezoe.birchill
Flags: needinfo?(fgriffith)

The site does scrollIntoView for an element inside the side panel, I suppose it's triggered when the contents is scrolled.

And the sidepanel is a position:fixed element and when it's closed the left style properly is left: calc(-285px + -10px);, it's out of the range of the visual viewport scrollable range. We bailout from the scrollIntoView call if the given target is already inside the visual viewport, but we don't check it's the out of the visual viewport scrollable range.

Status: NEW → ASSIGNED
Flags: needinfo?(hikezoe.birchill)

[started typing some quick investigation notes before hiro commented, but didn't hit submit until now; I'll still post it here in case it's diagnostically useful]

Here's a profile with some scroll logging enabled in about:logging:
https://share.firefox.dev/4gBA87S

In this^ portion of the profile, I think I was dragging the scrollbar down the page, and you can see it working a little bit in the screenshots track (the scroll position advances somewhat), until the scroll position gets yanked back to the top.

Looking at the content process there, it looks like the page is running some JS while we're scrolling, and in particular it's calling focus() on particular elements, so maybe that's involved here?

Here in particular, we've got a sample inside of the page's event-handler for some event that the page dispatches called course.pageItem:updated; and the page handles that by calling focus() on some element:
https://share.firefox.dev/4hU36AZ

Maybe that focus() is what's yanking our scroll position back upwards?

If I open the left sidebar, I can see some sort of highlight styling moving across sections as I scroll the main page (to show you visually what part of the table-of-contents you're in) -- so I wonder if that's related to the explicit focus() invocations here... (like the site is focusing the pieces of the sidebar even though it's collapsed -- and because it's collapsed to the top of the page, that's snapping the scroll position back to the top)

Thank you Daniel for the profile and diagnosis.

(In reply to Daniel Holbert [:dholbert] from comment #8)

Here in particular, we've got a sample inside of the page's event-handler for some event that the page dispatches called course.pageItem:updated; and the page handles that by calling focus() on some element:
https://share.firefox.dev/4hU36AZ

Maybe that focus() is what's yanking our scroll position back upwards?

In the profiler call stack, the focus() is triggered in a scroll event handler.

Though I didn't track down how the contents gets stuck, based on this fact and what I've noticed that bug 1943865 introduced an unnecessary visual smooth scrolling on a certain scrollIntoView call which is handed off to APZ and it results a scroll event, your analysis sounds correct to me.

Pushed by hikezoe.birchill@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0da86f337189 Bail out from ScrollFrameIntoVisualViewport if the given position:fixed element is outside of the viewport. r=dlrobertson
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/50784 for changes under testing/web-platform/tests

Backed out for causing wpt failures @ scrollIntoView-fixed-outside-of-viewport.html

Backout link: https://hg.mozilla.org/integration/autoland/rev/fef27a113e6f8c07c824fa8b41d6ce05a2e5fcd9

Push with failures

Failure log

TEST-PASS | /css/cssom-view/scrollIntoView-align-scrollport-covering-child.html | scrollIntoView scrolls scrollport-covering child in both axes 
[task 2025-02-18T23:37:57.571Z] 23:37:57     INFO - TEST-UNEXPECTED-TIMEOUT | /css/cssom-view/scrollIntoView-fixed-outside-of-viewport.html | Element.scrollIntoView doesn't scroll a position:fixed element outside of the layout viewport - Test timed out
[task 2025-02-18T23:37:57.630Z] 23:37:57     INFO - TEST-UNEXPECTED-TIMEOUT | /css/cssom-view/scrollIntoView-fixed-outside-of-viewport.html | expected OK
[task 2025-02-18T23:37:57.630Z] 23:37:57     INFO - TEST-INFO took 45447ms
[task 2025-02-18T23:37:58.060Z] 23:37:58     INFO - Closing logging queue
[task 2025-02-18T23:37:58.061Z] 23:37:58     INFO - queue closed
[task 2025-02-18T23:37:58.062Z] 23:37:58     INFO - STDOUT: cleanup aborted: Unable to remount device
[task 2025-02-18T23:37:58.071Z] 23:37:58     INFO - Setting up ssl
[task 2025-02-18T23:37:58.268Z] 23:37:58     INFO - certutil | b''
[task 2025-02-18T23:37:58.310Z] 23:37:58     INFO - certutil | b''
[task 2025-02-18T23:37:58.320Z] 23:37:58     INFO - certutil | b'\nCertificate Nickname                                         Trust Attributes\n                                                             SSL,S/MIME,JAR/XPI\n\nweb-platform-tests                                           CT,, \n'
[task 2025-02-18T23:37:58.818Z] 23:37:58     INFO - adb Granting important runtime permissions to org.mozilla.geckoview.test_runner
[task 2025-02-18T23:37:59.894Z] 23:37:59     INFO - adb launch_application: am start -W -n org.mozilla.geckoview.test_runner/org.mozilla.geckoview.test_runner.TestRunnerActivity -a android.intent.action.MAIN --es env0 MOZ_CRASHREPORTER=1 --es env1 MOZ_CRASHREPORTER_NO_REPORT=1 --es env2 MOZ_CRASHREPORTER_SHUTDOWN=1 --es env3 MOZ_HIDE_RESULTS_TABLE=1 --es env4 MOZ_IN_AUTOMATION=1 --es env5 MOZ_LOG=signaling:3,mtransport:4,DataChannel:4,jsep:4 --es env6 R_LOG_LEVEL=6 --es env7 R_LOG_DESTINATION=stderr --es env8 R_LOG_VERBOSE=1 --es env9 MOZ_PROCESS_LOG=/tmp/tmpuo1lm3okpidlog --es env10 MINIDUMP_SAVE_PATH=/builds/worker/workspace/build/blobber_upload_dir --es env11 MOZ_DISABLE_NONLOCAL_CONNECTIONS=1 --es arg0 -no-remote --es arg1 -profile --es arg2 /data/local/tmp/test_root/profile --es arg3 --marionette --es arg4 about:blank
[task 2025-02-18T23:38:01.328Z] 23:38:01     INFO - Starting runner
[task 2025-02-18T23:38:02.225Z] 23:38:02     INFO - TEST-START | /css/cssom-view/scrollIntoView-fixed.html
Flags: needinfo?(hikezoe.birchill)

The root scroll container was NOT scrollable, since the root document element width is 200vw, there was NO minimum-scale specified, thus the document was laid out 0.5x scale, but with initial-scale=1, it's rendered 1.0x scale initially.

I added minimum-scale=1 in the meta viewport tag.

Flags: needinfo?(hikezoe.birchill)
Pushed by hikezoe.birchill@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1425e6d7a4a2 Bail out from ScrollFrameIntoVisualViewport if the given position:fixed element is outside of the viewport. r=dlrobertson
Upstream PR was closed without merging
Status: ASSIGNED → RESOLVED
Closed: 4 days ago
Resolution: --- → FIXED
Target Milestone: --- → 137 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: