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

Issue 1055683003: (NOT FOR REVIEW) Distinguish between touch and touchmove handler presence (Closed)

Created:
5 years, 8 months ago by jdduke (slow)
Modified:
5 years, 2 months ago
Reviewers:
CC:
blink-reviews, dglazkov+blink, tyoshino+watch_chromium.org, Nate Chapin, gavinp+loader_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

(NOT FOR REVIEW) Distinguish between touch and touchmove handler presence Currently, the renderer communicates a single bit about the presence of touch handlers to the browser. This is used to avoid unnecessarily sending touch events to the renderer when there are no appropriate handlers. However, it has been observed that a non-trivial number of sites add touchstart handlers but no *touchmove* handlers. As dispatch of the first touchmove to the renderer main thread can block scrolling, this means we're unnecessarily blocking scrolling for sites that lack a touchmove handler, increasing the risk of jank and scroll delay. Instead, notify the WebWidgetClient when the existence of a particular handler class has changed. This includes touch, touchmove, wheel and scroll handlers. The embedder can then take the appropriate action to optimize the non-existent touchmove handler case (as in crrev.com/1050993004). BUG=464721

Patch Set 1 #

Patch Set 2 : Rebase #

Patch Set 3 : rebase #

Patch Set 4 : Rebase #

Patch Set 5 : Fix loading #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+51 lines, -15 lines) Patch
M Source/core/frame/EventHandlerRegistry.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/frame/EventHandlerRegistry.cpp View 1 2 3 3 chunks +6 lines, -1 line 0 comments Download
M Source/core/input/EventHandler.cpp View 1 2 3 1 chunk +5 lines, -1 line 0 comments Download
M Source/core/layout/LayoutObject.cpp View 1 2 3 2 chunks +3 lines, -3 lines 0 comments Download
M Source/core/loader/EmptyClients.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/loader/FrameLoader.cpp View 1 2 3 4 1 chunk +3 lines, -1 line 0 comments Download
M Source/core/page/ChromeClient.h View 1 2 3 1 chunk +1 line, -0 lines 1 comment Download
M Source/core/page/scrolling/ScrollingCoordinator.cpp View 1 2 3 3 chunks +14 lines, -8 lines 0 comments Download
M Source/core/testing/Internals.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/web/ChromeClientImpl.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M Source/web/ChromeClientImpl.cpp View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M Source/web/WebViewImpl.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M Source/web/WebViewImpl.cpp View 1 2 3 1 chunk +6 lines, -0 lines 0 comments Download
M public/web/WebWidgetClient.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 5 (1 generated)
jdduke (slow)
+tdresser, Not sending this out for review, just an FYI as you were curious about ...
5 years, 3 months ago (2015-09-02 21:59:10 UTC) #1
jdduke (slow)
https://codereview.chromium.org/1055683003/diff/100001/Source/core/page/ChromeClient.h File Source/core/page/ChromeClient.h (right): https://codereview.chromium.org/1055683003/diff/100001/Source/core/page/ChromeClient.h#newcode199 Source/core/page/ChromeClient.h:199: virtual void needTouchEvents(bool) = 0; We should probably just ...
5 years, 3 months ago (2015-09-02 22:03:03 UTC) #3
tdresser
On 2015/09/02 22:03:03, jdduke wrote: > https://codereview.chromium.org/1055683003/diff/100001/Source/core/page/ChromeClient.h > File Source/core/page/ChromeClient.h (right): > > https://codereview.chromium.org/1055683003/diff/100001/Source/core/page/ChromeClient.h#newcode199 > ...
5 years, 3 months ago (2015-09-03 13:18:32 UTC) #4
jdduke (slow)
5 years, 3 months ago (2015-09-03 15:50:38 UTC) #5
On 2015/09/03 13:18:32, tdresser wrote:
> What kind of implementation cleanup do you think we'd see if we also told the
> browser about touchend/touchcancel?
> 

Not much, and it probably wouldn't be much of an optimization either.

> I think it's probably simpler for EventHandlerClass to store event types at
> different levels of granularity, otherwise there would be a bunch of cases
> called out explicitly that we don't differentiate.
> 

Yeah, that's the tricky balance here. We really only care about the touchmove
case, but it's still a bit awkward to have 2 separate classes for touch events.
I was thinking of doing just as you said, having a separate granularity for how
we store the events (so there's just one touchevent class, but we have
touch/touchmove storage). The trick bit there is that there's a call to get the
EventTargetSet by *class*. There's only one caller of that method, but I didn't
see a simple way of adjusting that method short of getting cute with custom
iterators, or just doing what I'm doing now and making the caller aware of the
touch/touchmove distinction.

> If this is true, then I'm not sure what splitting out touchend/touchcancel
buys
> us.

Not a lot probably.

Powered by Google App Engine
This is Rietveld 408576698