Skip to content

Add remaining preference media queries - #288

Open
lukewarlow wants to merge 15 commits into
servo:mainfrom
lukewarlow:preference-mqs
Open

Add remaining preference media queries#288
lukewarlow wants to merge 15 commits into
servo:mainfrom
lukewarlow:preference-mqs

Conversation

@lukewarlow

Copy link
Copy Markdown
Member

This adds prefers-contrast, prefers-reduced-motion, and prefers-reduced-transparency.

Servo PR: servo/servo#42011

delan and others added 9 commits June 5, 2026 19:26
Any ancestors of this commit are from upstream mozilla-central, with
some filtering and renaming. Our patches and sync tooling start here.

The sync tooling has all been squashed into this commit, based on:
https://github.com/servo/stylo/commits/64731e10dc8ef87ef52aa2fb9f988c3b2530f3a7
This is a rebase of 2453c41

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
The unit of (1 / 2px) is definitely not a px. Right now we disallow
dividing by non-numbers, so enforce it.

Once we implement unit math we could start tracking exponents (and
support something like squared pixels etc).

Differential Revision: https://phabricator.services.mozilla.com/D304694
Servo PR: servo/servo#44978

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
@jdm

jdm commented Jun 14, 2026

Copy link
Copy Markdown
Member

We should rebase this change against the latest main branch and merge it.

Loirooriol and others added 5 commits June 15, 2026 08:25
We were previously using a mix of f32 and f64. Then it could happen that
we would first check that `a < b` in f64, but when converting to f32,
they might become equal due to the precision loss. Thus this could break
invariants in the logic, making a `debug_unreachable!()` reachable.

Servo PR: servo/servo#45682

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@abandonedwig.info>
Reverts servo#368

More work is required in Servo to integrate this.
Fixes servo#390

This feature is quite impactful as it is required for Tailwind's hover
styles to work.

Servo PR: servo/servo#45681

Signed-off-by: Nico Burns <nico@nicoburns.com>
…servo#388)

It's not possible to properly calculate these only looking at style,
because the results depends on the used `overflow` value.

Servo PR: servo/servo#45629

Signed-off-by: Martin Robinson <martin@abandonedwig.info>
This adds `prefers-contrast`, `prefers-reduced-motion`, and `prefers-reduced-transparency`.

Signed-off-by: Luke Warlow <lwarlow@igalia.com>
@lukewarlow

Copy link
Copy Markdown
Member Author

Fingers crossed this is rebased correctly.

@nicoburns nicoburns left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebase looks good to me :)
(but I'll hold off on merging until the Servo PR is updated and green)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants