Page MenuHomePhabricator

Mousewheel scrolling is sluggish in Firefox/Win
Closed, ResolvedPublic

Description

The new scrollbar has taken over scrolling behaviour when using your mousewheel, it seems. On an installation of Windows 7 x64 + Firefox 35.0.1 the scrolling is slower than the browser's native scrollbar.

Revisions and Commits

Event Timeline

GMTA raised the priority of this task from to Needs Triage.
GMTA updated the task description. (Show Details)
GMTA added a project: PHUI.
GMTA added a subscriber: GMTA.

And on an unrelated note: personally I don't think T7014 was worth replacing the native scrollbar with a fake one throughout Phabricator. There have been exactly zero convincing, bug-free, user friendly fake scrollbars on the internet up until now, why is this one going to be different? :)

If it is going to stay, a "use native scrollbars" UI option would be really helpful for the short(?) term issues this is going to spawn.

chad renamed this task from Scrolling with mousewheel with new scrollbar is slower than native scroll to Mousewheel scrolling is sluggish in Firefox.Feb 2 2015, 6:35 PM

Yeah it's craptastic on Mac too.

Hmm, feels pretty normal to me.

It has this strange latency, running 35.0.1 Mac/Yosemite.

Vertical scrolling seems about 3x faster using the native scrollbar in Firefox based on visual guesstimations.

Odd. We aren't doing anything which should affect this (that is, we don't intercept mousewheel events or anything, and the frame still has a normal scrollbar, it's just hidden off to the side of the screen). Seems unchanged on, uh, whatever the one before Yosemite is. Cougarlion or whatever.

Dunno if this profile helps.

pasted_file (311×1 px, 159 KB)

Can I test it not being offscreen for performance?

Actually Firefox scrolling is slow for me on every website, not just Phabricator.

I'm seeing a huge difference in scroll speed between Phabricator and other sites, and I'm 99% sure that scrolling is slower since the introduction of the new scrollbar. Is there a way for me to temporarily use native scrolling (through the console?) to confirm this?

Yeah, Firefox doesn't feel quite like native scrolling to me, but it feels the same on Phabricator / Hacker News / Reddit. Definitely not 3x slower in Phabricator than on other sites.

@GMTA, do you have an older machine or a netbook or something like that?

D11622 might fix this, if it's related to redraw performance. Can you try applying that and see if it resolves things?

It feels like a distance traveled per scroll. On github I get maybe 500px for a scroll, on phabricator maybe 100-200.

@GMTA, do you have an older machine or a netbook or something like that?

No this rig is disgustingly fast.

D11622 might fix this, if it's related to redraw performance. Can you try applying that and see if it resolves things?

I applied the patch to my install and refreshed, but I saw no difference.

I tested Win/Ubuntu/Mac with Scrollbar changes on, off, and the patch, and I could not perceive any regression. One mouse scroll got me to the same place each time. The only thing that improved scrolling for me in any version of Firefox was changing the about:config options in Firefox itself.

OK so I added that 'return' and ran celerity map (took me a while before I discovered I needed to do that) and my native scrollbar is exactly as sluggish as the fake one. If that change completely disables the fake scrollbar, then it has nothing to do with the sluggishness. But I don't know what does cause it either.

I think the issue is that we're technically scrolling a frame, not the document root. It looks like Firefox scrolls frames at 50% of the speed that it scrolls the document root:

https://bugzilla.mozilla.org/show_bug.cgi?id=513817

So this isn't a Javascript problem, per se, but a problem with putting the entire page content in a frame.

If you turn off mousewheel.system_scroll_override_on_root_content.enabled, every website scrolls at the "slow" speed (3 lines per wheel tick). If you leave it on (the default), document roots scroll at an artificially "fast" speed (6 lines per wheel tick) while frames scroll at the system "slow" speed (3 lines per wheel tick).

My initial thought is that Firefox's behavior here is completely bananas.

A workaround is to tweak away this craziness in about:config, although that's obviously not so great.

I guess we can also intercept mousewheel events and artificially double their effect in Firefox only.

I think the issue is that we're technically scrolling a frame, not the document root.

You are right - if I remove the 'overflow: hidden' and 'overflow-y: scroll' styles scrolling is fast as ever! I cannot find any reason on why Firefox would reduce the scrolling speed for a single frame.

This is weird. I work almost exclusively in firefox and I experience none of said problems. Phabricator scrolling is OK. That can be also compared between phabricator instances running pre-fake-scrollbar revision. So... it feels completely OK for me under Firefox 35 and GTK (linux)

The "half-speed scroll" is specific to Windows.

Oh, right - my mistake - So, here I am on windows machine with firefox, IE & chrome opened on this task. Versions are super recent (installed 10 mins ago)

IE - Scrolls fine, looks bit choppy during scrolling
Chrome - Scrolls fine, looks definitelly faster than IE (when scrolling)
Firefox - Scrolls fine, Waaay smoother than IE, but also bit faster than IE. Slower than Chrome.

As for firefox-only comparison between this site & one with pre-fake-scrollbars: it's definitelly not 3x difference. But yeah, it does FEEL different. And yeah, it's firefox-on-windows-only problem.

A simple way to compare scroll distance is to open multiple browsers, scroll all the way to the top and scroll the mousewheel down one notch. Chrome on Windows puts me halfway through the task's title, while Firefox barely escapes the top bar.

chad renamed this task from Mousewheel scrolling is sluggish in Firefox to Mousewheel scrolling is sluggish in Firefox/Win.Feb 2 2015, 10:33 PM
chad added a project: Windows.
btrahan removed btrahan as the assignee of this task.
btrahan added a subscriber: btrahan.

This has been driving me and one of my colleagues crazy for a while now and he came with the following Stylish rule to get rid of it:

/* Page scroll bars */
@-moz-document domain('your.phabricator-domain.com') {
  body > .main-page-frame,
  #phabricator-standard-page,
  #phabricator-standard-page > .jx-scrollbar-viewport {
    overflow: visible;
  }
  
  #phabricator-standard-page > .jx-scrollbar-bar {
    display: none !important;
  }
  
  #phabricator-standard-page > .jx-scrollbar-viewport {
    width: auto !important;
  }
}

I also need to say I completely, fully agree with @GMTA on T7109#94011:

And on an unrelated note: personally I don't think T7014 was worth replacing the native scrollbar with a fake one throughout Phabricator. There have been exactly zero convincing, bug-free, user friendly fake scrollbars on the internet up until now, why is this one going to be different? :)

If it is going to stay, a "use native scrollbars" UI option would be really helpful for the short(?) term issues this is going to spawn.

epriestley claimed this task.