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

Issue 163933002: Send early ShowPress on TapDown when page isn't scrollable/pinchable. (Closed)

Created:
6 years, 10 months ago by Zeeshan Qureshi
Modified:
6 years, 5 months ago
CC:
blink-reviews, dglazkov+blink, Nate Chapin, eae+blinkwatch, gavinp+loader_chromium.org
Visibility:
Public.

Description

Send early ShowPress on TapDown when page isn't scrollable/pinchable. Blink uses the ShowPress gesture to determine when to display hover and active states. If the page isn't scrollable or pinchable and if the current TapDown isn't the start of a scroll then generate an early ShowPress in WebView and ignore the actual ShowPress received from chromium later. Additionally, refactor subframe calculation for hit testing into frameForGestureEvent() BUG=306581

Patch Set 1 #

Total comments: 9

Patch Set 2 : Move to WebViewImpl #

Patch Set 3 : Fix touch adjustment #

Patch Set 4 : Add tests #

Total comments: 14

Patch Set 5 : Rebase ToT #

Patch Set 6 : Handle special form elements / iframes #

Total comments: 1

Patch Set 7 : Get element coordinates programmatically #

Total comments: 27

Patch Set 8 : Rebase #

Patch Set 9 : Address comments #

Patch Set 10 : Refactor into hasEarlyShowPress() #

Unified diffs Side-by-side diffs Delta from patch set Stats (+480 lines, -38 lines) Patch
A LayoutTests/fast/events/touch/gesture/gesture-tap-down-scroll-pinch.html View 1 2 3 4 5 6 7 8 9 1 chunk +109 lines, -0 lines 0 comments Download
A LayoutTests/fast/events/touch/gesture/gesture-tap-down-scroll-pinch-expected.txt View 1 2 3 4 5 6 7 8 9 1 chunk +41 lines, -0 lines 0 comments Download
A LayoutTests/fast/events/touch/gesture/gesture-tap-down-special-elements.html View 1 2 3 4 5 6 7 8 9 1 chunk +134 lines, -0 lines 0 comments Download
A LayoutTests/fast/events/touch/gesture/gesture-tap-down-special-elements-expected.txt View 1 2 3 4 5 6 7 8 9 1 chunk +43 lines, -0 lines 0 comments Download
A LayoutTests/fast/events/touch/gesture/resources/gesture-tap-down-iframe.html View 1 2 3 4 5 6 7 1 chunk +11 lines, -0 lines 0 comments Download
M LayoutTests/fast/events/touch/resources/touch-hover-active-tests.js View 1 2 3 4 5 6 7 8 9 1 chunk +20 lines, -0 lines 0 comments Download
M Source/core/page/EventHandler.h View 1 2 3 4 5 6 7 2 chunks +3 lines, -1 line 0 comments Download
M Source/core/page/EventHandler.cpp View 1 2 3 4 5 6 7 3 chunks +64 lines, -36 lines 0 comments Download
M Source/web/WebViewImpl.h View 1 2 3 4 5 6 7 3 chunks +5 lines, -0 lines 0 comments Download
M Source/web/WebViewImpl.cpp View 1 2 3 4 5 6 7 8 5 chunks +50 lines, -1 line 0 comments Download

Messages

Total messages: 23 (0 generated)
Zeeshan Qureshi
Running through first, tests on the way.
6 years, 10 months ago (2014-02-13 16:20:53 UTC) #1
Rick Byers
As we discussed offline, we'll probably want a mechanism for triggering tap highlighting in this ...
6 years, 10 months ago (2014-02-14 21:27:53 UTC) #2
bokan
https://codereview.chromium.org/163933002/diff/1/Source/core/page/ChromeClient.h File Source/core/page/ChromeClient.h (right): https://codereview.chromium.org/163933002/diff/1/Source/core/page/ChromeClient.h#newcode270 Source/core/page/ChromeClient.h:270: virtual float minimumPageScaleFactor() const = 0; On 2014/02/14 21:27:53, ...
6 years, 10 months ago (2014-02-18 19:59:57 UTC) #3
Zeeshan Qureshi
Refactored most of it into WebViewImpl, walking up both the Layer and Frame tree as ...
6 years, 10 months ago (2014-02-19 18:16:13 UTC) #4
Zeeshan Qureshi
Added tests.
6 years, 10 months ago (2014-02-20 19:59:08 UTC) #5
Rick Byers
This seems like a much cleaner approach, good work! I'd re-word the CL description to ...
6 years, 10 months ago (2014-02-21 03:35:52 UTC) #6
Zeeshan Qureshi
Will talk to Bokan about the scroll detection and update handling for specific controls. https://codereview.chromium.org/163933002/diff/290001/LayoutTests/fast/events/touch/gesture/gesture-tap-down-pinch-no-scroll.html ...
6 years, 10 months ago (2014-02-24 03:14:26 UTC) #7
bokan
https://codereview.chromium.org/163933002/diff/290001/Source/core/page/EventHandler.cpp File Source/core/page/EventHandler.cpp (right): https://codereview.chromium.org/163933002/diff/290001/Source/core/page/EventHandler.cpp#newcode2223 Source/core/page/EventHandler.cpp:2223: bool EventHandler::hasScrollableAncestor(const Node* node) const On 2014/02/21 03:35:52, Rick ...
6 years, 10 months ago (2014-02-24 14:55:35 UTC) #8
Zeeshan Qureshi
Changes: * Handle form elements / iframes correctly * Use m_earlyGestureShowPress * Combine tests for ...
6 years, 9 months ago (2014-03-03 01:32:01 UTC) #9
bokan
LGTM modulo one note in tests https://codereview.chromium.org/163933002/diff/450001/LayoutTests/fast/events/touch/gesture/gesture-tap-down-special-elements.html File LayoutTests/fast/events/touch/gesture/gesture-tap-down-special-elements.html (right): https://codereview.chromium.org/163933002/diff/450001/LayoutTests/fast/events/touch/gesture/gesture-tap-down-special-elements.html#newcode157 LayoutTests/fast/events/touch/gesture/gesture-tap-down-special-elements.html:157: eventSender.gestureTapDown(50, 65); Get ...
6 years, 9 months ago (2014-03-03 13:01:19 UTC) #10
Rick Byers
https://codereview.chromium.org/163933002/diff/470001/LayoutTests/fast/events/touch/gesture/gesture-tap-down-scroll-pinch.html File LayoutTests/fast/events/touch/gesture/gesture-tap-down-scroll-pinch.html (right): https://codereview.chromium.org/163933002/diff/470001/LayoutTests/fast/events/touch/gesture/gesture-tap-down-scroll-pinch.html#newcode32 LayoutTests/fast/events/touch/gesture/gesture-tap-down-scroll-pinch.html:32: #scroller { nit: "scroller" suggests overflow:scroll to me. Maybe ...
6 years, 9 months ago (2014-03-13 01:40:05 UTC) #11
Zeeshan Qureshi
https://codereview.chromium.org/163933002/diff/470001/LayoutTests/fast/events/touch/gesture/gesture-tap-down-scroll-pinch.html File LayoutTests/fast/events/touch/gesture/gesture-tap-down-scroll-pinch.html (right): https://codereview.chromium.org/163933002/diff/470001/LayoutTests/fast/events/touch/gesture/gesture-tap-down-scroll-pinch.html#newcode32 LayoutTests/fast/events/touch/gesture/gesture-tap-down-scroll-pinch.html:32: #scroller { On 2014/03/13 01:40:05, Rick Byers wrote: > ...
6 years, 9 months ago (2014-03-24 21:37:42 UTC) #12
Rick Byers
This looks good - just one outstanding question... https://codereview.chromium.org/163933002/diff/470001/LayoutTests/fast/events/touch/gesture/gesture-tap-down-special-elements.html File LayoutTests/fast/events/touch/gesture/gesture-tap-down-special-elements.html (right): https://codereview.chromium.org/163933002/diff/470001/LayoutTests/fast/events/touch/gesture/gesture-tap-down-special-elements.html#newcode162 LayoutTests/fast/events/touch/gesture/gesture-tap-down-special-elements.html:162: debug("combobox ...
6 years, 9 months ago (2014-03-25 19:46:46 UTC) #13
Zeeshan Qureshi
On 2014/03/25 19:46:46, Rick Byers wrote: > This looks good - just one outstanding question... ...
6 years, 9 months ago (2014-03-25 20:15:38 UTC) #14
Rick Byers
On 2014/03/25 20:15:38, Zeeshan Qureshi wrote: > On 2014/03/25 19:46:46, Rick Byers wrote: > > ...
6 years, 9 months ago (2014-03-25 20:23:11 UTC) #15
Zeeshan Qureshi
+ojan for OWNERS
6 years, 9 months ago (2014-03-25 21:37:03 UTC) #16
aelias_OOO_until_Jul13
Hmm, what I don't like about this is the ignoring of the future ShowPress event. ...
6 years, 9 months ago (2014-03-25 22:18:42 UTC) #17
Rick Byers
On 2014/03/25 22:18:42, aelias wrote: > Hmm, what I don't like about this is the ...
6 years, 9 months ago (2014-03-25 22:29:01 UTC) #18
aelias_OOO_until_Jul13
On 2014/03/25 22:29:01, Rick Byers wrote: > One option may be to remove the ShowPress ...
6 years, 9 months ago (2014-03-25 22:55:49 UTC) #19
Rick Byers
On 2014/03/25 22:55:49, aelias wrote: > On 2014/03/25 22:29:01, Rick Byers wrote: > > One ...
6 years, 9 months ago (2014-03-25 23:01:59 UTC) #20
aelias_OOO_until_Jul13
On 2014/03/25 22:55:49, aelias wrote: > The difficulty with that is that the main thread ...
6 years, 9 months ago (2014-03-25 23:04:29 UTC) #21
jdduke (slow)
Do we have some real world sites for which we know this will enrich the ...
6 years, 9 months ago (2014-03-25 23:13:40 UTC) #22
Rick Byers
6 years, 9 months ago (2014-03-25 23:41:48 UTC) #23
On 2014/03/25 23:04:29, aelias wrote:
> The main problem with this is that this would be prone to flashing a link
> highlight if the Blink main thread is hung (TapDown at 0ms, Blink main thread
> hangs, CancelShowPress sent at 50ms, Blink frees up at 300ms, then creates the
> link highlight and then cancels it).  I don't know if there's some trick we
> could use to avoid this issue.

Good point.  We'd probably not actually see the highlight in most cases because
it would be shown and cleared in the same frame (see http://crbug.com/312798)
but still the occasional flicker here would be unfortunate.

On 2014/03/25 23:13:40, jdduke wrote:
> Do we have some real world sites for which we know this will enrich the
> experience?

There are lots of 'appy' sites that have touch effects on things that aren't
scrollable or pinchable (eg. mobile gmail), but those sorts of sites tend to
care enough about a fast response to their buttons that they implement them
using touch events (that's the only thing that works reliably and consistently
across all browsers anyhow).  I'm not personally aware of any sites that rely
heavily on :active today and are mobile-optimized, but this bug started with a
request/complaint from an engineer on Google Maps who felt the web was behind
android here.

The argument is that we should be providing reliable and performant higher-level
APIs that are agnostic to input type so developers can code to them rather than
specific types of input (and then future input types and accessibility scenarios
just work instead of requiring more input-type-specific code).

But perhaps that's a weak enough argument that it's not worth the debate at this
point.  We could instead tackle this as a larger effort to
improve/rationalize/extend our high-level device-agnostic input APIs (eg. I
think we should have 'onactive' events for JS too).

Powered by Google App Engine
This is Rietveld 408576698