New issue
Advanced search Search tips

Issue 603133 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: May 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Touch event went wrong in a webview

Reported by wyf7...@gmail.com, Apr 13 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36

Steps to reproduce the problem:
1. Install https://github.com/KochiyaOcean/chrome-webview-bug as a Chrome app
2. Start the app and open Developer Tools of webview in the app
3. run 'document.onmousedown = function(e){console.log('mousedown: ', e.clientX, e.clientY, e.screenX, e.screenY)}' and 'document.addEventListener('touchstart', function(e){console.log('touchstart: ', e.touches[0].clientX, e.touches[0].clientY, e.touches[0].screenX, e.touches[0].screenY)})'
4. Touch webview

What is the expected behavior?
The logged 'clientX', 'clientY', 'screenX', 'screenY' of mousedown event are the same as that of touchstart event

What went wrong?
The logged 'clientX', 'clientY', 'screenX', 'screenY' of mousedown event aren't the same as that of touchstart event
For example:
touchstart:  245 282 245 313
mousedown:  137 174 358 459

touchstart:  206 310 206 341
mousedown:  98 202 319 487

Did this work before? Yes Version before Chrome 49

Chrome version: 49.0.2623.112  Channel: stable
OS Version: 10.0
Flash Version: Shockwave Flash 21.0 r0
 
Cc: wjmaclean@chromium.org dtapu...@chromium.org
Components: Blink>Input
wjmaclean@ is this something you have an idea about?
Owner: wjmaclean@chromium.org
Yes ... right now if you run without the --site-per-process or --use-cross-process-frames-for-guests then the mouse events take a different pathway from the touch events, and it's possible the coordinate transforms have gotten out of alignment.

I'll look into it.
Status: Assigned (was: Unconfirmed)
Cc: tdres...@chromium.org
Status: Started (was: Assigned)
I just did a test (using a tip-of-tree build, 52.0.2731.0), using both the 'Browser Sample' app and the app listed in this bug, and I'm seeing identical clientX, clientY coords for the touchstart and mousedown. The screenX, screenY coords vary quite a bit, but that depends on where the app window is placed on the screen, and it's the same behaviour seen for these same handlers installed in a regular tab (no webview). I tried this both with and without --use-cross-process-frames-for-guest.

wyf7789@ - are you still seeing this? If so, could you post the contents of chrome://version/ to the bug, so I can see which flags you're using? Also, have you tried a recent canary build?

tdresser@ - is there a particular reason for the difference in screen coordinates? Touch events seem to be from the corner of the screen, while mouse events from the corner of the window.
wjmaclean - screen co-ordinates should be relative to the screen, and client co-ordinates should be relative to the window.

If that isn't the case, we should fix it.

It works fine for me in the non-iframe/guestview case.
https://jsbin.com/yohode/quiet
dtapuska@ - so you're saying the screen coordinates should be the same for both mouse and touch, right? And this should be the case for all of tabs, iframes, and guestviews/webviews, correct?
Unless there are security issues I'm not aware of, that's the case.

Comment 8 by wyf7...@gmail.com, May 14 2016

 wjmaclean@ The bug is fixed in the latest release of Chrome Dev (Chrome 51)
Status: Fixed (was: Started)

Sign in to add a comment