Closed Bug 2083712 Opened 1 month ago Closed 17 days ago

Headless Firefox on Linux reports no pointing device

Categories

(Firefox :: Headless, defect)

Firefox 158
Desktop
Linux
defect

Tracking

()

RESOLVED FIXED
161 Branch
Tracking Status
firefox161 --- fixed

People

(Reporter: dgozman, Assigned: dgozman)

References

Details

Attachments

(1 external file)

Steps to reproduce

Linux-only steps:

MOZ_HEADLESS=1 firefox --marionette   # or any headless automation
matchMedia("(hover: hover)").matches   // false
matchMedia("(pointer: fine)").matches  // false
matchMedia("(hover: none)").matches    // true
matchMedia("(pointer: none)").matches  // true

Headed Firefox on the same Linux machine, and headless Firefox on macOS and
Windows, all answer (hover: hover) / (pointer: fine).

Actual results

Pages served to headless Firefox (often automated test) get the touch-only layout: hover-revealed menus hidden, enlarged tap targets, :hover styles never applied.

Expected results

Headless mode is a desktop without a display, not a device without a pointing device, so it should report mouse-related values by default.

Component: Untriaged → Headless
OS: Unspecified → Linux
Hardware: Unspecified → Desktop

HeadlessLookAndFeel returns PointerCapabilities::None for
PrimaryPointerCapabilities and AllPointerCapabilities, so headless
Firefox on Linux matches (hover: none) and (pointer: none) and gets the
touch-only layout of every site that uses the interaction media
features. The headed GTK nsLookAndFeel doesn't implement these IDs at
all, in which case nsMediaFeatures falls back to the desktop default,
Fine | Hover; headless on macOS and Windows use the native LookAndFeel
and already report a mouse.

Report Fine | Hover in headless GTK as well, and add a Marionette unit
test, since its headless variant is the only job that runs the headless
widget.

Assignee: nobody → dgozman
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Status: ASSIGNED → RESOLVED
Closed: 17 days ago
Resolution: --- → FIXED
Target Milestone: --- → 161 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: