Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Issue 16114003: Don't send touch move to renderer while scrolling (Closed)

Created:
7 years, 6 months ago by Yufeng Shen (Slow to review)
Modified:
7 years, 2 months ago
CC:
chromium-reviews, nkostylev+watch_chromium.org, jam, penghuang+watch_chromium.org, joi+watch-content_chromium.org, nona+watch_chromium.org, darin-cc_chromium.org, oshima+watch_chromium.org, James Su, stevenjb+watch_chromium.org, davemoore+watch_chromium.org, yusukes+watch_chromium.org
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Don't send touch move to renderer while scrolling This patch tries to optimize this case: A scrollable webpage has a touch handler listening to touch move but does not prevent-default on touch move. When the touch handler does not call prevent default on touch move, the touch move events will come back to browser process and can generate scroll events. While the page is scrolled, we want to stop sending the touch move events to the touch handler, trying to avoid the scrolling being blocked on waiting for each touch move to be ACKed from renderer. We will still send any touch end events to the page. BUG=240735, 251810 TEST=1. enable the flag #enable-no-touch-to-renderer-while-scrolling in chrome://flags 2. go to www.rbyers.net/eventTest.html scroll the page, one should see touch move stops being received when scroll stops, one should see touch end to all existing touches 3. go to www.rbyers.net/janky-touch-scroll.html scroll the page and one should see smooth scrolling Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=217454

Patch Set 1 #

Total comments: 16

Patch Set 2 : moved logic to render_widget_host_impl.cc #

Patch Set 3 : rebased #

Patch Set 4 : fix the case touch event queue could be empty when GetLatestEvent() is called #

Total comments: 8

Patch Set 5 : fix unitttests #

Patch Set 6 : rebase/switch to model of "no-touch-while-scrolling & touch-end after scrolling stops" #

Total comments: 8

Patch Set 7 : use TEQ::ShouldForwardToRenderer() instead of ImmediateInputRouter::ShouldForwardTouchEvent() to de… #

Patch Set 8 : tests added #

Total comments: 4

Patch Set 9 : use ScrollBegin instead of ScrollUpdate as the indication of stop sending touch move & rebase #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+161 lines, -1 line) Patch
M chrome/app/generated_resources.grd View 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/about_flags.cc View 1 2 3 4 5 6 7 8 1 chunk +9 lines, -0 lines 0 comments Download
M content/browser/renderer_host/input/immediate_input_router.h View 1 2 3 4 5 6 7 8 3 chunks +9 lines, -0 lines 0 comments Download
M content/browser/renderer_host/input/immediate_input_router.cc View 1 2 3 4 5 6 7 8 4 chunks +20 lines, -0 lines 0 comments Download
M content/browser/renderer_host/input/immediate_input_router_unittest.cc View 1 2 3 4 5 6 7 8 2 chunks +97 lines, -0 lines 0 comments Download
M content/browser/renderer_host/input/touch_event_queue.h View 1 2 3 4 5 6 7 8 2 chunks +9 lines, -0 lines 0 comments Download
M content/browser/renderer_host/input/touch_event_queue.cc View 1 2 3 4 5 6 7 8 2 chunks +6 lines, -1 line 0 comments Download
M content/public/common/content_switches.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 1 comment Download
M content/public/common/content_switches.cc View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -0 lines 1 comment Download

Messages

Total messages: 35 (0 generated)
Yufeng Shen (Slow to review)
7 years, 6 months ago (2013-05-27 19:31:41 UTC) #1
Rick Byers
A couple drive-by comments while you and Sadrul work to figure out how best to ...
7 years, 6 months ago (2013-05-30 01:53:29 UTC) #2
sadrul
https://codereview.chromium.org/16114003/diff/1/chrome/browser/about_flags.cc File chrome/browser/about_flags.cc (right): https://codereview.chromium.org/16114003/diff/1/chrome/browser/about_flags.cc#newcode1265 chrome/browser/about_flags.cc:1265: ENABLE_DISABLE_VALUE_TYPE(switches::kEnableTouchCancelAfterScroll, Use ENABLE_DISABLE_VALUE_TYPE_AND_VALUE( kTouchCancelAfterScroll, "1", ..., "0") https://codereview.chromium.org/16114003/diff/1/content/browser/renderer_host/render_widget_host_view_aura.cc File ...
7 years, 6 months ago (2013-05-30 02:44:16 UTC) #3
Yufeng Shen (Slow to review)
https://codereview.chromium.org/16114003/diff/1/chrome/app/generated_resources.grd File chrome/app/generated_resources.grd (right): https://codereview.chromium.org/16114003/diff/1/chrome/app/generated_resources.grd#newcode6549 chrome/app/generated_resources.grd:6549: + <message name="IDS_FLAGS_ENABLE_TOUCH_CANCEL_AFTER_SCROLL_NAME" desc="Name of the flag that enables ...
7 years, 6 months ago (2013-05-30 22:34:37 UTC) #4
Yufeng Shen (Slow to review)
Ping.
7 years, 6 months ago (2013-06-03 18:51:40 UTC) #5
Yufeng Shen (Slow to review)
On 2013/06/03 18:51:40, Yufeng Shen wrote: > Ping. hey Sadrul, can you take a look ...
7 years, 6 months ago (2013-06-17 19:50:17 UTC) #6
Yufeng Shen (Slow to review)
rebased PTAL. Thanks.
7 years, 6 months ago (2013-06-19 17:26:35 UTC) #7
Yufeng Shen (Slow to review)
Fix the case touch event queue could be empty when calling GetLatestEvent().
7 years, 6 months ago (2013-06-19 20:14:53 UTC) #8
sadrul
/cc jdduke@ as an FYI https://codereview.chromium.org/16114003/diff/18002/content/browser/renderer_host/render_widget_host_impl.cc File content/browser/renderer_host/render_widget_host_impl.cc (right): https://codereview.chromium.org/16114003/diff/18002/content/browser/renderer_host/render_widget_host_impl.cc#newcode1073 content/browser/renderer_host/render_widget_host_impl.cc:1073: if (gesture_event.type == WebInputEvent::GestureScrollUpdate ...
7 years, 6 months ago (2013-06-20 08:51:27 UTC) #9
aelias_OOO_until_Jul13
This change seems complicated/potentially bug-prone and I think we should stop making major changes to ...
7 years, 6 months ago (2013-06-20 17:52:30 UTC) #10
Yufeng Shen (Slow to review)
https://codereview.chromium.org/16114003/diff/18002/content/browser/renderer_host/render_widget_host_impl.cc File content/browser/renderer_host/render_widget_host_impl.cc (right): https://codereview.chromium.org/16114003/diff/18002/content/browser/renderer_host/render_widget_host_impl.cc#newcode1073 content/browser/renderer_host/render_widget_host_impl.cc:1073: if (gesture_event.type == WebInputEvent::GestureScrollUpdate && On 2013/06/20 08:51:27, sadrul ...
7 years, 6 months ago (2013-06-20 17:56:44 UTC) #11
Yufeng Shen (Slow to review)
On 2013/06/20 17:52:30, aelias wrote: > This change seems complicated/potentially bug-prone and I think we ...
7 years, 6 months ago (2013-06-20 18:06:25 UTC) #12
aelias_OOO_until_Jul13
OK, thanks for the explanation. Fine by me then because it's behind a flag.
7 years, 6 months ago (2013-06-20 18:37:47 UTC) #13
Yufeng Shen (Slow to review)
Hey Sadrul: do you have more comments ?
7 years, 6 months ago (2013-06-21 17:44:19 UTC) #14
jdduke (slow)
On 2013/06/21 17:44:19, Yufeng Shen wrote: > Hey Sadrul: do you have more comments ? ...
7 years, 6 months ago (2013-06-21 18:07:05 UTC) #15
Rick Byers
On 2013/06/21 18:07:05, jdduke wrote: > On 2013/06/21 17:44:19, Yufeng Shen wrote: > > Hey ...
7 years, 6 months ago (2013-06-21 18:18:11 UTC) #16
Yufeng Shen (Slow to review)
Now that jdduke@'s refactor has landed, I would like to revive this CL. And based ...
7 years, 4 months ago (2013-08-06 17:39:24 UTC) #17
sadrul
https://codereview.chromium.org/16114003/diff/42001/content/browser/renderer_host/input/immediate_input_router.cc File content/browser/renderer_host/input/immediate_input_router.cc (right): https://codereview.chromium.org/16114003/diff/42001/content/browser/renderer_host/input/immediate_input_router.cc#newcode562 content/browser/renderer_host/input/immediate_input_router.cc:562: switches::kNoTouchToRendererWhileScrolling) == "1") { Can you use a static ...
7 years, 4 months ago (2013-08-06 19:34:19 UTC) #18
jdduke (slow)
I know this is behind a flag, but it's not really clear to me if ...
7 years, 4 months ago (2013-08-07 00:15:52 UTC) #19
sadrul
On 2013/08/07 00:15:52, jdduke wrote: > I know this is behind a flag, but it's ...
7 years, 4 months ago (2013-08-07 02:30:01 UTC) #20
Rick Byers
https://chromiumcodereview.appspot.com/16114003/diff/42001/content/browser/renderer_host/input/immediate_input_router.cc File content/browser/renderer_host/input/immediate_input_router.cc (right): https://chromiumcodereview.appspot.com/16114003/diff/42001/content/browser/renderer_host/input/immediate_input_router.cc#newcode279 content/browser/renderer_host/input/immediate_input_router.cc:279: !no_touch_to_renderer_while_scrolling_; This will queue the event rather than discard ...
7 years, 4 months ago (2013-08-07 14:01:32 UTC) #21
jdduke (slow)
On 2013/08/07 14:01:32, Rick Byers wrote: > https://chromiumcodereview.appspot.com/16114003/diff/42001/content/browser/renderer_host/input/immediate_input_router.cc > File content/browser/renderer_host/input/immediate_input_router.cc (right): > > https://chromiumcodereview.appspot.com/16114003/diff/42001/content/browser/renderer_host/input/immediate_input_router.cc#newcode279 ...
7 years, 4 months ago (2013-08-07 14:31:01 UTC) #22
Rick Byers
On 2013/08/07 14:31:01, jdduke wrote: > On 2013/08/07 14:01:32, Rick Byers wrote: > > > ...
7 years, 4 months ago (2013-08-07 15:03:09 UTC) #23
Yufeng Shen (Slow to review)
I realized that many of the complication of the previous patch arises from using ImmediateInputRouter::ShouldForwardTouchEvent() ...
7 years, 4 months ago (2013-08-07 21:18:41 UTC) #24
sadrul
I think this looks pretty good. I will do a detailed review on Friday (I ...
7 years, 4 months ago (2013-08-08 08:46:42 UTC) #25
Yufeng Shen (Slow to review)
tests added.
7 years, 4 months ago (2013-08-08 20:17:00 UTC) #26
Yufeng Shen (Slow to review)
Ping.
7 years, 4 months ago (2013-08-13 16:26:24 UTC) #27
sadrul
LGTM https://codereview.chromium.org/16114003/diff/64001/content/browser/renderer_host/input/immediate_input_router.cc File content/browser/renderer_host/input/immediate_input_router.cc (right): https://codereview.chromium.org/16114003/diff/64001/content/browser/renderer_host/input/immediate_input_router.cc#newcode563 content/browser/renderer_host/input/immediate_input_router.cc:563: if (gesture_event.event.type == WebInputEvent::GestureScrollUpdate) Please consider using GestureScrollBegin ...
7 years, 4 months ago (2013-08-13 19:40:03 UTC) #28
Yufeng Shen (Slow to review)
offline talk to jddkue@ and he has no objection to this CL. + joi@ for ...
7 years, 4 months ago (2013-08-13 20:17:27 UTC) #29
Jói
//content/public/common LGTM.
7 years, 4 months ago (2013-08-13 21:54:42 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/miletus@chromium.org/16114003/75001
7 years, 4 months ago (2013-08-13 22:10:18 UTC) #31
commit-bot: I haz the power
Retried try job too often on linux_rel for step(s) check_deps http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_rel&number=158927
7 years, 4 months ago (2013-08-14 00:20:53 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/miletus@chromium.org/16114003/75001
7 years, 4 months ago (2013-08-14 01:29:33 UTC) #33
commit-bot: I haz the power
Change committed as 217454
7 years, 4 months ago (2013-08-14 02:37:23 UTC) #34
jam
7 years, 4 months ago (2013-08-25 13:06:40 UTC) #35
Message was sent while issue was closed.
https://chromiumcodereview.appspot.com/16114003/diff/75001/content/public/com...
File content/public/common/content_switches.cc (right):

https://chromiumcodereview.appspot.com/16114003/diff/75001/content/public/com...
content/public/common/content_switches.cc:786: const char
kNoTouchToRendererWhileScrolling[] =
here too

https://chromiumcodereview.appspot.com/16114003/diff/75001/content/public/com...
File content/public/common/content_switches.h (right):

https://chromiumcodereview.appspot.com/16114003/diff/75001/content/public/com...
content/public/common/content_switches.h:227: CONTENT_EXPORT extern const char
kNoTouchToRendererWhileScrolling[];
nit: this file is ordered, please follow that

Powered by Google App Engine
This is Rietveld 408576698