Summary: | REGRESSION: A page can be scrolled with touch when its body has style overflow-x:hidden or overflow-y:hidden | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Terry Anderson <tdanderson> | ||||||||||||||
Component: | Layout and Rendering | Assignee: | Terry Anderson <tdanderson> | ||||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||||
Severity: | Normal | CC: | allan.jensen, ap, buildbot, eric, ojan.autocc, rjkroege, rniwa, simon.fraser, webkit.review.bot | ||||||||||||||
Priority: | P2 | ||||||||||||||||
Version: | 528+ (Nightly build) | ||||||||||||||||
Hardware: | Unspecified | ||||||||||||||||
OS: | Unspecified | ||||||||||||||||
Bug Depends on: | 109769 | ||||||||||||||||
Bug Blocks: | |||||||||||||||||
Attachments: |
|
This page scrolls with trackpad on Mac. Behavior is different in Safari 6.0.2 and current WebKit build though. Created attachment 187497 [details]
WIP, not for review
Comment on attachment 187497 [details] WIP, not for review Attachment 187497 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://queues.webkit.org/results/16471981 New failing tests: fast/css/sticky/inline-sticky-abspos-child.html Created attachment 187592 [details]
WIP, not for review
Comment on attachment 187352 [details]
Example page to reproduce the bug in chromium
This page does not accurately reproduce the problem in chromium, please ignore.
Created attachment 187704 [details]
WIP, not for review
Created attachment 187897 [details]
Page to reproduce the bug. This scrolls with touch but does not scroll with mousewheels in chromium.
Created attachment 187930 [details]
Patch
Terry tells me this bug is all about making Gesture scrolling match wheel-event scrolling. Currently <div> with overflow hidden scroll: text-scroll: YES wheel: NO gesture: YES <body> with overflow hidden scroll: text-scroll: YES wheel: NO gesture: YES A few months back, before Terry moved the gesture scroll path off of wheel events gesture and wheel were the same in those above cases. The goal of this change is to make them match again. (In reply to comment #9) > Terry tells me this bug is all about making Gesture scrolling match wheel-event scrolling. > > Currently <div> with overflow hidden scroll: > text-scroll: YES > wheel: NO > gesture: YES Sorry, Terry tells me that bug 109087 fixed <div> scrolling for gesture to match wheel event, so that should be gesture: NO for <div> Also, to clarify "text scrolling" I mean selecting text and dragging outside of the scroll region. overflow:hidden should never be scrollable by the user (only programmatically). Comment on attachment 187930 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=187930&action=review > Source/WebCore/rendering/RenderLayer.cpp:2047 > + if (body && body->renderer() && body->hasTagName(bodyTag)) { document->body() always hasTagName(bodyTag) Comment on attachment 187930 [details]
Patch
OK. I spoke with Jamesr and we learned a few things.
1. Wheel events seem to scroll each direction separately, gestures may need to do the same if they aren't already.
2. This appears to be a programatic scroll path. You really want to be heading down the user-scroll paths instead. RenderBox::scroll/RenderLayer::scroll/ScrollableArea::scroll are the ones you want.
3. In the wheel-event case, scrolls are prevented for overflow: none by ScrollableArea::scroll detecting that it doesn't have a scrollbar in the direction you're asking it to scroll and bailing. Gestures should likely go down that same path.
After discussing the matter with Eric, it is clear that we should not even be using RenderLayer::scrollBy() to perform gesture scrolling. Switching code paths will fix this bug, among others. I have filed https://bugs.webkit.org/show_bug.cgi?id=109769 to track. This issue is resolved by http://trac.webkit.org/changeset/144519. |
Created attachment 187352 [details] Example page to reproduce the bug in chromium The attached page has style="overflow-y:hidden" on its body. It cannot be scrolled with mousewheels but can be scrolled with touch in chromium.