RESOLVED FIXED 136029
[Mac] Gesture scrolls don't work in the WebKit1 clients after scrolling a non-scrollable iFrame
https://bugs.webkit.org/show_bug.cgi?id=136029
Summary [Mac] Gesture scrolls don't work in the WebKit1 clients after scrolling a non...
Brent Fulgham
Reported 2014-08-17 14:02:03 PDT
Testing with various WebKit1 clients after my change for Iframe scroll gestures has revealed an edge case: Under the following conditions: 1. A Cocoa application embeds a WebView using WK1. 2. The webview consists of an Iframe. 3. The Iframe size is the same as the WebView, so that there is no scrollable region. If the user performs a scroll wheel gesture on the web view, other scrollable portions of the user interface become "locked up".
Attachments
Patch (4.82 KB, patch)
2014-08-17 14:12 PDT, Brent Fulgham
mjs: review+
Brent Fulgham
Comment 1 2014-08-17 14:03:05 PDT
Brent Fulgham
Comment 2 2014-08-17 14:05:01 PDT
Analysis indicates that WebKit is issuing two scrollWheel events during the handling of this gesture. The two events are intercepted at the OS level and result in some undesirable side effects that end up locking the view. It looks like the nuance I missed in my earlier work was that although we bail out early when interacting with IFrames in the general case (under WK1), when we pass through the EventHandler::passWheelEventToWidget for an IFrame we actually DO dispatch the 'scrollWheel' event to the NSScrollView backing the IFrame. This seems to set up the multiple-scrollWheel event condition found in Dictionary.app. I think the correct fix is to recognize a WK1 case where the widget to which we just passed the wheel event is an frame view (IFrame), to not dispatch a second scrollWheel event by returning 'true' in this case.
Brent Fulgham
Comment 3 2014-08-17 14:12:46 PDT
Sam Weinig
Comment 4 2014-08-17 14:27:18 PDT
Since this depends on host application logic, it might be a good candidate for a TestWebKitAPI test.
Maciej Stachowiak
Comment 5 2014-08-17 23:35:09 PDT
Comment on attachment 236736 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=236736&action=review > Source/WebCore/page/mac/EventHandlerMac.mm:923 > + // If the platform widget is a frame view (IFrame), and we are in WebKit1, 'passWheelEventToWidget' has already > + // called 'scrollWheel' on the underlying platform widget. We need to return true in this case to avoid getting > + // multiple copies of the scrollWheel event sent to the platform widget. IS such a long comment really necessary? I'd suggest no comment, or a one-liner stating the reason.
Brent Fulgham
Comment 6 2014-08-18 08:54:34 PDT
Brent Fulgham
Comment 7 2014-08-18 08:55:08 PDT
(In reply to comment #5) > (From update of attachment 236736 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=236736&action=review > > > Source/WebCore/page/mac/EventHandlerMac.mm:923 > > + // If the platform widget is a frame view (IFrame), and we are in WebKit1, 'passWheelEventToWidget' has already > > + // called 'scrollWheel' on the underlying platform widget. We need to return true in this case to avoid getting > > + // multiple copies of the scrollWheel event sent to the platform widget. > > IS such a long comment really necessary? I'd suggest no comment, or a one-liner stating the reason. OK! Fixed while landing.
Brent Fulgham
Comment 8 2014-08-18 08:55:36 PDT
See Bug 136040 for work on creating a TestWebKitAPI test for this condition.
Darin Adler
Comment 9 2014-08-18 09:32:50 PDT
Comment on attachment 236736 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=236736&action=review > Source/WebCore/page/EventHandler.cpp:2658 > +bool EventHandler::platformCompletePlatformWidgetWheelEvent(const PlatformWheelEvent&, const Widget*, ContainerNode*) Since this can never be null, it should be a Widget& rather than a Widget*.
Brent Fulgham
Comment 10 2014-08-18 09:37:42 PDT
Comment on attachment 236736 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=236736&action=review >> Source/WebCore/page/EventHandler.cpp:2658 >> +bool EventHandler::platformCompletePlatformWidgetWheelEvent(const PlatformWheelEvent&, const Widget*, ContainerNode*) > > Since this can never be null, it should be a Widget& rather than a Widget*. Good point! I'll land this as a follow-up patch.
Brent Fulgham
Comment 11 2014-08-18 09:52:05 PDT
Added Darin's suggested clean-up: Committed r172705: <http://trac.webkit.org/changeset/172705>
Brent Fulgham
Comment 12 2014-08-18 13:42:53 PDT
Correct a bad merge from my last change: Committed in r172720. <http://trac.webkit.org/changeset/172720>
Note You need to log in before you can comment on or make changes to this bug.