RESOLVED FIXED 146693
Rubber banding is broken when using a Mighty Mouse
https://bugs.webkit.org/show_bug.cgi?id=146693
Summary Rubber banding is broken when using a Mighty Mouse
Wenson Hsieh
Reported 2015-07-07 13:59:37 PDT
Scrolling against the edge of a container with a mighty mouse causes the offset to move out of the container.
Attachments
Patch (5.86 KB, patch)
2015-07-07 15:08 PDT, Wenson Hsieh
no flags
Patch (5.86 KB, patch)
2015-07-07 15:14 PDT, Wenson Hsieh
no flags
Patch (9.15 KB, patch)
2015-07-09 11:32 PDT, Wenson Hsieh
no flags
Patch (5.58 KB, patch)
2015-07-09 13:18 PDT, Wenson Hsieh
no flags
Archive of layout-test-results from ews100 for mac-mavericks (769.76 KB, application/zip)
2015-07-09 13:53 PDT, Build Bot
no flags
Archive of layout-test-results from ews104 for mac-mavericks-wk2 (895.04 KB, application/zip)
2015-07-09 13:54 PDT, Build Bot
no flags
Patch (6.30 KB, patch)
2015-07-09 14:18 PDT, Wenson Hsieh
no flags
Wenson Hsieh
Comment 1 2015-07-07 14:01:50 PDT
Wenson Hsieh
Comment 2 2015-07-07 15:08:50 PDT
Wenson Hsieh
Comment 3 2015-07-07 15:14:59 PDT
Brent Fulgham
Comment 4 2015-07-08 10:16:55 PDT
Comment on attachment 256325 [details] Patch This looks good to me, but I think Beth should double-check in case I'm missing something.
Beth Dakin
Comment 5 2015-07-08 10:42:44 PDT
Comment on attachment 256325 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=256325&action=review > Source/WebCore/ChangeLog:1 > +2015-07-07 Wenson Hsieh <whsieh@berkeley.edu> You should be using your apple email address here. > Source/WebCore/platform/mac/ScrollAnimatorMac.mm:1110 > +static bool isStatelessWheelEvent(const PlatformWheelEvent& wheelEvent) I'm concerned about this phrase "stateless." This does not seem like a good/descriptive-enough name for this to me. > Source/WebCore/platform/mac/ScrollAnimatorMac.mm:1112 > + return wheelEvent.phase() == PlatformWheelEventPhaseNone && wheelEvent.momentumPhase() == PlatformWheelEventPhaseNone; Why is it okay to definitely return early here? Are you certain there is nothing more to do? Has the event already had a chance to be propagated to the DOM? Do we ever get events with this phase configuration for a non-Mighty-mouse? This bug, I believe, it unique to overflow scrolling. In other words, it does not happen to the main document. How do we get it right for the main document?
Wenson Hsieh
Comment 6 2015-07-08 22:44:50 PDT
Ok -- I've traced the bug to what I believe is the source. Both mainframe and overflow scrolling go through ScrollController::handleWheelEvent. This, in turn, invokes the scroll client (m_client)'s immediateScrollBy method. This is where things start to diverge. Mainframe scrolling uses ScrollingTreeFrameScrollingNodeMac::immediateScrollBy, which calls a few methods which end up clamping the destination scroll offset to a min and max. When scrolling against the edge of the mainframe a Mighty Mouse, this clamping operation doesn't cause us to go over the edge of the container, so mainframe Mighty Mouse scrolling behaves as expected. For overflow scrolling, ScrollAnimatorMac::immediateScrollBy does something similar: before performing the scroll, it consults adjustScrollPositionIfNecessary for the scroll offsets it should land on. However, this *only* clamps the scroll offsets to the min/max if !m_scrollableArea.constrainsScrollingToContentEdge(). This is not the case initially, as the constructor for RenderLayer does not constrain scrolling to the content edge by default! I was able to "fix" this issue by turning this edge constraint on by default, but it's not clear whether this will have unintended consequences for other scrolling behaviors. It was also reported in the original bug that scrolling was no longer broken once you scrolled within the container for a bit (i.e. if you scrolled down away from the edge and then scrolled back up against the edge, the problem would not occur). I found out that this is due to the current implementation of ScrollAnimatorMac::immediateScrollByWithoutContentEdgeConstraints for overflow scrolling, which calls m_scrollableArea.setConstrainsScrollingToContentEdge(true) regardless of whether or not the ScrollableArea previously constrained scrolling to content edges. I'm not sure whether this is intended behavior. TL;DR The bug seems to be caused by the value of constrainsScrollingToContentEdge() in ScrollAnimatorMac::adjustScrollPositionIfNecessary.
Wenson Hsieh
Comment 7 2015-07-09 11:32:31 PDT
Wenson Hsieh
Comment 8 2015-07-09 13:18:24 PDT
Beth Dakin
Comment 9 2015-07-09 13:19:21 PDT
Comment on attachment 256503 [details] Patch Looks good!
Build Bot
Comment 10 2015-07-09 13:52:59 PDT
Comment on attachment 256503 [details] Patch Attachment 256503 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/5744092755525632 New failing tests: fast/html/marquee-scroll.html fast/block/float/marquee-shrink-to-avoid-floats.html fast/html/marquee-scrollamount.html fast/inline-block/003.html
Build Bot
Comment 11 2015-07-09 13:53:02 PDT
Created attachment 256510 [details] Archive of layout-test-results from ews100 for mac-mavericks The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews100 Port: mac-mavericks Platform: Mac OS X 10.9.5
Build Bot
Comment 12 2015-07-09 13:54:16 PDT
Comment on attachment 256503 [details] Patch Attachment 256503 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/5514735059468288 New failing tests: fast/html/marquee-scroll.html fast/block/float/marquee-shrink-to-avoid-floats.html fast/html/marquee-scrollamount.html fast/inline-block/003.html
Build Bot
Comment 13 2015-07-09 13:54:19 PDT
Created attachment 256511 [details] Archive of layout-test-results from ews104 for mac-mavericks-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews104 Port: mac-mavericks-wk2 Platform: Mac OS X 10.9.5
Wenson Hsieh
Comment 14 2015-07-09 14:18:23 PDT
WebKit Commit Bot
Comment 15 2015-07-09 16:03:47 PDT
Comment on attachment 256519 [details] Patch Clearing flags on attachment: 256519 Committed r186644: <http://trac.webkit.org/changeset/186644>
WebKit Commit Bot
Comment 16 2015-07-09 16:03:53 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.