Skip to content

fix(css): reconcile phantom properties (filter, backdrop-filter, text-shadow, overflow-wrap)#29

Merged
LeadcodeDev merged 1 commit into
mainfrom
fix/css-phantom-properties
Jul 18, 2026
Merged

fix(css): reconcile phantom properties (filter, backdrop-filter, text-shadow, overflow-wrap)#29
LeadcodeDev merged 1 commit into
mainfrom
fix/css-phantom-properties

Conversation

@LeadcodeDev

Copy link
Copy Markdown
Owner

Closes #12.

Goal: the schema stops advertising properties the engine ignores.

  • filter implemented (was written by the animator — blur_in/blur_out presets were mute — and by static styles, consumed nowhere): applied as a Skia image filter on the node's group layer, shared with opacity. All 10 FilterFn functions: blur & drop-shadow as image filters; brightness/contrast/saturate/grayscale/hue-rotate/invert/sepia/opacity as CSS Filter Effects spec color matrices. The Skia matrix translation convention (0..1 space) is locked by an invert(1) pixel regression test — the first implementation used 0..255 and the test caught it.
  • backdrop-filter implemented: backdrop save-layer clipped to the rounded border-box, composited before the node's own background — real glassmorphism. Pixel test: a hard black/white boundary stays sharp outside the panel and smears to greys inside it.
  • css text-shadow (list) bridged into Text and Counter painters via TextShadow::to_schema + Color::to_css_string; the component-level field keeps precedence; multiple shadows paint in reverse order (first on top).
  • overflow-wrap/text-overflow: still parsed (removal would break existing scenarios — CssStyle is deny_unknown_fields) but rustmotion validate now warns they are not rendered yet.

Tests: 5 new (backdrop pixel test, filter blur edges, invert convention, text-shadow bridge, validator warnings) — written red first. 138 total, all green.

Verify: cargo test --workspace ✓ · cargo fmt --check ✓ · clippy 0 warnings ✓

…unrendered props

The schema advertised properties the engine never painted:

- css filter: consumed nowhere although the animator writes it
  (blur_in/blur_out presets were mute). Now applied as a Skia image
  filter on the node's group layer (shared with opacity). All 10
  FilterFn functions implemented: blur/drop-shadow as image filters,
  the rest as CSS Filter Effects spec color matrices (translation
  column verified to be 0..1-space by an invert regression test).
- backdrop-filter: implemented via Skia backdrop save-layer clipped to
  the rounded border-box, before the node's own background paints
  (glassmorphism), with a pixel test on a hard boundary.
- css text-shadow (list form): parsed and silently dropped; now bridged
  into the Text and Counter painters (component-level field wins, all
  css shadows painted in reverse order so the first is on top).
- overflow-wrap / text-overflow: accepted but unrendered — validate now
  emits explicit warnings instead of staying silent (removal would
  break existing scenarios: CssStyle is deny_unknown_fields).
@LeadcodeDev
LeadcodeDev merged commit 107e781 into main Jul 18, 2026
@LeadcodeDev
LeadcodeDev deleted the fix/css-phantom-properties branch July 18, 2026 19:59
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.

fix(css): reconcile phantom properties (backdrop-filter, overflow-wrap, text-shadow typing)

1 participant