Skip to content

Add remaining preference media queries#288

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

Add remaining preference media queries#288
lukewarlow wants to merge 15 commits intoservo: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

@lukewarlow lukewarlow force-pushed the preference-mqs branch 2 times, most recently from aeb91ff to f357935 Compare January 28, 2026 14:46
delan and others added 9 commits February 5, 2026 20:49
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 d99b4a5

Signed-off-by: Oriol Brufau <obrufau@igalia.com>

Sort static prefs by name (servo#303)

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>
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Loirooriol and others added 6 commits February 12, 2026 18:20
This preference is only used in Gecko-specific code, so it's unnecessary
for Servo.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This allows `XLang` to be used as a key in a `HashMap`.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Previously, Stylo was hard-coding the value for various preferences. Now
Stylo will only define the default value for the preferences, but if the
embedder sets a different value, the latter will be used instead.

For example, when not set otherwise, `layout.threads` used to default to
0 as any other i32 pref. However, this was a bad default, it meant that
embedders like Blitz were running Stylo single-threaded. With this
change we can make it default to -1, while still allowing Servo to set
it to 3.

For consistent defaults, this replaces most `style_config::get_bool()`
with `static_prefs::pref!()`.

Servo PR: servo/servo#42491

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Given [CSS Value
Spec](https://drafts.csswg.org/css-values-4/#url-empty), CSS url value
with empty string should be treated as invalid, and should not trigger
resource load. This change specifically fix a corner case [wpt
test](https://wpt.fyi/results/css/css-images/empty-background-image.html?label=master&label=experimental&product=chrome&product=edge&product=firefox&product=safari&product=servo&aligned).

See the wpt try run in [parallel servo PR
](servo/servo#42622)

---------

Signed-off-by: rayguo17 <tin.tun.aung1@huawei.com>
These crates used to have independent sets of preferences, which wasn't
ideal. Now that it's no longer the case, it doesn't make sense to keep
them as separate crates.

Servo PR: servo/servo#42605

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This adds `prefers-contrast`, `prefers-reduced-motion`, and `prefers-reduced-transparency`.

Signed-off-by: Luke Warlow <lwarlow@igalia.com>
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.

5 participants