Skip to content

Group media data into a struct + add getters/setters for the entire struct - #412

Open
nicoburns wants to merge 32 commits into
servo:mainfrom
nicoburns:better-media-update-api
Open

nicoburns wants to merge 32 commits into
servo:mainfrom
nicoburns:better-media-update-api

Conversation

@nicoburns

Copy link
Copy Markdown
Collaborator

This is aimed at trying to reduce the proliferation of getters/setters for individual media data properties by:

  • Grouping them into a struct
  • Adding getters/setters for the entire struct.

It also (IMO) makes the Device constructor a lot nicer as you get field names rather than having to try to match up function parameter order.

In future we could consider removing the individual getters/setters (or making them private where they are called internally by Stylo), but this PR does not yet do that.

This PR is implemented on top of:

delan and others added 12 commits July 2, 2026 01:39
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 5685b27

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>
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
nicoburns and others added 17 commits July 8, 2026 08:39
)

A couple more keyword/bitflag properties that I'm implementing in Blitz,
and would like to enable behind the `layout.unimplemented` pref.

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

Servo PR: servo/servo#46118

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
Corresponding servo PR is at servo/servo#45492

Signed-off-by: Psychpsyo (Cameron) <60073468+Psychpsyo@users.noreply.github.com>
Removes `engine = "gecko"` from 11 SVG-specific CSS properties to be
enabled for servo:

- **Fill (3):** `fill`, `fill-opacity`, `fill-rule`
- **Stroke (8):** `stroke`, `stroke-width`, `stroke-linecap`,
`stroke-linejoin`, `stroke-dasharray`, `stroke-dashoffset`,
`stroke-miterlimit`, `stroke-opacity`

Also updates the `ComputedValues` size test (224 → 232) for the new
fields.

Servo [PR](servo/servo#45405)

---------

Signed-off-by: Mohamed Mostafa mu-mostafa98@gmail.com
Co-authored-by: Mohamed Mostafa <mu-mostafa98@gmail.com>
This is a partial revert of servo#340. Waiting for an available macOS runner
frequently takes very long, which makes it annoying when trying to land
multiple patches, since they need to also be coordinated with the
companion patches in Servo.

So I think it's better to not wait for the macOS job after all. We will
still wait for the Linux and Windows ones.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Already landed upstream:
https://phabricator.services.mozilla.com/D311004
(71a8a43)

Importing it here early to prevent other PRs from adding new
Servo-specific derives due to copy-pasting.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Removes `engine = "gecko"` from 8 SVG-geometric properties to be enabled
for servo:

- `x`
- `y`
- `cx`
- `cy`
- `rx`
- `ry`
- `r`
- `d`

Servo [PR](servo/servo#46558)

Signed-off-by: Mohamed Mostafa <mu.mostafa98@gmail.com>
servo#377)

Servo PR: servo/servo#45308

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
Oddly enough the longhand itself was already enabled. Its not yet
supported in servo though.

Servo PR: servo/servo#46618

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
…` if delay changes (servo#422)

If the delay in an animation changes, we still might need to update the
`Paused` state if the animation is moving from `Playing` to `Paused`.

Servo PR: servo/servo#46689

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
… Blitz (servo#426)

Enables `text-decoration-thickness`, `text-decoration-inset`,
`text-underline-offset`, and `text-underline-position` for Servo builds
of Stylo, behind the `layout.unimplemented` feature flag.

The shorthand `text-decoration` is updated to account for
`text-decoration-thickness` being enabled (this aligns Servo's
implementation with Gecko's for this property).

Servo PR:

- servo/servo#46592

---------

Signed-off-by: Nico Burns <nico@nicoburns.com>
Fixes: servo#433

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Every fragment in the fragment tree stores:

```rust
pub struct PseudoElementChain {
    pub primary: Option<PseudoElement>,
    pub secondary: Option<PseudoElement>,
}
```

… so this change reduces memory use slightly

Signed-off-by: Simon Sapin <simon@igalia.com>
Signed-off-by: Simon Sapin <simon@igalia.com>
With these changes, both the `color-scheme` CSS property is supported,
as well as the required logic to act upon it.

Supersedes and closes servo#411

Servo PR: servo/servo#47042

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
All members of these structs already derive/implement Clone, so this is
trivial. Required for cloning an HTMLLinkElement's source set when
constructing LinkProcessingOptions.

Signed-off-by: lumiscosity <averyrudelphe@gmail.com>
Drive-by: `math-auto` is not a case transform. It is more like `none`: a
stand-alone value that cannot be combined with `full-width` or
`full-size-kana` in spec grammar.

Servo PR: servo/servo#47225

Signed-off-by: Simon Sapin <simon@igalia.com>
jdm and others added 3 commits August 17, 2026 17:33
clip-path's calculations in servo occur while building the stacking
context. If the value changes, we need to rebuild the stacking context.

servo/servo#47256

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Changes made:
- Implement the
[animation-composition](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/animation-composition)
CSS property.
- Shares animation matrix decomposition logic with Gecko (fixes a couple
of regressions due to the Servo version of the code not rejecting
matrices with a zero determinant)

Implementation is entirely in Stylo.

Servo PR: servo/servo#47405
@nicoburns
nicoburns force-pushed the better-media-update-api branch from bbfa9ca to 3fa0f84 Compare August 24, 2026 22:20

@jdm jdm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Agreed; I think the current code is only going to expand over time so this is an improvement.

@Loirooriol
Loirooriol force-pushed the main branch 2 times, most recently from c65e829 to 9ee9ec6 Compare September 10, 2026 12:56
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.