Closed Bug 1747942 Opened 2 years ago Closed 9 months ago

Incorrect CSS media query matches for pointer, any-pointer, hover and any-hover on Surface Laptop

Categories

(Core :: Widget: Win32, defect, P2)

Firefox 96
x86_64
Windows 11
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: josh.tumath+bugzilla, Unassigned)

References

(Depends on 1 open bug)

Details

(Whiteboard: [win:touch])

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:96.0) Gecko/20100101 Firefox/96.0

Steps to reproduce:

Using a Surface Laptop 4, open the following test case in Firefox and a Chromium browser like Edge.

https://codepen.io/joshtumath/pen/MWEQOKw

Actual results:

The Surface Laptop 4 matches the following media queries:

pointer: coarse
any-pointer: coarse

Expected results:

The Surface Laptop 4's primary input is the trackpad/mouse, and although it has a touchscreen, its a secondary input. The matching media queries should be:

pointer: fine
any-pointer: coarse
any-pointer: fine

OS: Unspecified → Windows 11
Hardware: Unspecified → x86_64
Summary: Incorrect CSS media query pointer for Surface Laptop → Incorrect CSS media query matches for pointer, any-pointer, hover and any-hover on Surface Laptop

This also includes the hover and any-hover media queries.

Actual results on Surface Laptop 4:

hover: none
any-hover: none

Expected results on Surface Laptop 4:

hover: hover
any-hover: none
any-hover: hover

The severity field is not set for this bug.
:jimm, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jmathies)
Severity: -- → S4
Flags: needinfo?(jmathies)
Priority: -- → P2
See Also: → 1697294
Whiteboard: [win:touch]
Depends on: 1735765

I experience same issue. I am using touch laptop and on the page about any-hover query hover with a pointer (touchpad) does not work: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/any-hover

Hi there,

Good news! This was fixed in Bug 1813979, and should be live in the latest Firefox 117 release.

I tested the latest Firefox using your Codepen link, and everything seems to work now on the Surface Pro with the exception of your "This box should be blue if your device has touch", but I think your code has a bug.

Your code checks for a touchscreen using any-hover: none, but that's not what that Media Query tests. It tests whether any device on the machine supports hover. Since the Surface Pro has a trackpad/mouse that supports hover, any-hover: hover is correct.

It's also worth noting that even if you unplug your mouse/trackpad from the Surface Pro, you will never see any-hover: none because the screen itself is a pen digitizer, and the pen stylus supports hovering.

Cheers!

Status: UNCONFIRMED → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
See Also: → 1851244
You need to log in before you can comment on or make changes to this bug.