Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

[Bug] it does not match pointer: coarse CSS media query #14816

Closed
1 task
myakura opened this issue Sep 7, 2020 · 13 comments
Closed
1 task

[Bug] it does not match pointer: coarse CSS media query #14816

myakura opened this issue Sep 7, 2020 · 13 comments
Labels
b:web-content Issues with websites. Check to see if the issue is GV or WebCompat too 🐞 bug Crashes, Something isn't working, .. needs:gv GeckoView bug required to fix the issue. See bugzilla.mozilla.org wontfix

Comments

@myakura
Copy link

myakura commented Sep 7, 2020

Steps to reproduce

  1. go to https://charmed-debonair-promotion.glitch.me/pointer-coarse.html
  2. see if there's a green rectangle below the paragraph

Expected behavior

There is a green square shown below the paragraph.

Actual behavior

There isn't.

Device information

  • Android device: Xiaomi Mi A1
  • Fenix version: Checked with Nightly and Beta
    Nightly 200907 06:01 (Build #2015762483)
    AC: 58.0.20200904130229, b6c304b2a
    GV: 82.0a1-20200902095359
    AS: 61.0.13
    
    81.1.0-beta.2 (Build #2015761659)
    AC: 57.0.1, 3bfddbb7b
    GV: 81.0-20200901203141
    AS: 61.0.13
    

┆Issue is synchronized with this Jira Task

@myakura myakura added the 🐞 bug Crashes, Something isn't working, .. label Sep 7, 2020
@github-actions github-actions bot added the needs:triage Issue needs triage label Sep 7, 2020
@myakura
Copy link
Author

myakura commented Sep 7, 2020

The pointer media feature is used to apply particular style sheets depending on the accuracy of a pointing device.
https://drafts.csswg.org/mediaqueries-4/#descdef-media-pointer

According to the spec, pointer: coarse is expected to be true on a smartphone. However, Fenix matches pointer: fine, a query expected to be true on a desktop where the primary pointing device is a mouse.

@myakura
Copy link
Author

myakura commented Sep 7, 2020

Likewise, Fenix also does not match hover: none but hover: hover.
http://charmed-debonair-promotion.glitch.me/hover-none.html
http://charmed-debonair-promotion.glitch.me/hover-hover.html

@makotokato
Copy link

makotokato commented Sep 8, 2020

Hmm, Fennec has the fix via https://bugzilla.mozilla.org/show_bug.cgi?id=1035774 and Fenix on android emulator and Xperia XZ2 work fine. Also, hover issue will be https://bugzilla.mozilla.org/show_bug.cgi?id=1558865.

I guess that your Xiaomi devices has no InputDevice.SOURCE_TOUCHSCREEN for 1st enum data of InputDevice...

@makotokato
Copy link

Also, when I check Chromium code, they return coarse (https://source.chromium.org/chromium/chromium/src/+/master:ui/base/pointer/pointer_device_android.cc;l=41;drc=8586102b48a409c634250f31c3fc7bdde5ec3db0) if one device has touch at least. This is compat issue.

@makotokato
Copy link

I think that this issue is same as https://bugzilla.mozilla.org/show_bug.cgi?id=1556983

@liuche liuche added b:web-content Issues with websites. Check to see if the issue is GV or WebCompat too needs:gv GeckoView bug required to fix the issue. See bugzilla.mozilla.org and removed needs:triage Issue needs triage labels Sep 17, 2020
@ofrias
Copy link

ofrias commented Feb 10, 2021

This issue can be also reproduced with Firefox 85.1.2 running on LineageOS 17.1 on a MotoG 2015 (osprey device). Related issue: https://gitlab.com/LineageOS/issues/android/-/issues/2979

@samuelwx
Copy link

Same problem with Essential Phone PH-1 on Firefox 85.1.3, Android 10.

Results from https://patrickhlauke.github.io/touch/pointer-hover-any-pointer-any-hover/
pic1a

@stale
Copy link

stale bot commented Aug 16, 2021

See: #17373 This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Aug 16, 2021
@lorenzos
Copy link
Contributor

lorenzos commented Aug 17, 2021

The issue persists on Nightly 93.0a1. Same results as @samuelwx and @myakura on OnePlus 3T.

I can confirm the issue is the same as Bug 1556983 on Bugzilla, as @makotokato says (I'm the original reporter). Unfortunately we had no idea how to fix that (except doing what Chromium does). It could be useful to know if the root cause for @samuelwx and @myakura is exactly the same (i.e. the device reports an enabled fine pointer device listed before the touch screen): if you're Android developers, here's the code to test this:

for (final int id : InputDevice.getDeviceIds()) {
	
	final InputDevice device = InputDevice.getDevice(id);
	Log.i("InputDevice", device.getId() + ": " + device.getName());
	
	final boolean isPointer = (device.getSources() & (
		InputDevice.SOURCE_CLASS_JOYSTICK |
		InputDevice.SOURCE_CLASS_POINTER |
		InputDevice.SOURCE_CLASS_POSITION |
		InputDevice.SOURCE_CLASS_TRACKBALL)) != 0;
	Log.i("InputDevice", "Is pointer? " + (isPointer ? "YES" : "NO"));
	Log.i("InputDevice", "Is virtual? " + (device.isVirtual() ? "YES" : "NO"));
	Log.i("InputDevice", "Is enabled? " + (device.isEnabled() ? "YES" : "NO"));
	
	for (final Field f : InputDevice.class.getFields()) {
		if (f.getName().startsWith("SOURCE_")) {
			try {
				if (device.supportsSource(f.getInt(InputDevice.class))) {
					Log.v("InputDevice", " - " + f.getName());
				}
			} catch (IllegalAccessException e) {
				throw new RuntimeException(e);
			}
		}
	}
	
}

@stale
Copy link

stale bot commented Feb 15, 2022

See: #17373 This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Feb 15, 2022
@ofrias
Copy link

ofrias commented Feb 15, 2022

I have just tested on Firefox Nightly, version 99.0a1 (Build #2015863465), on LineageOS 17.1 on a MotoG 2015 (osprey device), and the issue is fixed.

@stale stale bot removed the wontfix label Feb 15, 2022
@lorenzos
Copy link
Contributor

Can confirm, same version as @ofrias on the exact same device I originally reported for. The issue can be closed, IMO. Thanks!

@stale
Copy link

stale bot commented Nov 23, 2022

See: #17373 This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
b:web-content Issues with websites. Check to see if the issue is GV or WebCompat too 🐞 bug Crashes, Something isn't working, .. needs:gv GeckoView bug required to fix the issue. See bugzilla.mozilla.org wontfix
Projects
None yet
Development

No branches or pull requests

6 participants