Skip to content

Implement the pointer/hover interaction media features for the servo backend #390

Description

@UMCEKO

Missing: the pointer / hover interaction media features (servo backend)

Servo's media-feature list (style/servo/media_features.rs) doesn't implement the mediaqueries-4 interaction features: pointer, any-pointer, hover, any-hover. Since an unknown feature never matches, any rule guarded by one is silently dropped.

Real-world impact

Modern CSS frameworks emit hover styles behind these queries. Tailwind v4, for example, wraps every :hover utility in @media (hover: hover) { … }. On a servo-backed engine (e.g. Blitz, which uses Stylo with the servo configuration) this means all hover styling is dropped — hover states, button highlights, etc. just don't apply.

Notes for implementation

  • The gecko backend already implements these in style/gecko/media_features.rs via a PointerCapabilities bitflags concept (COARSE / FINE / HOVER) read off the device.
  • The servo Device (style/device/servo.rs) would need an equivalent capability it can evaluate against — a sensible default for a desktop window is a fine pointer that can hover, ideally overridable for touch-first embedders.

I had a working implementation but it was AI-assisted, so per the AI-contributions policy I've closed that PR (#389) and I'm filing this instead so a maintainer can implement it natively. Happy to test any implementation against a real Tailwind-styled app.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions