Bug 155334 - REGRESSION(r195661): [GTK] very slow scrolling
Summary: REGRESSION(r195661): [GTK] very slow scrolling
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: Other
Hardware: PC Linux
: P3 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-10 15:56 PST by Tomasz Majer
Modified: 2017-10-06 05:09 PDT (History)
5 users (show)

See Also:


Attachments
full speed scrolling in Epiphany 3.19.91 (1.97 MB, application/octet-stream)
2016-03-10 15:56 PST, Tomasz Majer
no flags Details
dmesg output (61.40 KB, application/octet-stream)
2016-03-13 01:02 PST, Tomasz Majer
no flags Details
Patch (1.95 KB, patch)
2016-03-16 02:12 PDT, Carlos Garcia Campos
svillar: review+
Details | Formatted Diff | Diff
Smooth scrolling in 2.11.92 (5.58 MB, application/octet-stream)
2016-03-17 02:09 PDT, Tomasz Majer
no flags Details
Patch (6.85 KB, patch)
2016-03-17 03:21 PDT, Carlos Garcia Campos
mcatanzaro: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz Majer 2016-03-10 15:56:10 PST
Created attachment 273642 [details]
full speed scrolling in Epiphany 3.19.91

I have Gnome 3.19.91 installed on Arch Linux from unofficial repo. In Epiphany with 'smooth scrolling' enabled scrolling is now "kinetic" and very slow, almost unusable. 
Workaround: I downgraded webkit2gtk to 2.10.7 and it solves the problem.
Comment 1 Tomasz Majer 2016-03-10 16:01:16 PST
Also, is there any way to disable kinetic scrolling but with smooth scrolling still enabled? This is the most useless feature on desktop without touchscreen.
Comment 2 Michael Catanzaro 2016-03-10 17:27:54 PST
I have no clue what could cause this, maybe it thinks you have a touchscreen?
Comment 3 Tomasz Majer 2016-03-13 00:54:26 PST
But why?
Smooth scrolling in Epiphany 2.18 was excellent, but now it is unusable. For me it is huge regression, and I will change my default web browser because of it.
Comment 4 Tomasz Majer 2016-03-13 01:02:31 PST
Created attachment 273881 [details]
dmesg output
Comment 5 Michael Catanzaro 2016-03-13 08:07:26 PDT
(In reply to comment #2)
> I have no clue what could cause this

If you could try a few different 2.11.x releases to pinpoint which release introduced the regression, that would be very helpful. Otherwise, since you seem to be the only one who is affected by this issue so far (no doubt we'll start to get more complaints in a few weeks), there's not much we can do. :/
Comment 6 Carlos Garcia Campos 2016-03-13 23:50:43 PDT
The smooth scrolling implementation hasn't changed since 2.10.7. We just refactored the scroll animator classes and it's now in its own file, see http://trac.webkit.org/browser/trunk/Source/WebCore/platform/ScrollAnimatorSmooth.cpp
Comment 7 Carlos Garcia Campos 2016-03-13 23:54:12 PDT
(In reply to comment #2)
> I have no clue what could cause this, maybe it thinks you have a touchscreen?

We don't have anything to detect if there's a touchscreen and do scrolling differently.
Comment 8 Tomasz Majer 2016-03-14 04:38:10 PDT
(In reply to comment #7)
> (In reply to comment #2)
> > I have no clue what could cause this, maybe it thinks you have a touchscreen?
> 
> We don't have anything to detect if there's a touchscreen and do scrolling
> differently.

There is no touchscreen. I have Lenovo Z510 laptop with tachpad, but I mostly use mouse with wheel. I usually use mouse wheel to scroll web pages, and now with "smooth scrolling" enabled in dconf I have very slow kinetic scrolling , no matter if I use touchpad, or mouse wheel... scrolling takes "ages" now.

(In reply to comment #5)
>If you could try a few different 2.11.x releases to pinpoint which release >introduced the regression, that would be very helpful.

I had tried few releases... same problem with 2.11.90, 2.11.5.
With 2.11.4 everything is OK again. With "smooth scrollong" enabled, scrolling useing mouse wheel and touchpad is smooth but not kinetic, and with normal speed.
So it seems that 2.11.5 release introduced the regression.

My english is not very good, sorry.
Comment 9 Carlos Garcia Campos 2016-03-14 04:56:06 PDT
So, it looks like the ScrollAnimator refactoring caused this problem then.
Comment 10 Michael Catanzaro 2016-03-14 07:58:34 PDT
OK, I found the org.gnome.Epiphany enable-smooth-scrolling setting, and can reproduce now. Didn't realize this setting was hooked up to anything as it never worked when I tried it in the past, but it just needs a browser restart.
Comment 11 Tomasz Majer 2016-03-14 08:21:25 PDT
(In reply to comment #10)
> OK, I found the org.gnome.Epiphany enable-smooth-scrolling setting, and can
> reproduce now. Didn't realize this setting was hooked up to anything as it
> never worked when I tried it in the past, but it just needs a browser
> restart.

I hope this bug is possible to fix. I like smooth scrolling, to be honest I have started useing this feature with epiphany last month, and in my opinion it is  much better than Chromium's smooth scrolling.
Comment 12 Carlos Garcia Campos 2016-03-14 09:12:53 PDT
(In reply to comment #10)
> OK, I found the org.gnome.Epiphany enable-smooth-scrolling setting, and can
> reproduce now. Didn't realize this setting was hooked up to anything as it
> never worked when I tried it in the past, but it just needs a browser
> restart.

It used to require a restart, before the refactoring, now we correctly react to the setting change.
Comment 13 Carlos Garcia Campos 2016-03-14 09:13:43 PDT
(In reply to comment #11)
> (In reply to comment #10)
> > OK, I found the org.gnome.Epiphany enable-smooth-scrolling setting, and can
> > reproduce now. Didn't realize this setting was hooked up to anything as it
> > never worked when I tried it in the past, but it just needs a browser
> > restart.
> 
> I hope this bug is possible to fix. I like smooth scrolling, to be honest I
> have started useing this feature with epiphany last month, and in my opinion
> it is  much better than Chromium's smooth scrolling.

Yes, of course it can be fixed, we just need to figure out what I did wrong in the refactoring to change the behavior.
Comment 14 Carlos Garcia Campos 2016-03-16 02:07:46 PDT
Yes, I made a couple of mistakes in r195661
Comment 15 Carlos Garcia Campos 2016-03-16 02:12:31 PDT
Created attachment 274184 [details]
Patch

This patch fixes the issues and restores the previous behavior.
Comment 16 Carlos Garcia Campos 2016-03-16 02:36:24 PDT
Committed r198269: <http://trac.webkit.org/changeset/198269>
Comment 17 Tomasz Majer 2016-03-17 01:36:26 PDT
I have installed webkit2gtk 2.11.92 and it is very weird. When I switch tabs, and try to scroll page by mouse wheel the behaviour change, from good to bad as before. I don't konw how to describe it. I will upload video but I doubt that it will be well visible.
Comment 18 Carlos Garcia Campos 2016-03-17 01:45:52 PDT
(In reply to comment #17)
> I have installed webkit2gtk 2.11.92 and it is very weird. When I switch
> tabs, and try to scroll page by mouse wheel the behaviour change, from good
> to bad as before. I don't konw how to describe it. I will upload video but I
> doubt that it will be well visible.

I think it's because we are losing the visible length again when scrolling without animations in ScrollAnimationSmooth::setCurrentPosition(). I'll look at it.
Comment 19 Tomasz Majer 2016-03-17 02:09:26 PDT
Created attachment 274273 [details]
Smooth scrolling in 2.11.92
Comment 20 Tomasz Majer 2016-03-17 02:30:50 PDT
The behaviour change randomly when I reload the page.
Comment 21 Carlos Garcia Campos 2016-03-17 03:21:43 PDT
Created attachment 274275 [details]
Patch

Could you try this patch on top of 2.11.92?
Comment 22 WebKit Commit Bot 2016-03-17 03:22:59 PDT
Attachment 274275 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/ScrollAnimationSmooth.cpp:43:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebCore/platform/ScrollAnimationSmooth.h:46:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 2 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 23 Tomasz Majer 2016-03-17 03:49:20 PDT
(In reply to comment #21)
> Created attachment 274275 [details]
> Patch
> 
> Could you try this patch on top of 2.11.92?

Yes, of course.
Could you tell me how to do this? I've never patched anything.
I have webkitgtk-2.11.92.tar.xz and wcore-smooth-scrolling.diff in the same directory. What now?
Comment 24 Carlos Garcia Campos 2016-03-17 04:15:37 PDT
(In reply to comment #23)
> (In reply to comment #21)
> > Created attachment 274275 [details]
> > Patch
> > 
> > Could you try this patch on top of 2.11.92?
> 
> Yes, of course.
> Could you tell me how to do this? I've never patched anything.
> I have webkitgtk-2.11.92.tar.xz and wcore-smooth-scrolling.diff in the same
> directory. What now?

But you already built webkitgtk-2.11.92 from sources right?

$ cd webkitgtk-2.11.92
$ cat ../wcore-smooth-scrolling.diff | patch -p1

Don't worry about merge conflicts in ChangeLog if any. And then build again.
Comment 25 Tomasz Majer 2016-03-17 04:43:36 PDT
I have built package useing 'makepkg -cs' in ArchLinux, so unfortunatelly all files have beed removed and I must build whole webkitgtk again :/
I will tell you in about 3 hours, if that patch works or not.
Comment 26 Tomasz Majer 2016-03-17 08:42:59 PDT
It seems that everything is ok now.
Comment 27 Carlos Garcia Campos 2016-03-17 23:56:41 PDT
Committed r198383: <http://trac.webkit.org/changeset/198383>
Comment 28 Tomasz Majer 2016-03-20 15:20:40 PDT
I have tested it for a while and I have impression that scrolling now is a bit slower and less smooth compared to webkit 2.10. But I don't have any proof.