Skip to content

Use static slice for supported media features. - #405

Open
jdm wants to merge 25 commits into
mainfrom
jdm-patch-1
Open

Use static slice for supported media features.#405
jdm wants to merge 25 commits into
mainfrom
jdm-patch-1

Conversation

@jdm

@jdm jdm commented Jun 28, 2026

Copy link
Copy Markdown
Member

This reduces the risk of merge conflicts when adding new media features.

delan and others added 25 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>
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 #368

More work is required in Servo to integrate this.
Fixes #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>
…#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>
Fixes a compile warning from #388.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Performs some changes so that Servo will be able to use these:
- `ComputedFontWeightRange`
- `ComputedFontStretchRange`
- `ComputedFontStyleDescriptor`

Servo PR: servo/servo#45821

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
The implementation does the same as what gecko does (except that I
didn't add support for `device-aspect-ratio`, hence slightly simpler /
inlined.

Servo PR: servo/servo#45490

---------

Signed-off-by: Martin Robinson <martin@abandonedwig.info>
Co-authored-by: Martin Robinson <martin@abandonedwig.info>
This method was performing a single iteration. But most callers want to
perform multiple iterations, so they were calling it in a loop.

So this patch replaces `iterate()` with `iterate_by()`, which takes the
desired number of iterations as a parameter, and returns the actual
number of iterations that were performed.

Servo PR: servo/servo#45978

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

It was only incremented for finite animations, but infinite animations
need to be incremented too.

Servo PR: servo/servo#45990

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Needed for servo/servo#45901

The servo PR is already approved, feel free to merge this immediately.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
I noticed a typo in the README file of the `selectors` library.

Signed-off-by: Vlad Negară <150728638+VladNegara@users.noreply.github.com>
Servo PR: servo/servo#44978

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Transitions can sometimes have 0 duration when the transition reversing
shortening factor is also calculated to be 0. When that happens, we
should always use 1.0 for the progress when calculating the value for
the transition. This avoid division by zero.

Servo PR: servo/servo#46016

Signed-off-by: Martin Robinson <mrobinson@abandonedwig.info>
It's fine to subtract `n` when the value is `n`, we just don't want to
get negative.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Signed-off-by: Josh Matthews <josh@joshmatthews.net>

@Loirooriol Loirooriol 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.

Interesting. I guess while you are at it, could do it for Gecko's MEDIA_FEATURES. And for CONTAINER_FEATURES. And FeatureType::features() does no longer need to use & for them.

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.

9 participants