Bug 107611 - Fix rubber-band effect on non-scrollable pages
Summary: Fix rubber-band effect on non-scrollable pages
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-22 18:18 PST by Christopher Cameron
Modified: 2013-01-31 17:33 PST (History)
11 users (show)

See Also:


Attachments
Patch (1.60 KB, patch)
2013-01-22 18:23 PST, Christopher Cameron
no flags Details | Formatted Diff | Diff
Patch (1.61 KB, patch)
2013-01-23 11:11 PST, Christopher Cameron
no flags Details | Formatted Diff | Diff
Patch (1.65 KB, patch)
2013-01-23 12:38 PST, Christopher Cameron
no flags Details | Formatted Diff | Diff
Patch (29.75 KB, patch)
2013-01-28 11:18 PST, Christopher Cameron
no flags Details | Formatted Diff | Diff
Patch (158.99 KB, patch)
2013-01-28 17:32 PST, Christopher Cameron
no flags Details | Formatted Diff | Diff
Patch (159.05 KB, patch)
2013-01-31 11:05 PST, Christopher Cameron
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Cameron 2013-01-22 18:18:38 PST
[chromium] Fix rubber-band effect on non-scrollable pages
Comment 1 Christopher Cameron 2013-01-22 18:23:25 PST
Created attachment 184098 [details]
Patch
Comment 2 Christopher Cameron 2013-01-22 18:30:02 PST
This reverts a part of
https://bugs.webkit.org/show_bug.cgi?id=105632
in order to fix rubber-band over-scrolling in Chrome.
Comment 3 Antonio Gomes 2013-01-22 20:59:38 PST
Comment on attachment 184098 [details]
Patch

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

> Source/WebCore/page/FrameView.cpp:-3777
> -    if (!isScrollable())

can not isScrollable get relaxed instead? so it could take overscroll/rubber-band into account.

enum ScrollabilityStrategy { ConsiderRubberBand, IgnoreRubberBand };
bool isScrollable(ScrollabilityStrategy strategy)
{
    // Even non overflown views are scrollable if rubber-band is enforced
    if (strategy == ConsiderRubberBand)
        return true;
    (...)
}
Comment 4 James Robinson 2013-01-22 22:08:48 PST
Comment on attachment 184098 [details]
Patch

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

> Source/WebCore/ChangeLog:3
> +        [chromium] Fix rubber-band effect on non-scrollable pages

don't mark a patch [chromium] if it touches cross-platform code
Comment 5 Christopher Cameron 2013-01-23 11:11:02 PST
Created attachment 184267 [details]
Patch
Comment 6 Christopher Cameron 2013-01-23 11:12:15 PST
(In reply to comment #3)
> (From update of attachment 184098 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=184098&action=review
> 
> > Source/WebCore/page/FrameView.cpp:-3777
> > -    if (!isScrollable())
> 
> can not isScrollable get relaxed instead? so it could take overscroll/rubber-band into account.

Maybe it would be best to add this comment to the original site of the removed isScrollable.  I've updated the patch to say explicitly that 
    // Note that even non-scrollable views should handle wheel events, to allow for rubber-band
    // over-scroll behavior
This way, it avoids hanging the other call to isScrollable in updateScrollableAreaSet.  Does this look good to you?

(In reply to comment #4)
> don't mark a patch [chromium] if it touches cross-platform code

Sorry, fixed.
Comment 7 Christopher Cameron 2013-01-23 12:08:43 PST
(In reply to comment #6)
> This way, it avoids hanging the other call to 

This should read "changing the other call", not "hanging the other call"
Comment 8 Antonio Gomes 2013-01-23 12:21:30 PST
Comment on attachment 184267 [details]
Patch

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

> Source/WebCore/page/FrameView.cpp:3778
> -    if (!isScrollable())
> -        return false;
> +    // Note that even non-scrollable views should handle wheel events, to allow for rubber-band
> +    // over-scroll behavior.

That would work, but what about wrapping the if statement with  #if !ENABLE(RUBBER_BANDING) ?
Comment 9 Christopher Cameron 2013-01-23 12:38:55 PST
Created attachment 184284 [details]
Patch
Comment 10 Christopher Cameron 2013-01-23 12:41:32 PST
(In reply to comment #8)
> (From update of attachment 184267 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=184267&action=review
> 
> > Source/WebCore/page/FrameView.cpp:3778
> > -    if (!isScrollable())
> > -        return false;
> > +    // Note that even non-scrollable views should handle wheel events, to allow for rubber-band
> > +    // over-scroll behavior.
> 
> That would work, but what about wrapping the if statement with  #if !ENABLE(RUBBER_BANDING) ?

Sure -- updated.
Comment 11 Antonio Gomes 2013-01-23 12:57:25 PST
Btw, it should be USE instead of ENABLE
Comment 12 Christopher Cameron 2013-01-23 13:18:48 PST
Thanks!

(In reply to comment #11)
> Btw, it should be USE instead of ENABLE

Good point -- "optional OS service" does match the conditions for its use (particular OS version) more than "turn on a specific feature" (but ENABLE_RUBBER_BANDING is fairly embedded).
Comment 13 Nico Weber 2013-01-23 14:57:43 PST
I hate to be that guy, but is there some way this could be tested? I remember Alexei added overflow paint tests somewhere. Is that not enough testing infrastructure to cover this?
Comment 14 Nico Weber 2013-01-23 14:59:37 PST
This added the tests we have: http://trac.webkit.org/changeset/107711
Comment 15 Christopher Cameron 2013-01-23 15:20:12 PST
(In reply to comment #13)
> is there some way this could be tested?

I should be able to add a WebCore::Internals::wheelEvent (similar to Internals::setScrollViewPosition) to hook into the FrameView at a higher level. Should't be too complicated, unless I run into platform-specific idiosyncrasies along the line.
Comment 16 James Robinson 2013-01-23 15:24:44 PST
Take a look at the eventSender interface (exposed only to DumpRenderTree) - can it generate the mousewheel events you want?
Comment 17 Christopher Cameron 2013-01-24 00:49:17 PST
(In reply to comment #16)
> Take a look at the eventSender interface (exposed only to DumpRenderTree) - can it generate the mousewheel events you want?

Thanks -- it looks like they can be added in there.  Do you want me to hold off on committing this until I add the tests?
Comment 18 Antonio Gomes 2013-01-24 05:57:42 PST
(In reply to comment #17)
> (In reply to comment #16)
> > Take a look at the eventSender interface (exposed only to DumpRenderTree) - can it generate the mousewheel events you want?
> 
> Thanks -- it looks like they can be added in there.  Do you want me to hold off on committing this until I add the tests?

Yes. It should be less than some hours to come up with a test.
Comment 19 Antonio Gomes 2013-01-24 05:58:24 PST
Comment on attachment 184284 [details]
Patch

Lets add a test. :%s/r+/r-/g
Comment 20 Christopher Cameron 2013-01-28 11:18:02 PST
Created attachment 185019 [details]
Patch
Comment 21 Christopher Cameron 2013-01-28 11:22:32 PST
(In reply to comment #20)
> Created an attachment (id=185019) [details]
> Patch

I've added a single test (testing over-scroll in one direction).  I'll add the other directions, but please verify that you like the structure of the test first.

I added a beginMouseWheel function to EventSender (since this needs to bracket the scroll events).  I did not add an endMouseWheel because it won't be used in this test.  LMK if you'd like it for completeness).

Also, LMK if you'd prefer that any part of beginMouseWheel be parameterized (e.g, hasPreciseScrollingDeltas).
Comment 22 Nico Weber 2013-01-28 12:14:26 PST
Comment on attachment 185019 [details]
Patch

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

Nice! Looks good to me (but I'm not a reviewer); one question about the naming though:

> Tools/DumpRenderTree/chromium/TestRunner/src/EventSender.cpp:1048
> +void EventSender::mouseWheelBegin(const CppArgumentList& arguments, CppVariant* result)

Should this be called mouseDragBegin() as it's not really a wheel event?
Comment 23 Build Bot 2013-01-28 16:35:30 PST
Comment on attachment 185019 [details]
Patch

Attachment 185019 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/16160773

New failing tests:
fast/workers/worker-close-more.html
Comment 24 Christopher Cameron 2013-01-28 17:32:46 PST
Created attachment 185116 [details]
Patch
Comment 25 Christopher Cameron 2013-01-28 17:39:06 PST
(In reply to comment #22)
> (From update of attachment 185019 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=185019&action=review
> 
> > Tools/DumpRenderTree/chromium/TestRunner/src/EventSender.cpp:1048
> > +void EventSender::mouseWheelBegin(const CppArgumentList& arguments, CppVariant* result)
> 
> Should this be called mouseDragBegin() as it's not really a wheel event?

I've renamed this (though I'm entirely flexible on the name).  I've also added the remaining cardinal directions to the tests.
Comment 26 Christopher Cameron 2013-01-29 12:51:22 PST
Review ping.
Comment 27 Antonio Gomes 2013-01-29 13:24:24 PST
(In reply to comment #26)
> Review ping.

James, could you sign-off the chromium specific bits?
Comment 28 Christopher Cameron 2013-01-31 10:18:09 PST
(In reply to comment #27)
> (In reply to comment #26)
> > Review ping.
> 
> James, could you sign-off the chromium specific bits?

Ping.
Comment 29 James Robinson 2013-01-31 10:48:38 PST
Comment on attachment 185116 [details]
Patch

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

chromium parts seem fine

> LayoutTests/platform/chromium/rubberbanding/event-overhang-e.html:1
> +<html>

<!DOCTYPE html> on this and all other new html files
Comment 30 Christopher Cameron 2013-01-31 11:05:44 PST
Created attachment 185817 [details]
Patch
Comment 31 WebKit Review Bot 2013-01-31 17:33:44 PST
Comment on attachment 185817 [details]
Patch

Clearing flags on attachment: 185817

Committed r141514: <http://trac.webkit.org/changeset/141514>
Comment 32 WebKit Review Bot 2013-01-31 17:33:51 PST
All reviewed patches have been landed.  Closing bug.