New issue
Advanced search Search tips

Issue 887271 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

'pointer' and 'hover' media queries features mismatch when a mouse is connected to

Reported by hike...@mozilla.com, Sep 20

Issue description

Example URL:
https://hiikezoe.github.io/interaction-media-features.html

Steps to reproduce the problem:
1. Open the URL on Android with a mouse connected
2. See the results in 'pointer feature' and 'hover feature'

What is the expected behavior?
'pointer' should be 'fine' and 'hover' should be 'hover'

What went wrong?
'pointer' is 'coarse'

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? No 

Does this work in other browsers? Yes

Chrome version: 69.0.3497  Channel: n/a
OS Version: 4.4.2
Flash Version: 

'pointer' and 'hover' media queries are for the primary device, in this case it's the mouse.  And as far as I can tell mouse should be 'fine', should not be 'coarse'.

The problem is in GetPrimaryPointerType() and GetPrimaryHoverType() in ui/base/touch/touch_device_android.cc.  GetPrimaryPointerType returns POINTER_TYPE_COARSE if there is any coarse type pointer devices, and GetPrimaryHoverType returns HOVER_TYPE_NONE if there is any not-hover-capable devices.
 
In the case, it might be possible that touch screen is the primary device, if so, 'hover' should be 'none'.
Oh the problem is actually in availablePointerAndHoverTypes() in ui/android/java/src/org/chromium/ui/base/TouchDevice.java.   It should set HoverType.NONE if there is a InputDevice.SOURCE_TOUCHSCREEN.
Labels: Needs-triage-Mobile
Components: -Blink Blink>CSS Blink>Input
Components: -Blink>CSS
Cc: mustaq@chromium.org
Status: Available (was: Unconfirmed)
mustaq@ what do you think since you worked on enabled mouse functionalities on Android more than any one else.
Cc: -mustaq@chromium.org
Owner: mustaq@chromium.org
Status: Assigned (was: Available)
Looks like a half-baked code about Android mouse, I never tested it with a real mouse :-P

I agree with #c1: pointer=coarse and hover=none is the expected outcome here.
Note that I've already sent a PR for this.
https://chromium-review.googlesource.com/c/chromium/src/+/1253316
I LGTMed your change, and also ran a dry-run which passed.  You will need an owner's approval to commit the change, see src/ui/android/OWNERS.

Comment 11 by mustaq@chromium.org, Jan 18 (4 days ago)

Labels: -Pri-2 Pri-3

Sign in to add a comment