Skip to content

chore(stylo): drop fork, upgrade to stylo 0.16 from crates.io#692

Merged
softmarshmallow merged 1 commit intohtmlcssfrom
feature/keen-mestorf-dc2262
Apr 24, 2026
Merged

chore(stylo): drop fork, upgrade to stylo 0.16 from crates.io#692
softmarshmallow merged 1 commit intohtmlcssfrom
feature/keen-mestorf-dc2262

Conversation

@softmarshmallow
Copy link
Copy Markdown
Member

Summary

servo/stylo#273 has shipped, so the gridaco/stylo fork pin can go. This swaps to crates.io stylo 0.16 (and sibling crates) and adapts the callsites to the new API surface.

API changes handled

  • Selectors — fork's selectors 0.33 → crates.io selectors 0.37.
  • TElement now requires AttributeProvider; implemented for both the production adapter and the standalone reference example.
  • Element data storageAtomicRefCell<Option<ElementData>>OnceLock<ElementDataWrapper>. ensure_data/borrow_data/mutate_data return the new ElementDataRef/Mut wrappers. clear_data is a no-op (matches Gecko's reuse-allocation semantics).
  • Stylist::flush — dropped its root/snapshot-map arguments.
  • Module movesstyle::servo::media_queries::{Device, FontMetricsProvider}style::device::{Device, servo::FontMetricsProvider}; QueryFontMetricsFlags moved from specified::font to computed::font.
  • BorderSideWidth is now a newtype over Au. Unwrap via .0.to_f32_px() and gate by border-style so none/hidden still zero the used width (the fork did this implicitly).
  • OverflowClipMargin became a struct; access via .offset.
  • GenericShapeRadius::Length keeps its NonNegative wrapper.
  • outline_has_nonzero_width() is gone; replaced by explicit outline-style + width checks.
  • Grid pref plumbing moved from stylo_config to stylo_static_prefs::set_pref!, which is what stylo 0.16 actually reads.

Test plan

  • cargo check -p cg -p grida-canvas-wasm -p grida-dev -p csscascade
  • cargo test -p cg --lib — 771 passed
  • cargo test across cg, csscascade, grida-dev, grida-canvas-wasm — all green
  • WASM debug build (just _build_wasm32_unknown_emscripten_debug)
  • Node smoke test (environment-node-smoke.test.ts) — passes
  • refbrowser L0.exact: 65/65 at 100.00%
  • refbrowser L0.coverage: avg 99.70%; sub-100 fixtures are all in already-documented divergence surfaces (gradients, dotted borders, blur shadows, outline AA) — no new regressions.

servo/stylo#273 has shipped, so we can drop the `gridaco/stylo` fork
pin that existed solely to get that fix ahead of release.

API adaptations required by the 0.9 → 0.16 bump:

- `selectors` fork replaced with crates.io `selectors 0.37`.
- `TElement` now requires `AttributeProvider`; implemented for both
  the real adapter and the standalone reference example.
- `ensure_data`/`borrow_data`/`mutate_data` return the new
  `ElementDataRef/Mut` types; per-element storage migrated from
  `AtomicRefCell<Option<ElementData>>` to `OnceLock<ElementDataWrapper>`.
  `clear_data` is a no-op (matches Gecko's reuse-allocation semantics).
- `Stylist::flush` dropped its root/snapshot arguments.
- Module moves: `style::servo::media_queries::{Device,FontMetricsProvider}`
  → `style::device::{Device, servo::FontMetricsProvider}`;
  `QueryFontMetricsFlags` moved from `specified::font` to `computed::font`.
- `BorderSideWidth` is now a newtype over `Au`; unwrap via
  `.0.to_f32_px()` and gate by border-style so `none/hidden` still
  zero the used width (the fork did this implicitly).
- `OverflowClipMargin` became a struct; access via `.offset`.
- `GenericShapeRadius::Length` keeps its `NonNegative` wrapper.
- `outline_has_nonzero_width()` removed; replaced by explicit
  outline-style + width checks.
- Grid pref plumbing moved from `stylo_config` to
  `stylo_static_prefs::set_pref!`, which is what stylo 0.16 reads.

Verified:
- `cargo check` / `cargo test` pass across cg, csscascade, grida-dev,
  grida-canvas-wasm (771 unit tests on cg).
- WASM debug build + Node smoke test pass.
- Refbrowser L0.exact: 65/65 at 100.00%. L0.coverage: avg 99.70%,
  no new regressions (sub-100 fixtures are all in the
  already-documented divergence surfaces: gradients, dotted borders,
  blur shadows, outline AA).
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blog Ready Ready Preview, Comment Apr 24, 2026 5:08am
docs Ready Ready Preview, Comment Apr 24, 2026 5:08am
grida Ready Ready Preview, Comment Apr 24, 2026 5:08am
viewer Ready Ready Preview, Comment Apr 24, 2026 5:08am
3 Skipped Deployments
Project Deployment Actions Updated (UTC)
backgrounds Ignored Ignored Preview Apr 24, 2026 5:08am
code Ignored Ignored Apr 24, 2026 5:08am
legacy Ignored Ignored Apr 24, 2026 5:08am

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 24, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a9282261-d537-4ae1-a64e-aa5ec5d0a6fc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/keen-mestorf-dc2262

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant