New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 598957 link

Starred by 6 users

Issue metadata

Status: WontFix
Owner:
Closed: Apr 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug-Regression



Sign in to add a comment

Touch events that are originating in a webview do not filter up to the document even listner

Reported by jriggmcp...@gmail.com, Mar 30 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36
Platform: 7834.60.0 Stable channel Panther

Steps to reproduce the problem:
1. In chrome app api, create a web view
2. in the document parent, add an addEventListener for touch events
3. Console log when a touch event occurs.

What is the expected behavior?
The parent document should get the event, however latest version of Chrome this does not occur.

What went wrong?
Webview is no sending touch events up to the parent document.
Mouse events still work as expected.

document.addEventListener("touchmove", idleTimer, false); // won't work

document.addEventListener("mousemove", idleTimer, false); // works

WebStore page: 

Did this work before? Yes 

Chrome version: 49.0.2623.95  Channel: stable
OS Version: 
Flash Version:
 
Cc: juanra...@chromium.org blumberg@chromium.org
Hi Juan,

Can you take a look and confirm if this a regression as the partner is reporting that a prior release (m48?) did not have this issue.
Labels: -Type-Bug -Pri-2 Pri-1 Type-Bug-Regression
Cc: aghuie@chromium.org
Cc: c...@chromium.org
Confirmed that this is a regression.

App using "document.addEventListener("touchmove", idleTimer, false);" is working fine on: 
	
Sumo
48.0.2564.116 

but not working on:

Sumo
49.0.2623.95
Cc: abodenha@chromium.org
Cc: jdufault@chromium.org
Owner: adlr@chromium.org
Status: Assigned (was: Unconfirmed)
Juan is OOO. Is regression per #4. Assigning for fix.
Cc: rbyers@chromium.org
Components: Internals>Input>Touch>Screen

Comment 10 by adlr@google.com, Apr 4 2016

Owner: rbyers@chromium.org
Assigning to rbyers to triage in upper layers
Components: Platform>Apps>BrowserTag
Labels: M-49
Owner: wjmaclean@chromium.org
This is a Chrome App using <webview> tag, right?  Then wjmaclean is the expert.
Cc: tdres...@chromium.org
I guess we disconnected this in https://codereview.chromium.org/1412923009/ when we started routing touch events for WebViews directly to the guest renderer, bypassing the embedder.

I guess we need to think about a suitable pathway to take touches that are unconsumed by the guest and make them available to the embedder ...

Adding tdresser@ as we'll need his input as to how best to accomplish this.
Cc: sduraisamy@chromium.org
Cc: kenrb@chromium.org
Would enabling this be safe from a security perspective?

Are we planning to enable the parent document to see touch events targeted at OOPIFs?


For webviews, there is no security problem with the embedder listening for events that target the guest, because chrome apps are trusted more than web content.

This would be a security problem on the open web, though, which is why out-of-process iframes do not have this property and need to have input routed directly from the browser process. This bug is a consequence of the ongoing work to bring the two architectures together.

I was really hoping to get rid of the input event forwarding code from embedder to guest but it isn't clear how to solve this problem if we do that.
James, can we share the event reposting logic with gestures?
Re #16: yes, and we could even potentially do something better than re-posting (e.g. never targeting the guest if it doesn't have a touch handler, or re-targeting the event if the ack from the guest indicates the event was unconsumed).

However, that the touch events ever went to the embedder in the first place may have been unintended. I'm curious to know what the use case is for wanting the embedder to process the touch events that nominally belong to the guest? Does the guest have a touch handler in this use-case? (If it does, it seems odd that we would have multiple handlers firing for a single event.)
From a web developer's perspective, it would be ideal if webviews didn't have any impact on event dispatch.

https://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-flow-basic

i.e., capturing listeners in the embedder should see the event before the webview gets a crack at it.
For some additional context, capturing listeners on embedded plugins (via <object> tag) *do* fire for input events targeting them, but that is not true on Firefox, and there is a bug assigned to me arguing that we should match their behavior. Obviously iframe embedders do not see events targeted to the iframes. The latter is compliant to spec because capture and bubble do not pass through nested browsing contexts.

Both of the above are important for security reasons, which is not true for <webview>. Still, since it is a separate browsing context I would argue that we shouldn't capture/bubble across the boundary, except that it differs from how events worked before and there is a lot of value in simply not changing behavior of features that developers are using.
Cc: mknowles@chromium.org

Comment 21 by wyf7...@gmail.com, Apr 12 2016

The flash content in the webview will receive a wrong touch position because of this bug.
As the attached picture shown, the webview start from (i, j), and if we touch the blue point (x, y), the purple point (x+i, y+j) will actually be clicked.
This can be reproduced in this app https://github.com/KochiyaOcean/chrome-webview-bug
Status: WontFix (was: Assigned)
Re #21 I don't think this bug is the cause of the coordinates for the events being wrong in the webview; wyf7789@, could you please create a separate bug for that, and include your sample app and screenshot? Thanks.

Given the desire to use the same codepath for webview and oopif, and given that it's possible to inject script into a webview to allow it to share events with its embedder, I'm going to mark this as wontfix.

Sign in to add a comment