Skip to content

A render's warnings are mostly boilerplate, and CSS the page engine drops isn't reported at all #34

Closed

Description

@JimGHTB12

When a composition asks for something the page engine doesn't apply, the render still prints APPLIED and exits 0. What it says about the problem is either one warning among many unrelated ones, or nothing. An agent iterating on a film can't tell "drawn as written" from "drawn without some of it", so it tunes against output that silently differs from its code.

The app target already solves this: raea app check fails, listing every prop or value it couldn't honour from unmapped.json (apps/targets/src/portable.rs). Compositions have no equivalent.

Repro

import { AbsoluteFill, Composition, registerRoot } from "raea";
// outline text, gradient-filled text, and a font face whose file isn't there
const css = `@font-face { font-family: "Brand"; src: url("/media/fonts/not-here.woff2"); }`;
const big = { position: "absolute" as const, left: 20, fontSize: 64, fontWeight: 900, fontFamily: "Brand, Arial" };
function Clip() {
  return (
    <AbsoluteFill style={{ background: "#ffffff" }}>
      <style>{css}</style>
      <div style={{ ...big, top: 30, color: "transparent", WebkitTextStroke: "2px #111111" } as any}>OUTLINE</div>
      <div style={{ ...big, top: 150, color: "transparent", background: "linear-gradient(90deg, #e8174a, #2244ff)", backgroundClip: "text", WebkitBackgroundClip: "text" } as any}>GRADIENT</div>
    </AbsoluteFill>
  );
}
registerRoot(() => <Composition id="s" component={Clip} width={640} height={300} fps={30} durationInFrames={1} />);

raea render edit.tsx --frame 0 -o a.png on 0.1.0-canary.2, Windows 11:

  • The picture. "OUTLINE" is invisible, because -webkit-text-stroke is Gecko-only in stylo (engine = "gecko"). "GRADIENT" is a solid gradient box (Five smaller things found rendering on Windows: font URLs, a missing 3D manifest, --quality, a stale export after an .svg edit, a doc line #28).

  • The output. It printed APPLIED and exited 0, with 18 lines of output, 10 of them WARN:

    • 7 are boilerplate every render prints, from bevy_asset::io::web ("WebAssetPlugin is potentially insecure!") and bevy_asset::io::source (no assets folder or watcher). Trivial 2D and 3D renders print 4 to 7 of these.
    • 2 are fontdb failing to parse Windows system fonts (mstmc.ttf).
    • 1 is the missing font face, from raea_sys_page_net.
  • Nothing mentions the outline or the gradient. Every stylesheet and style-attribute parse in vendor/blitz-dom passes no error reporter:

    • net.rs:152 and net.rs:269;
    • document.rs:85 and document.rs:1256;
    • node/element.rs:686;
    • resolved_style.rs:187;
    • cssom.rs:949.

    So stylo drops what it can't parse without telling anyone. Stylo has the hook for this: ParseErrorReporter in vendor/stylo/error_reporting.rs:201.

Stylo's tables don't answer "what does raea support?" either. raea enables more than stock Servo: backdrop-filter, mask-image and text-wrap: balance all work here, though Servo marks the first two unimplemented. A report from the engine itself is the only reliable list an agent can act on.

Suggestion, in two steps

  1. Quiet the boilerplate. Add bevy_asset::io::web=error,bevy_asset::io::source=error to the LogPlugin filters at engine/page/src/motion.rs:184 and engine/render/src/engine/open.rs:49, and keep fontdb's system-font scan from logging fonts it skips. Then a WARN line in a render means something. This is a few lines.

  2. Collect what the page didn't apply into one list. Gather:

    • the loads FileNet couldn't serve (systems/page-net/src/lib.rs:41-51);
    • the declarations stylo drops, through a ParseErrorReporter passed at those parse sites.

    Print the list once when the render ends, for example NOTE the page didn't apply 3 things: -webkit-text-stroke (×1), background-clip: text (×1), font file /media/fonts/not-here.woff2, and write it into --manifest, as unmapped.json does for apps. A --strict flag could turn any of them into REFUSED for agents that want to fail fast.

The design of step 2 is your call: where the list lives, and whether a drop inside @supports should count. I'm happy to send step 1 as a PR now, and step 2 if you want it in this shape.

Activity

  1. shinyobjectz commented on Nov 8, 2026

    @shinyobjectz
    Owner

    Thank you, @JimGHTB12. The repro and the list of parse sites pointed straight at the fix. Both steps are on main as 30960ed, and one more bug they turned up is fixed in 22074b5. Thanks too for offering the PR; the orchestrator had already scheduled this, so it's done here.

    Step 1, the noise. Your filters are in both LogPlugins (bevy_asset::io::web and io::source at error), along with fontdb=error. On macOS most of the noise came from somewhere else: io/trace's log logger, which every third-party log record goes through, printed INFO and up, including two Ctrl+C handler lines on every render and fontdb's skipped faces. It now prints only warnings and errors, and never fontdb's. Every record still goes to the trace's events.jsonl. Your page now prints APPLIED and the note, and no other WARN or INFO line.

    Step 2, what the page didn't apply.

    • vendor/blitz-dom/src/not_applied.rs is a stylo ParseErrorReporter. It's passed at every author parse site you listed (stylesheets and @import, <style>, style attributes, CSSOM), never the user-agent sheet.

    • Each drop is kept once per property and selector, never its value, because a style attribute is parsed again on every frame it changes.

    • FileNet's failed loads join the same list.

    • The render prints it once after APPLIED, for TSX and HTML both, and --manifest gets it as not_applied. For your page:

      NOTE  the page didn't apply 2 things, and is drawn without them:
        -webkit-text-stroke in a style attribute
        the file file:///…/media/fonts/not-here.woff2 (it didn't load)
      

      It shows at most 20 lines, with a count of the rest.

    Two decisions you left to us:

    • Vendor prefixes. Stylo never reports an unknown property with a -webkit-, -ms- or -o- prefix (is_non_mozilla_vendor_identifier), which would have hidden -webkit-text-stroke. Our vendored stylo reports them now, and raea's reporter skips the prefixed properties that change nothing in a picture (text-size-adjust, tap-highlight-color, font-smoothing, appearance, user-select and the like). A Tailwind page with gradients, rings, blur and truncate prints no note.
    • @supports. A drop inside @supports counts like any other. I left --strict out for now; the manifest's not_applied gives an agent the same signal to fail on.

    What the note can't see. It lists what stylo drops at parse. CSS that parses but isn't painted isn't on it. Your background-clip: text is one: it parses, and blitz-paint fills the box instead of clipping to the glyphs. I've passed that on as its own gap.

    The bug it turned up (22074b5). On an HTML page, every vendor-prefixed inline style was lost. The HTML runtime keys a prefixed style the way Chrome's style object does (webkitTextStroke), and our camelCase-to-CSS step only gave WebkitX its leading dash, so -webkit-line-clamp and the rest became webkit-…, which stylo drops. The note showed webkit-background-clip, which is how it was found.

    Checks.

    • bench/dropped-css/check.sh renders your page as TSX (30 frames, with the outline moving so its style attribute is parsed every frame) and as HTML. Each must exit 0 and name the outline and the font once each, with no boilerplate lines, and the manifest must list both. It fails on the raea before this and passes now.
    • RAEA_NOT_APPLIED=0 parses without the reporter, for measuring. On one build, seven alternating rounds, the worst case (600 frames dropping a declaration on every frame) had a median of 516 fps with the reporter and 479 without, and an HTML page 202 and 172. That's within the noise of a busy machine, so no cost shows.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions