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

Issue 259413003: Correctly handle touch events that contain touches not previously reported to blink (Closed)

Created:
6 years, 7 months ago by Rick Byers
Modified:
6 years, 7 months ago
CC:
blink-reviews, dglazkov+blink, eae+blinkwatch, ojan
Visibility:
Public.

Description

Handle touch events containing touches not previously reported to blink Chromium has a couple optimizations which suppress sending touch events to the renderer (for example, when they're at a place or time known not to contain touch event handlers). Our security fix in http://crbug.com/148567 assumed we'd always see every touchstart event, so if we got an event which had a point we'd never seen we'd effectively ignore the event completely. Touch events do their hit-test on touchstart, and every TouchEvent contains a touches array for all active touches. So if we're going to skip sending some touchstart events, we need to define how those active touch points show up in the events for other points. This problem is similar to how touches should show up for fingers that are down on iframes outside the bounds of the document receiving touch events. I think it's important that we include such touches (otherwise an app could mis-recognize a two-finger gesture as a single finger one), but their 'target' should be irrelevant since we know it wasn't capable of receiving the touch events. So here I just set the target to the document. This also updates the cross-iframe case, we were previously hiding such points completely. I've split the main loop across points into two stages (each with their own loop). First we do any necessary hit tests, including establishing the active touch sequence document if it wasn't previously determined. Then we create all the Touch objects, where we may rely on the active touch sequence document determined by some later point. This CL also contains a number of overdue cleanups to account for the fact that we now only need to hit-test on touchstart, and that there's only ever a single document receiving touch events at any time. Also rather than use a funky ID+1 key for our touch target HashMap, just use the ID but ensure HashMap supports 0-value keys by using UnsignedWithZeroKeyHashTraits. BUG=363321 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=173245

Patch Set 1 #

Total comments: 4

Patch Set 2 : rjkroege cr #

Unified diffs Side-by-side diffs Delta from patch set Stats (+334 lines, -120 lines) Patch
M LayoutTests/fast/events/touch/multi-touch-inside-iframes.html View 2 chunks +12 lines, -2 lines 0 comments Download
M LayoutTests/fast/events/touch/multi-touch-inside-iframes-expected.txt View 2 chunks +12 lines, -2 lines 0 comments Download
M LayoutTests/fast/events/touch/multi-touch-inside-nested-iframes.html View 1 chunk +8 lines, -2 lines 0 comments Download
M LayoutTests/fast/events/touch/multi-touch-inside-nested-iframes-expected.txt View 1 chunk +8 lines, -2 lines 0 comments Download
A LayoutTests/fast/events/touch/multi-touch-partial-sequence.html View 1 chunk +120 lines, -0 lines 0 comments Download
A LayoutTests/fast/events/touch/multi-touch-partial-sequence-expected.txt View 1 chunk +37 lines, -0 lines 0 comments Download
M Source/core/page/EventHandler.h View 1 2 chunks +8 lines, -4 lines 0 comments Download
M Source/core/page/EventHandler.cpp View 1 8 chunks +129 lines, -108 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
Rick Byers
Hey Zeeshan, Can you please do an initial code review for me before I ask ...
6 years, 7 months ago (2014-04-29 21:14:16 UTC) #1
Zeeshan Qureshi
LGTM An added thought, after some discussion with Tim it seems that the target frame ...
6 years, 7 months ago (2014-04-30 18:09:05 UTC) #2
Rick Byers
On 2014/04/30 18:09:05, Zeeshan Qureshi wrote: > LGTM Thanks. Adam, please take a look. > ...
6 years, 7 months ago (2014-05-01 02:59:02 UTC) #3
Zeeshan Qureshi
> Perhaps. But remember that we often won't send the touch events to blink at ...
6 years, 7 months ago (2014-05-01 03:07:20 UTC) #4
abarth-chromium
I'm a bit of a noob here. I'm happy to rubber-stamp lgtm this CL given ...
6 years, 7 months ago (2014-05-01 06:36:10 UTC) #5
Rick Byers
Thanks. +rjkroege just for another set of eyes from someone who has worked in this ...
6 years, 7 months ago (2014-05-01 12:59:28 UTC) #6
rjkroege
lgtm is it possible that handleTouchEvent should be refactored? It seems long/convoluted which suggests a ...
6 years, 7 months ago (2014-05-02 20:33:49 UTC) #7
Rick Byers
Thanks. > is it possible that handleTouchEvent should be refactored? It seems > long/convoluted which ...
6 years, 7 months ago (2014-05-02 21:24:15 UTC) #8
Rick Byers
The CQ bit was checked by rbyers@chromium.org
6 years, 7 months ago (2014-05-02 21:24:25 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rbyers@chromium.org/259413003/20001
6 years, 7 months ago (2014-05-02 21:24:35 UTC) #10
commit-bot: I haz the power
6 years, 7 months ago (2014-05-02 23:01:49 UTC) #11
Message was sent while issue was closed.
Change committed as 173245

Powered by Google App Engine
This is Rietveld 408576698