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

Issue 338543003: Gesture event hit test refactoring and reduction (Closed)

Created:
6 years, 6 months ago by Rick Byers
Modified:
6 years, 5 months ago
CC:
blink-reviews, blink-reviews-dom_chromium.org, blink-reviews-events_chromium.org, blink-reviews-rendering, chrishtr, dglazkov+blink, eae+blinkwatch, jchaffraix+rendering, leviw+renderwatch, pdr., rwlbuis, rune+blink, sof, zoltan1
Visibility:
Public.

Description

Gesture event hit test refactoring and reduction This CL reduces the number of hit tests in trivial tap scenarios from 15 to 9. Later CLs will push GestureEventWithHitTestResults up to WebViewImpl, down to synthetic mouse events, and attempt to share hit test results across some event types (further reducing from 9 down to 2 or 3). GestureEvents fall into two categories that are handled very differently today for hit-testing purposes: scroll events and non-scroll events. Scroll events do per-frame hit-tests and propagate across EventHandler instances from the outer-most frame to the inner-most (because they may do some work for scroll bubbling at each frame). Non-scroll events do a global hit-test and jump directly to the inner most frame. Make this confusing distinction more explicit. Then consolidate non-scroll GestureEvent hit-tests in blink core into a single method: EventHandler::targetGestureEvent which returns a new GestureEventWithHitTestResults type. Pass these "targeted events" around blink instead of doing repeated hit tests. Eliminate duplicate frame tree walk on most gesture hit tests. Previously we'd do an initial hit test to find the right subframe and EventHandler instance, then use EventHandler::hitTestResultAtPoint to hit test from the main frame again all the way down. This CL should not have any noticeable web-exposed behavior changes, but it paves the road for future optimizations which will. Mutate HitTestResult to make it reflect the results of touch adjustment (effectively converting a rect-based test result to a point-based result somewhere inside that rect). This makes it possible to use the same code for gestures that do and don't do adjustment, avoids passing around extra data, and makes bugs with using unadjusted points less likely. Update touch- adjustment entry points to take a HitTestResult instead of a point (which we'd then need to hit-test against again). Touch adjustment tests still need to do hit tests here though. Remove unused 'baseEventType' hack (synthetic mouse events have carried a 'from touch' bit for awhile now that probably supercedes whatever this was being used for). Fix a bug with resize handle behavior in iframes not being consistent with other resize handle behavior. Includes a trivial tweak to FROM_HERE macro to be explicit about namespace usage since it can be used both within and outside of WebCore namespace contexts. This makes eclipse happy. Fix WebViewImpl::handleInputEvent trace logging of event name. BUG=381728 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=177164

Patch Set 1 #

Patch Set 2 : Working but not yet passing all tests #

Patch Set 3 : Fix test failures #

Patch Set 4 : Rework to fix a number of edge cases #

Patch Set 5 : Cleanups #

Patch Set 6 : Add expected test results #

Patch Set 7 : Merge with trunk and include hit-test-count test results #

Patch Set 8 : Remove aborted perf test (too noisy) #

Total comments: 2

Patch Set 9 : zeeshanq CR feedback #

Patch Set 10 : Merge with trunk #

Total comments: 24

Patch Set 11 : Merge with trunk (no changes) #

Patch Set 12 : Esprehn CR feedback #

Total comments: 1

Patch Set 13 : Fix release build #

Unified diffs Side-by-side diffs Delta from patch set Stats (+444 lines, -341 lines) Patch
M LayoutTests/compositing/gestures/gesture-tapHighlight-simple-cancel.html View 1 2 3 1 chunk +9 lines, -0 lines 0 comments Download
M LayoutTests/compositing/gestures/gesture-tapHighlight-simple-cancel-expected.html View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M LayoutTests/fast/css/resize-corner-tracking-touch.html View 1 2 3 2 chunks +2 lines, -3 lines 0 comments Download
M LayoutTests/fast/events/hit-test-counts-expected.txt View 1 2 3 4 5 6 7 8 3 chunks +15 lines, -15 lines 0 comments Download
M LayoutTests/touchadjustment/rotated-node.html View 1 2 3 1 chunk +3 lines, -1 line 0 comments Download
M LayoutTests/touchadjustment/rotated-node-expected.txt View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/core/core.gypi View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -2 lines 0 comments Download
M Source/core/dom/Document.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +3 lines, -1 line 0 comments Download
M Source/core/dom/Document.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M Source/core/page/EventHandler.h View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +31 lines, -17 lines 0 comments Download
M Source/core/page/EventHandler.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 21 chunks +226 lines, -161 lines 0 comments Download
A + Source/core/page/EventWithHitTestResults.h View 1 2 3 4 1 chunk +20 lines, -8 lines 0 comments Download
D Source/core/page/MouseEventWithHitTestResults.h View 1 2 3 1 chunk +0 lines, -51 lines 0 comments Download
M Source/core/page/MouseEventWithHitTestResults.cpp View 1 1 chunk +0 lines, -40 lines 0 comments Download
M Source/core/rendering/HitTestLocation.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/rendering/HitTestLocation.cpp View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M Source/core/rendering/HitTestResult.h View 1 2 3 4 5 6 2 chunks +4 lines, -0 lines 0 comments Download
M Source/core/rendering/HitTestResult.cpp View 1 2 3 4 5 6 1 chunk +11 lines, -0 lines 0 comments Download
M Source/core/testing/Internals.cpp View 1 2 3 4 5 6 7 8 5 chunks +23 lines, -4 lines 0 comments Download
M Source/platform/PlatformGestureEvent.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +45 lines, -7 lines 0 comments Download
M Source/platform/TraceLocation.h View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
M Source/web/WebViewImpl.cpp View 1 2 3 4 5 6 7 8 9 10 5 chunks +37 lines, -27 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
Rick Byers
Zeeshan, Can you please take an initial look at this? I'm still working on adding ...
6 years, 6 months ago (2014-06-19 16:20:41 UTC) #1
Rick Byers
I've updated this to be built on the new test I'm adding in https://codereview.chromium.org/354613002/ so ...
6 years, 6 months ago (2014-06-25 17:58:07 UTC) #2
Zeeshan Qureshi
lgtm https://codereview.chromium.org/338543003/diff/140001/Source/core/page/EventHandler.cpp File Source/core/page/EventHandler.cpp (right): https://codereview.chromium.org/338543003/diff/140001/Source/core/page/EventHandler.cpp#newcode2072 Source/core/page/EventHandler.cpp:2072: return handleScrollGestureEvent(gestureEvent); nit: handleGestureScrollEvent has a better ring ...
6 years, 6 months ago (2014-06-25 23:27:41 UTC) #3
Rick Byers
Thanks Zeeshan. +esprehn for OWNERS in Source/platform/ and Source/web/, plus whatever other feedback you'd like ...
6 years, 6 months ago (2014-06-26 17:32:22 UTC) #4
esprehn
Bunch of random nits, but overall this lgtm. It'd be nice if you'd wrap your ...
6 years, 5 months ago (2014-06-27 08:33:58 UTC) #5
Rick Byers
Thanks Elliott. Let me know if you want to look at the changes before I ...
6 years, 5 months ago (2014-06-27 15:38:24 UTC) #6
Rick Byers
The CQ bit was checked by rbyers@chromium.org
6 years, 5 months ago (2014-06-28 03:32:10 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rbyers@chromium.org/338543003/240001
6 years, 5 months ago (2014-06-28 03:32:28 UTC) #8
commit-bot: I haz the power
Change committed as 177164
6 years, 5 months ago (2014-06-28 04:04:23 UTC) #9
sof
The assert in EventHandler::handleGestureEvent(const PlatformGestureEvent& gestureEvent) crashes 3 Mac & Windows plugin tests -- http://test-results.appspot.com/dashboards/flakiness_dashboard.html#group=%40ToT%20Blink&tests=plugins/gesture-events-scrolled.html,plugins/gesture-events.html,plugins/transformed-events.html
6 years, 5 months ago (2014-06-29 07:12:19 UTC) #10
Rick Byers
6 years, 5 months ago (2014-06-29 20:28:41 UTC) #11
Message was sent while issue was closed.
On 2014/06/29 07:12:19, sof wrote:
> The assert in EventHandler::handleGestureEvent(const PlatformGestureEvent&
> gestureEvent) crashes 3 Mac & Windows plugin tests -- 
> 
> 
>
http://test-results.appspot.com/dashboards/flakiness_dashboard.html#group=%40...

Shoot, thanks for tracking this back.  I've filed
https://code.google.com/p/chromium/issues/detail?id=390032 to track and I should
have a fix up for review today.

Powered by Google App Engine
This is Rietveld 408576698