RESOLVED FIXED 158601
Add support for passive event listeners on touch events
https://bugs.webkit.org/show_bug.cgi?id=158601
Summary Add support for passive event listeners on touch events
Benjamin Poulain
Reported 2016-06-09 20:00:35 PDT
Add support for passive event listeners on touch events
Attachments
Patch (77.15 KB, patch)
2016-06-09 20:17 PDT, Benjamin Poulain
no flags
Archive of layout-test-results from ews104 for mac-yosemite-wk2 (1.05 MB, application/zip)
2016-06-09 21:20 PDT, Build Bot
no flags
Patch (82.76 KB, patch)
2016-06-10 14:01 PDT, Benjamin Poulain
no flags
Benjamin Poulain
Comment 1 2016-06-09 20:17:27 PDT
WebKit Commit Bot
Comment 2 2016-06-09 20:28:21 PDT
Attachment 280982 [details] did not pass style-queue: ERROR: Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:488: This { should be at the end of the previous line [whitespace/braces] [4] Total errors found: 1 in 39 files If any of these errors are false positives, please file a bug against check-webkit-style.
Chris Dumez
Comment 3 2016-06-09 20:36:10 PDT
\o/
Build Bot
Comment 4 2016-06-09 21:20:26 PDT
Comment on attachment 280982 [details] Patch Attachment 280982 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/1476207 New failing tests: tiled-drawing/scrolling/frames/scroll-region-after-frame-layout.html tiled-drawing/scrolling/frames/coordinated-frame.html tiled-drawing/scrolling/frames/coordinated-frame-lose-scrolling-ancestor.html tiled-drawing/scrolling/frames/coordinated-frame-in-fixed.html tiled-drawing/scrolling/fixed/fixed-in-overflow.html tiled-drawing/scrolling/frames/coordinated-frame-gain-scrolling-ancestor.html
Build Bot
Comment 5 2016-06-09 21:20:30 PDT
Created attachment 280987 [details] Archive of layout-test-results from ews104 for mac-yosemite-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews104 Port: mac-yosemite-wk2 Platform: Mac OS X 10.10.5
Benjamin Poulain
Comment 6 2016-06-09 21:37:27 PDT
I'll check the WK2 tests tomorrow. Piano tonight.
Rick Byers
Comment 7 2016-06-10 07:11:21 PDT
This is awesome, thanks for working on it Ben! One suggestion. It looks like you're treating all touch event types the same, right? One common scenario is to have passive touchstart and touchmove listeners but a non-passive touchend listener (so you can still prevent the generation of mouse/click events and associated behavior - eg. as is common today with fastclick libraries as much I want those to disappear). In blink we were careful to ensure that case still didn't block scrolling (http://crbug.com/601990). You can see this at http://rbyers.net/scroll-latency.html - set the listener to touchend, enable showing non-blocking events, and tap. You'll get an uncancelable touchstart but a cancelable touchend event. Basically we treat touchstart, touchmove and wheel/mousewheel specially as the only "scroll blocking events". That's just a performance optimization so I don't think interoperability here matters much (although maybe it would be nice to spec the precise behavior here and add some web-platform-tests if we end up matching). But figured I'd mention it in case it matters to you.
Simon Fraser (smfr)
Comment 8 2016-06-10 10:03:06 PDT
Comment on attachment 280982 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=280982&action=review > Source/WebCore/ChangeLog:32 > + If a Target has multiple listener for an event type, we want to know listeners > Source/WebCore/dom/EventTarget.cpp:252 > + return hasActiveEventListeners(names.touchstartEvent) > + || hasActiveEventListeners(names.touchmoveEvent) > + || hasActiveEventListeners(names.touchendEvent) > + || hasActiveEventListeners(names.touchcancelEvent) > + || hasActiveEventListeners(names.touchforcechangeEvent); Maybe adjust this given Rick's comment. > Source/WebCore/page/DebugPageOverlays.cpp:137 > + if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator()) { > + EventTrackingRegions eventTrackingRegions = scrollingCoordinator->absoluteEventTrackingRegions(); > + *region = eventTrackingRegions.synchronousDispatchRegion; > + } We could fix the overlay to show both regions. > Source/WebKit2/UIProcess/WebPageProxy.cpp:1994 > + // But, here we know that every events handlers that can handle this events are passive. "every events handlers" -> "all events handlers"
Benjamin Poulain
Comment 9 2016-06-10 11:43:15 PDT
(In reply to comment #7) > One suggestion. It looks like you're treating all touch event types the > same, right? One common scenario is to have passive touchstart and > touchmove listeners but a non-passive touchend listener (so you can still > prevent the generation of mouse/click events and associated behavior - eg. > as is common today with fastclick libraries as much I want those to > disappear). In blink we were careful to ensure that case still didn't block > scrolling (http://crbug.com/601990). You can see this at > http://rbyers.net/scroll-latency.html - set the listener to touchend, enable > showing non-blocking events, and tap. You'll get an uncancelable touchstart > but a cancelable touchend event. Basically we treat touchstart, touchmove > and wheel/mousewheel specially as the only "scroll blocking events". That's a very good point.
Benjamin Poulain
Comment 10 2016-06-10 14:01:20 PDT
WebKit Commit Bot
Comment 11 2016-06-10 14:03:29 PDT
Attachment 281044 [details] did not pass style-queue: ERROR: Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:488: This { should be at the end of the previous line [whitespace/braces] [4] Total errors found: 1 in 47 files If any of these errors are false positives, please file a bug against check-webkit-style.
Benjamin Poulain
Comment 12 2016-06-10 18:17:06 PDT
Comment on attachment 281044 [details] Patch Clearing flags on attachment: 281044 Committed r201958: <http://trac.webkit.org/changeset/201958>
Benjamin Poulain
Comment 13 2016-06-10 18:17:11 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.