Repository navigation
Conversation
The servo media-feature list had no interaction features, so `@media (hover: hover)`, `(pointer: fine)`, and the `any-*` forms never matched — silently dropping any rules they guard. (Modern CSS frameworks wrap their `:hover` styles in `@media (hover: hover)`, so on servo-backed engines all hover styling was being dropped.) Add `pointer`, `any-pointer`, `hover`, and `any-hover`, evaluated against a new `PointerCapabilities` carried by the servo `Device` (a `bitflags` of COARSE/FINE/HOVER, mirroring the gecko backend). The device defaults to a desktop-class pointer (FINE | HOVER) and exposes `set_pointer_capabilities` so an embedder on a touch-first device can override it. `any-*` resolves to the same capabilities, as servo models a single pointer.
Member
|
@UMCEKO Did you use AI tools to write the code or the pull request description? |
Contributor
Author
Yes, I reviewed the code manually, and tested it in a real working app. |
Member
Contributor
Author
|
Okay, forking it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Servo's media-feature list (
style/servo/media_features.rs) implements none of the interaction media features:pointer,any-pointer,hover,any-hover. An unknown feature never matches, so any rules guarded by them are silently dropped.This bites real stylesheets: modern CSS frameworks (e.g. Tailwind v4) wrap their
:hoverutilities in@media (hover: hover), so on a servo-backed engine all hover styling disappears.Fix
Implement the four interaction features, evaluated against a new
PointerCapabilitiescarried by the servoDevice— abitflagsofCOARSE/FINE/HOVER, mirroring the gecko backend's evaluator shape:stylo_atoms: add thepointer/any-pointer/hover/any-hoverfeature-name atoms (first commit; builds standalone).style/queries/values.rs:PointerCapabilities(shared feature value).style/servo/media_features.rs:Pointer/Hoverkeyword evaluators + the fourMEDIA_FEATURESentries.style/device/servo.rs: apointer_capabilitiesfield defaulting to a desktop-class pointer (FINE | HOVER), withset_pointer_capabilitiesfor embedders on touch-first devices to override, and{,any_}pointer_capabilities()accessors.any-*resolves to the same set, as servo models a single pointer.Verification
Builds with
--features servo. Behaviour is exercised end-to-end by integration tests in a downstream consumer (Blitz):@media (hover: hover)/(pointer: fine)/ the bare andany-*forms match on the default desktop device, while(hover: none)/(pointer: coarse)do not.