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

Issue 130433009: Lock element at start of gesture sequence. (Closed)

Created:
6 years, 11 months ago by Zeeshan Qureshi
Modified:
6 years, 5 months ago
Reviewers:
Rick Byers
CC:
blink-reviews, dglazkov+blink, eae+blinkwatch, tdresser
Visibility:
Public.

Description

Lock element at start of gesture sequence. Currently a separate hit test is performed for every gesture event and because of touch fuzzing, a show press can land on a separate element than a tap down. This change locks the gesture sequence to the element hit on tap down until another tap down / scroll. BUG=226842

Patch Set 1 #

Patch Set 2 : Add test #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+31 lines, -1 line) Patch
M LayoutTests/fast/events/touch/gesture/gesture-tap-active-state.html View 1 1 chunk +9 lines, -0 lines 0 comments Download
M LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-expected.txt View 1 1 chunk +5 lines, -0 lines 0 comments Download
M Source/core/page/EventHandler.h View 1 1 chunk +1 line, -0 lines 1 comment Download
M Source/core/page/EventHandler.cpp View 1 3 chunks +16 lines, -1 line 2 comments Download

Messages

Total messages: 2 (0 generated)
Zeeshan Qureshi
6 years, 10 months ago (2014-02-20 23:14:01 UTC) #1
Rick Byers
6 years, 10 months ago (2014-02-21 03:46:54 UTC) #2
Unfortunately I think getting this right is going to be a little more involved
:-(  (unless I'm missing something).

https://codereview.chromium.org/130433009/diff/50001/Source/core/page/EventHa...
File Source/core/page/EventHandler.cpp (right):

https://codereview.chromium.org/130433009/diff/50001/Source/core/page/EventHa...
Source/core/page/EventHandler.cpp:2311: Element* gestureElement =
m_elementHandlingGestureSequence.get();
I don't think this handles all the cases (or even the most likely cases).  Eg.
what if tapDown causes a new element to appear over top of the element.  I think
we decided we want the tap to still go to the original (i.e. highlighted)
element, even though a hit test at it's co-ordinates would now reach the element
on top.

So I think you need to find a way to skip the hit test entirely and used the
cached element.

https://codereview.chromium.org/130433009/diff/50001/Source/core/page/EventHa...
Source/core/page/EventHandler.cpp:2321: m_elementHandlingGestureSequence =
result.innerElement();
you probably don't want to hold on to this indefinitely (could keep an expensive
tree of objects alive for a long time), but it's not obvious to know when to
release it.  The simple case is on Tap and GestureScrollEnd, but I think there
are some more subtle cases (eg. multi-finger swipe).

Perhaps you should just treat a tap sequence (TapDown...Tap/TapCancel) and a
scroll sequence (ScrollBegin...ScrollEnd) as independent sequences.  I guess
this boils down to how we want things to behave if ShowPress triggers a
scrollable element to appear on top - does pressing then scrolling scroll the
new element or the background one?  It would be valuable to know the behavior of
different browsers here.

Worst case we could add a GestureEnd.

https://codereview.chromium.org/130433009/diff/50001/Source/core/page/EventHa...
File Source/core/page/EventHandler.h (right):

https://codereview.chromium.org/130433009/diff/50001/Source/core/page/EventHa...
Source/core/page/EventHandler.h:380: RefPtr<Node> m_scrollGestureHandlingNode;
can we merge this in with your more general mechanism?

Powered by Google App Engine
This is Rietveld 408576698