Skip to content

CSS checked against the specs (with Lean proofs), one test binary - #63

Merged
ppmpreetham merged 3 commits into
mainfrom
css-specs
Nov 25, 2026
Merged

ppmpreetham merged 3 commits into
mainfrom
css-specs

Conversation

@ppmpreetham

Copy link
Copy Markdown
Owner

What does this change?

Stacked on #62 (base android-rust); merge that first. Three commits:

merge tests

  • blenderui's 64 integration test files become one binary, tests/suite/. Each file used to link the whole kit.
  • Seven stay separate because they change or measure process-wide state: theme, theme_custom, theme_own_keys, shadcn (the theme), text_metrics (BUI_UI_SCALE), host_start (the pixel scale; next to the others it caused an access violation) and image_memory, video (counting allocators).
  • Dev builds keep line tables only (profile.dev).
  • A full workspace test build went from 22 GB to 4.6 GB.
  • Docs and website test paths and commands are updated (cargo test --test suite parity::).

lean proofs

  • proofs/ (Lean 4.36, no dependencies, outside the Rust build): selector specificity is a total order, :where() adds nothing, :is() / :not() / :has() count as their most specific argument, adding a simple selector never lowers it.
  • The order cascade_order applies declarations in is exactly CSS Cascade 5's, for normal and !important declarations; a counterexample shows the old order wasn't.
  • #eval vectors prints the test cases a Rust test checks the parser against.

css fixes

  • Cascade:
    • !important reverses layers and origins.
    • ! important and !IMPORTANT count as important, also in css!.
  • Selectors:
    • :has() specificity.
    • :scope inside @scope.
    • :empty: every element matched it before.
    • :has(+ x) and :has(~ x).
    • :nth-last-child(An+B of S): the following siblings are answered on the source tree, like :has().
  • Values:
    • rem and the root units use the root's font size.
    • Out-of-range rgb() channels clamp.
  • Theme: light-dark(), system colors and prefers-color-scheme follow it. Windows re-render when the theme changes.
  • Layout: boxes lay out at fractional positions as in a browser (element_bounds 47.5, not 48). Painting snaps box edges to device pixels; canvases stay anti-aliased.

How was it tested?

  • ctest --test-dir build passes
  • cargo test passes for blenderui at this commit; the whole workspace passed in the working tree
  • Added or updated a test for this change: tests/suite/css_spec.rs (a regression test per fix, plus the Lean vectors) and the extended tests/theme.rs
  • Benchmarks attached (for rendering or layout changes)

bui-panels and bui-charts tests also pass against these changes. lake build in proofs/ succeeds; #print axioms lists only Lean's standard axioms.

Checklist

  • CHANGELOG.md updated (Unreleased)
  • Docs updated (docs/rust.md, website CSS and testing pages)
  • New files carry the SPDX-License-Identifier: GPL-2.0-or-later header where the repo's files do (none of its Rust or Lean files have one)

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@ppmpreetham
ppmpreetham changed the base branch from android-rust to main November 25, 2026 11:02
@ppmpreetham
ppmpreetham merged commit cbab85c into main Nov 25, 2026
32 checks passed
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