Bug 136433 - REGRESSION (r172832): Poor 2-finger scrolling performance at theverge.com articles (all tiles repaint)
Summary: REGRESSION (r172832): Poor 2-finger scrolling performance at theverge.com art...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P1 Normal
Assignee: Nobody
URL: http://www.theverge.com/2014/8/31/609...
Keywords: InRadar, Regression
Depends on:
Blocks:
 
Reported: 2014-09-01 12:26 PDT by mitz
Modified: 2014-09-04 13:48 PDT (History)
8 users (show)

See Also:


Attachments
Patch (2.60 KB, patch)
2014-09-03 13:54 PDT, Beth Dakin
no flags Details | Formatted Diff | Diff
Test case (201 bytes, text/html)
2014-09-03 15:59 PDT, Beth Dakin
no flags Details
Patch (7.67 KB, patch)
2014-09-03 20:10 PDT, Beth Dakin
thorton: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2014-09-01 12:26:27 PDT
Performing a two-finger scroll gesture on theverge.com articles causes all tiles to repaint, and scrolling either doesn’t happen or happens very slowly.

To reproduce, navigate to the URL and two-finger scroll vertically. With repaint counters on, you’ll see that all the tiles repaint with every wheel event (even if the page doesn’t scroll at all).

This was cause by <http://trac.webkit.org/r172832>, the fix for bug 91655.
Comment 1 mitz 2014-09-01 12:26:39 PDT
<rdar://problem/18193942>
Comment 2 Beth Dakin 2014-09-02 13:17:59 PDT
I'm actually having a hard time reproducing the bug at The Verge, but it is very obvious at hulu.com for me.
Comment 3 Beth Dakin 2014-09-03 13:54:38 PDT
Created attachment 237578 [details]
Patch

Unfortunately, I still don't totally understand what Hulu is doing to get into this state, and therefore I don't have a test case. I have failed so far in my attempts to make a reduction.
Comment 4 Beth Dakin 2014-09-03 15:59:42 PDT
Created attachment 237596 [details]
Test case

Here's a test case that reproduces the bug! So far I haven't found a way to turn it into a layout test since the bug does not reproduce when scrolling programatically.
Comment 5 Tim Horton 2014-09-03 16:02:20 PDT
(In reply to comment #4)
> Created an attachment (id=237596) [details]
> Test case
> 
> Here's a test case that reproduces the bug! So far I haven't found a way to turn it into a layout test since the bug does not reproduce when scrolling programatically.

What if you use bfulgham's magical scroll event generating internals thing? Those look way more like real scroll events to WebKit IIRC.
Comment 6 Beth Dakin 2014-09-03 20:10:26 PDT
Created attachment 237607 [details]
Patch

A few notes about this patch. I took Tim's suggestion, and tried to use Brent's momentum events to create a test, and I kind of succeeded. The test seems to work on my machine. I am just dubious because I am not 100% convinced that these momentum events will do the exact same thing on all computers. So I put a note in the test about how if it turns out to be flakey, we can skip it. But! It is effective on my machine.

Another note. Sitting with Simon and Sam about this bug, they also want ScrollableArea::handleWheelEvent() to return early is the ScrollableArea is not scrollable or rubberbandable. I am going to implement that in a followup patch because adding a virtual function to ScrollableArea called isScrollableOrRubberbandable() turns out to be a bit complicated for RenderListBox since there is already a virtual function of that same name in its RenderObject inheritance chain. Ah, the joys of multiple inheritance. Anyway, there are obviously solutions to that problem, but it seems involved enough that it should be a separate patch.
Comment 7 Beth Dakin 2014-09-04 12:19:31 PDT
Comment on attachment 237607 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=237607&action=review

> LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/root-overflow-with-mousewheel.html:35
> +    setTimeout(checkForScroll, 500);

Oh, I can get rid of this setTimeout completely, so that's good.
Comment 8 Tim Horton 2014-09-04 13:43:33 PDT
Comment on attachment 237607 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=237607&action=review

> Source/WebCore/rendering/RenderLayer.cpp:6401
> +    bool needsHorizontalScrollbar = renderer().hasOverflowClip() && ((hasHorizontalScrollbar() && overflowDefinesAutomaticScrollbar(overflowX)) || overflowRequiresScrollbar(overflowX));

we already have our RenderBox in a local, perhaps use that instead?

>> LayoutTests/platform/mac-wk2/tiled-drawing/scrolling/root-overflow-with-mousewheel.html:35
>> +    setTimeout(checkForScroll, 500);
> 
> Oh, I can get rid of this setTimeout completely, so that's good.

Please do! 500ms tests are unwelcome :)
Comment 9 Beth Dakin 2014-09-04 13:48:35 PDT
Thanks Tim! http://trac.webkit.org/changeset/173275