Skip to content

armgit / raea

Public Imported from GitHub
0

Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.

#34: a render says once, when it ends, what its page didn't apply, and its output loses the warnings no one acts on.

shinyobjectz30960ed5fa00
diff --git a/apps/media/src/command.rs b/apps/media/src/command.rs
index d79f84ea..026be2e5 100644
--- a/apps/media/src/command.rs
+++ b/apps/media/src/command.rs
@@ -55,6 +55,9 @@ fn run(args: Vec<String>) {
let frames = flag("--at").map(|at| at.split(',').map(|f| f.trim().parse().unwrap_or_else(|_| fail(format!("bad frame {f}")))).collect());
let opts = raea_runtime_encode::RenderOpts { frames, codec: flag("--codec"), kbps: flag("--kbps").and_then(|k| k.parse().ok()), quality: flag("--quality").map(|q| raea_io_media::parse_quality(&q).unwrap_or_else(|e| fail(e))), ssim: flag_on("--ssim"), sound: None, ten_bit: flag_on("--10bit") };
raea_runtime_encode::render_file(&arg(1), &out, &opts).unwrap_or_else(|e| fail(e));
+ if let Some(note) = raea_page::not_applied::said() {
+ println!("{note}");
+ }
}
"shots" => {
let size = flag("--size").map(|s| s.split_once('x').and_then(|(w, h)| Some((w.parse().ok()?, h.parse().ok()?))).unwrap_or_else(|| fail(format!("bad --size {s} (WxH)"))));
diff --git a/bench/dropped-css/check.sh b/bench/dropped-css/check.sh
new file mode 100755
index 00000000..5706bb85
--- /dev/null
+++ b/bench/dropped-css/check.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+# #34: a render says once, when it ends, what its page didn't apply, and its output is otherwise free of warnings no
+# one acts on. page.tsx (30 frames; its outline's style attribute parsed again each frame) and index.html each draw
+# outline text (-webkit-text-stroke, which stylo drops) with a font face whose file isn't there. Each render must exit
+# 0, print one NOTE naming -webkit-text-stroke and the missing file once each, and print no INFO line and no bevy_asset
+# or fontdb warning; page.tsx's --manifest must list them under not_applied. Exits 1 on a failure.
+# bench/dropped-css/check.sh (RAEA_BIN: the raea to run, default target/release/raea)
+cd "$(dirname "$0")/../.." || exit 2
+BIN=${RAEA_BIN:-$PWD/target/release/raea}
+export RAEA_SIGN=0 RAEA_MARK=0 RAEA_EXPORT_CACHE=0
+OUT=$(mktemp -d "${TMPDIR:-/tmp}/raea-dropped-css.XXXXXX")
+trap 'rm -rf "$OUT"' EXIT
+status=0
+check() { # NAME LOG RC
+ local name=$1 log=$2 rc=$3 bad=""
+ [ "$rc" = 0 ] || bad+=" exit $rc;"
+ [ "$(grep -c '^NOTE the page didn.t apply' "$log")" = 1 ] || bad+=" not one NOTE;"
+ [ "$(grep -c -- '-webkit-text-stroke in ' "$log")" = 1 ] || bad+=" -webkit-text-stroke not listed once;"
+ [ "$(grep -c 'not-here.woff2 (it didn.t load)' "$log")" = 1 ] || bad+=" the missing font not listed once;"
+ ! grep -qE 'INFO|WARN (bevy_asset|fontdb)|\[WARN fontdb' "$log" || bad+=" boilerplate printed;"
+ if [ -z "$bad" ]; then echo "PASS $name"; else echo "FAIL $name:$bad (log below)"; sed 's/^/ /' "$log"; status=1; fi
+}
+"$BIN" render bench/dropped-css/page.tsx -o "$OUT/page.mp4" --manifest "$OUT/m.json" > "$OUT/page.log" 2>&1
+check page.tsx "$OUT/page.log" $?
+listed=$(grep -o '"not_applied":\[[^]]*\]' "$OUT/m.json" 2>/dev/null)
+if [[ $listed == *-webkit-text-stroke* && $listed == *not-here.woff2* ]]; then echo "PASS page.tsx manifest: $listed"
+else echo "FAIL page.tsx manifest: not_applied is ${listed:-missing}"; status=1; fi
+"$BIN" render bench/dropped-css/index.html -o "$OUT/html.mp4" > "$OUT/html.log" 2>&1
+check index.html "$OUT/html.log" $?
+exit $status
diff --git a/bench/dropped-css/index.html b/bench/dropped-css/index.html
new file mode 100644
index 00000000..45405128
--- /dev/null
+++ b/bench/dropped-css/index.html
@@ -0,0 +1,13 @@
+<!doctype html>
+<!-- #34: page.tsx as plain HTML (an outline in a stylesheet rule this time). bench/dropped-css/check.sh -->
+<html><head><meta charset="utf-8">
+<style>
+@font-face { font-family: "Brand"; src: url("/media/fonts/not-here.woff2"); }
+html,body{margin:0;width:640px;height:300px;background:#fff}
+.big{position:absolute;left:20px;font-size:64px;font-weight:900;font-family:Brand, Arial}
+.outline{top:30px;color:transparent;-webkit-text-stroke:2px #111}
+</style></head><body>
+<div id="root" data-composition-id="main" data-start="0" data-width="640" data-height="300" data-duration="1">
+<div class="big outline">OUTLINE</div>
+<div class="big" style="top:150px;color:transparent;background:linear-gradient(90deg,#e8174a,#2244ff);background-clip:text;-webkit-background-clip:text">GRADIENT</div>
+</div></body></html>
diff --git a/bench/dropped-css/page.tsx b/bench/dropped-css/page.tsx
new file mode 100644
index 00000000..0982be89
--- /dev/null
+++ b/bench/dropped-css/page.tsx
@@ -0,0 +1,16 @@
+// #34: outline text, gradient-filled text, and a font face whose file isn't there (the reporter's page), its outline
+// moving so its style attribute is parsed again on every frame. bench/dropped-css/check.sh
+import { AbsoluteFill, Composition, registerRoot, useCurrentFrame } from "raea";
+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() {
+ const f = useCurrentFrame();
+ return (
+ <AbsoluteFill style={{ background: "#ffffff" }}>
+ <style>{css}</style>
+ <div style={{ ...big, top: 30 + f, 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={30} />);
diff --git a/docs/settings.md b/docs/settings.md
index 14f7415f..8636885a 100644
--- a/docs/settings.md
+++ b/docs/settings.md
@@ -48,4 +48,5 @@ libraries (pianos, General MIDI instruments, orchestral and percussion samples,
|---|---|
| `RAEA_VELLO_BUMP=full` | Pages are drawn with Vello's own buffer sizes from the first frame, instead of raea's smaller ones (about 100 MB less GPU memory). A page past raea's sizes is found and drawn again at Vello's anyway, with a line on stderr, so this only saves that redraw |
| `RAEA_PAGE_DRAWN_CHECK=0` | Pages are drawn without checking that Vello drew them. For measuring what the check costs (about 2% in one test): a page past Vello's buffers then shows the frame before it again, or nothing |
+| `RAEA_NOT_APPLIED=0` | A page's CSS is parsed without noting what stylo drops, so a render ends without its NOTE of what the page didn't apply (and its manifest's `not_applied` lists only loads that failed). For measuring what the note costs |
| `RAEA_PANIC_FAULT=N` | A panic while frame N draws, for checking what a failing render keeps (bench/frame-panic). The render then ends with an error naming the frame and the panic, and keeps the frames drawn before it |
diff --git a/engine/cli/src/cli.rs b/engine/cli/src/cli.rs
index f06c0d26..125527a7 100644
--- a/engine/cli/src/cli.rs
+++ b/engine/cli/src/cli.rs
@@ -52,12 +52,12 @@ pub fn cli(args: &[String]) -> i32 {
// Credentials saying raea drew it, and a PNG's pixels carry its export id (raea_io_media::sign)
if raea_io_media::signs() && args.first().map(String::as_str) == Some("render") {
let still = flag(args, "-o").map(PathBuf::from).filter(|o| o.is_file() && matches!(o.extension().and_then(|e| e.to_str()), Some("png" | "jpg" | "jpeg" | "webp")));
- if let Some(o) = still {
- raea_io_media::sign::sign_file(&o, raea_io_media::sign::Made::Created);
- }
+ if let Some(o) = still { raea_io_media::sign::sign_file(&o, raea_io_media::sign::Made::Created); }
}
- if !msg.is_empty() {
- println!("{msg}");
+ // and once, what the page asked for and didn't get (#34: dropped CSS, loads that failed)
+ let said = raea_runtime_export::not_applied::said().filter(|_| args.first().is_some_and(|a| a == "render"));
+ for line in [msg].into_iter().chain(said).filter(|m| !m.is_empty()) {
+ println!("{line}");
}
0
}
diff --git a/engine/page/src/lib.rs b/engine/page/src/lib.rs
index 6e298f38..b2240f1c 100644
--- a/engine/page/src/lib.rs
+++ b/engine/page/src/lib.rs
@@ -7,6 +7,8 @@
pub mod feed;
pub mod html;
pub mod motion;
+/// What the page asked for and didn't get (#34), said once when a render ends
+pub use blitz_dom::not_applied;
/// B3 H11's scenarios: the hooks together (bench/bridge/run.sh)
#[cfg(test)]
mod scenarios;
diff --git a/engine/page/src/motion.rs b/engine/page/src/motion.rs
index bf4f4d00..1e108d0f 100644
--- a/engine/page/src/motion.rs
+++ b/engine/page/src/motion.rs
@@ -181,7 +181,7 @@ impl BlitzPage {
let mut app = App::new();
let mut group = DefaultPlugins
.set(WindowPlugin { primary_window: None, exit_condition: ExitCondition::DontExit, close_when_requested: false, ..default() })
- .set(bevy::log::LogPlugin { level: bevy::log::Level::WARN, filter: format!("{}bevy_log=off", bevy::log::DEFAULT_FILTER), ..default() })
+ .set(bevy::log::LogPlugin { level: bevy::log::Level::WARN, filter: format!("{}bevy_log=off,bevy_asset::io::web=error,bevy_asset::io::source=error,fontdb=error", bevy::log::DEFAULT_FILTER), ..default() })
// the render world stays the App's sub-app, as raea-runtime-js's page keeps it: a readback waits on the device it
// finds there (offscreen.rs), and the page's textures are looked up in it. Pipelined, the frame's readback
// ran 32 updates without a wait and came back empty under a busy 3D render (kitchen/sky.tsx, real/*.tsx)
diff --git a/engine/render/src/engine/open.rs b/engine/render/src/engine/open.rs
index 9f3a79dd..38325bbe 100644
--- a/engine/render/src/engine/open.rs
+++ b/engine/render/src/engine/open.rs
@@ -46,7 +46,7 @@ impl Engine {
// quiet on a good run: bevy_log's "Could not set global logger" (raea_io_trace owns `log` in a play
// or a render, and its records go there, as meant) and a pass-timing readback that missed a frame
// (RenderDiagnosticsPlugin's "Failed to download render statistics buffer": one second's bevy_passes lost)
- .set(bevy::log::LogPlugin { level: bevy::log::Level::WARN, filter: format!("{}bevy_log=off,bevy_render::diagnostic::internal=error", bevy::log::DEFAULT_FILTER), ..default() })
+ .set(bevy::log::LogPlugin { level: bevy::log::Level::WARN, filter: format!("{}bevy_log=off,bevy_asset::io::web=error,bevy_asset::io::source=error,fontdb=error,bevy_render::diagnostic::internal=error", bevy::log::DEFAULT_FILTER), ..default() })
// glTF models (scene3d) load from the paths their rows name, which are the edit's files wherever they are.
// Hot reload (Bevy's file_watcher, in the bevy-all build) only when asked, RAEA_BEVY_WATCH=1: a render or a
// baked play reloading an asset mid-run would draw frames that a render alone doesn't
diff --git a/io/trace/src/lib.rs b/io/trace/src/lib.rs
index 55a5d2f2..e5d81bd3 100644
--- a/io/trace/src/lib.rs
+++ b/io/trace/src/lib.rs
@@ -311,8 +311,13 @@ impl log::Log for Logger {
if !self.enabled(r.metadata()) {
return;
}
- // printed as before (stderr, itself kept in stderr.log), and a line in events.jsonl
- eprintln!("[{} {}] {}", r.level(), r.target(), r.args());
+ // a line in events.jsonl, and on stderr (itself kept in stderr.log) only a warning or an error a render's reader
+ // acts on: the `log` crate is third-party crates' (Bevy's Ctrl+C handler at info, fontdb's skipped faces: a
+ // system font it can't parse, or a missing @font-face file raea_sys_page_net already names), which printed
+ // on every render and buried what mattered (#34)
+ if r.level() <= log::Level::Warn && !r.target().starts_with("fontdb") {
+ eprintln!("[{} {}] {}", r.level(), r.target(), r.args());
+ }
event("log", json!({"level": r.level().as_str(), "target": r.target(), "message": r.args().to_string()}));
}
fn flush(&self) {}
diff --git a/runtime/export/src/lib.rs b/runtime/export/src/lib.rs
index 08b3e129..53126cb8 100644
--- a/runtime/export/src/lib.rs
+++ b/runtime/export/src/lib.rs
@@ -44,6 +44,7 @@ pub use render::*;
mod review;
mod run;
pub use run::*;
+pub use raea_sys_page::not_applied;
mod scene;
pub use scene::{USAGE as SCENE_USAGE, cli as scene_cli};
@@ -69,7 +70,7 @@ static MANIFEST: std::sync::Mutex<Option<PathBuf>> = std::sync::Mutex::new(None)
/// With --manifest, its file: the frames' boxes as drawn (Ctx.manifest), the 3D's clipping and the sounds heard.
fn write_manifest(cx: &mut Ctx, (w, h, fps): (u32, u32, f64), clipping: Vec<Value>, heard: impl FnOnce(&Ctx) -> Value) -> R<()> {
let (Some(path), Some(frames)) = (MANIFEST.lock().unwrap().clone(), cx.manifest.take()) else { return Ok(()) };
- let m = json!({"width": w, "height": h, "fps": fps, "frames": frames, "clipping": clipping, "sounds": heard(cx)});
+ let m = json!({"width": w, "height": h, "fps": fps, "frames": frames, "clipping": clipping, "sounds": heard(cx), "not_applied": not_applied::seen()});
std::fs::write(&path, m.to_string()).map_err(|e| format!("{}: {e}", path.display()))
}
diff --git a/systems/page-net/src/lib.rs b/systems/page-net/src/lib.rs
index 718f8453..b682a25d 100644
--- a/systems/page-net/src/lib.rs
+++ b/systems/page-net/src/lib.rs
@@ -50,6 +50,10 @@ impl NetProvider for FileNet {
if bytes.is_none() && (!matches!(url.scheme(), "http" | "https") || url.host_str() == Some("localhost")) {
bevy::log::warn!("raea-page: {url} isn't a file, a data URL or a URL that reads");
}
+ if bytes.is_none() {
+ // listed once more when the render ends, with the CSS the page dropped (#34)
+ blitz_dom::not_applied::note(format!("the file {url} (it didn't load)"));
+ }
handler.bytes(url.to_string(), Bytes::from(bytes.unwrap_or_default()));
}
}
diff --git a/systems/page/src/lib.rs b/systems/page/src/lib.rs
index 2b264a52..618188c4 100644
--- a/systems/page/src/lib.rs
+++ b/systems/page/src/lib.rs
@@ -20,6 +20,7 @@ mod draw;
mod skipped;
/// a page's loads (raea-sys-page-net: FileNet, FrameNet, the page's fetch, the image decoder)
pub use raea_sys_page_net as net;
+pub use blitz_dom::not_applied; // what the page asked for and didn't get, said once when a render ends (#34)
/// Blitz's extension points as Bevy resources (S6d)
pub mod providers;
pub mod widgets;
diff --git a/vendor/blitz-dom/src/cssom.rs b/vendor/blitz-dom/src/cssom.rs
index 11df06fd..279f18f1 100644
--- a/vendor/blitz-dom/src/cssom.rs
+++ b/vendor/blitz-dom/src/cssom.rs
@@ -949,7 +949,7 @@ impl BaseDocument {
let new_block = style::properties::declaration_block::parse_style_attribute(
css,
&self.url.url_extra_data(),
- None,
+ crate::not_applied::reporter(), // raea: what stylo drops is noted (#34)
QuirksMode::NoQuirks,
rule_type,
);
diff --git a/vendor/blitz-dom/src/document.rs b/vendor/blitz-dom/src/document.rs
index f4c36f59..60616a5b 100644
--- a/vendor/blitz-dom/src/document.rs
+++ b/vendor/blitz-dom/src/document.rs
@@ -1273,7 +1273,8 @@ impl BaseDocument {
abort_signal: self.abort_signal.clone(),
import_depth: 0,
}),
- None,
+ // raea: (#34) what stylo drops from the page's own CSS is noted
+ crate::not_applied::reporter().filter(|_| origin == Origin::Author),
QuirksMode::NoQuirks,
AllowImportRules::Yes,
);
diff --git a/vendor/blitz-dom/src/lib.rs b/vendor/blitz-dom/src/lib.rs
index d73fc026..3ba678d1 100644
--- a/vendor/blitz-dom/src/lib.rs
+++ b/vendor/blitz-dom/src/lib.rs
@@ -83,6 +83,7 @@ pub use stylo_to_kurbo::resolve_2d_transform;
pub use stylo_to_kurbo::{Projection, preserves_3d};
pub mod net;
+pub mod not_applied;
pub mod util;
#[cfg(feature = "accessibility")]
diff --git a/vendor/blitz-dom/src/net.rs b/vendor/blitz-dom/src/net.rs
index 897e54a2..4936f96f 100644
--- a/vendor/blitz-dom/src/net.rs
+++ b/vendor/blitz-dom/src/net.rs
@@ -163,7 +163,7 @@ impl NetHandler for ResourceHandler<StylesheetHandler> {
abort_signal: self.data.abort_signal.clone(),
import_depth: 0,
}),
- None, // error_reporter
+ crate::not_applied::reporter(), // raea: (#34) what stylo drops is noted
QuirksMode::NoQuirks,
AllowImportRules::Yes,
);
@@ -273,7 +273,7 @@ impl NetHandler for ResourceHandler<NestedStylesheetHandler> {
self.data.media.clone(),
self.data.lock.clone(),
Some(&self.data.loader),
- None, // error_reporter
+ crate::not_applied::reporter(), // raea: (#34) what stylo drops is noted
QuirksMode::NoQuirks,
AllowImportRules::Yes,
));
diff --git a/vendor/blitz-dom/src/node/element.rs b/vendor/blitz-dom/src/node/element.rs
index 16cc0364..ee30b9fb 100644
--- a/vendor/blitz-dom/src/node/element.rs
+++ b/vendor/blitz-dom/src/node/element.rs
@@ -686,7 +686,7 @@ impl ElementData {
ServoArc::new(guard.wrap(parse_style_attribute(
style_str,
url_extra_data,
- None,
+ crate::not_applied::reporter(), // raea: what stylo drops is noted (#34)
QuirksMode::NoQuirks,
CssRuleType::Style,
)))
diff --git a/vendor/blitz-dom/src/not_applied.rs b/vendor/blitz-dom/src/not_applied.rs
new file mode 100644
index 00000000..04472e09
--- /dev/null
+++ b/vendor/blitz-dom/src/not_applied.rs
@@ -0,0 +1,84 @@
+//! raea: what a page asked for and didn't get (#34): the author CSS stylo dropped as it parsed (a property or value it
+//! doesn't know, a rule it can't read), and the loads the net provider couldn't serve. Stylo drops what it can't parse
+//! silently unless a `ParseErrorReporter` is passed, so a render printed APPLIED over a picture missing some of its
+//! code. Each is kept once per property and selector (a style attribute is parsed again on every frame it changes), in
+//! the order first seen, for the render to print once at its end and write into its manifest (`take`).
+//! User-agent sheets get no reporter: what they drop isn't the page's.
+
+use std::sync::Mutex;
+use style::error_reporting::{ContextualParseError, ParseErrorReporter};
+use style::stylesheets::UrlExtraData;
+use cssparser::ToCss as _;
+
+static SEEN: Mutex<Vec<String>> = Mutex::new(Vec::new());
+
+/// The reporter passed where author CSS is parsed (net.rs, document.rs, node/element.rs, cssom.rs).
+pub struct Reporter;
+static REPORTER: Reporter = Reporter;
+
+/// The reporter for an author parse, or None with RAEA_NOT_APPLIED=0 (the parse as before: for measuring what it costs).
+pub fn reporter() -> Option<&'static dyn ParseErrorReporter> {
+ static ON: std::sync::OnceLock<bool> = std::sync::OnceLock::new();
+ ON.get_or_init(|| std::env::var_os("RAEA_NOT_APPLIED").is_none_or(|v| v != "0")).then_some(&REPORTER as &dyn ParseErrorReporter)
+}
+
+impl ParseErrorReporter for Reporter {
+ fn report_error(&self, _url: &UrlExtraData, _at: cssparser::SourceLocation, error: ContextualParseError) {
+ if let Some(what) = describe(&error) {
+ note(what);
+ }
+ }
+}
+
+/// One thing the page didn't get, in words (kept once).
+pub fn note(what: String) {
+ let mut seen = SEEN.lock().unwrap_or_else(|e| e.into_inner());
+ if !seen.contains(&what) {
+ seen.push(what);
+ }
+}
+
+/// What the page didn't get since the last take, in the order first seen.
+pub fn take() -> Vec<String> {
+ std::mem::take(&mut *SEEN.lock().unwrap_or_else(|e| e.into_inner()))
+}
+
+/// Properties a page commonly sets (Tailwind's preflight, CSS resets) that change nothing in a rendered picture, under
+/// any vendor prefix: dropping them is no loss, and saying so on every render would be noise again.
+const UNSEEN: &[&str] = &["text-size-adjust", "tap-highlight-color", "font-smoothing", "osx-font-smoothing", "appearance", "user-select", "touch-callout", "overflow-scrolling", "user-drag", "tab-size", "focus-ring-color"];
+
+/// A short line for a drop: its property (or rule) and where, never its value, so one property dropped in one rule
+/// is one line however often it's parsed.
+fn describe(e: &ContextualParseError) -> Option<String> {
+ let short = |s: &str| {
+ let s = s.split_whitespace().collect::<Vec<_>>().join(" ");
+ if s.chars().count() > 60 { format!("{}…", s.chars().take(60).collect::<String>()) } else { s }
+ };
+ let name = |decl: &str| decl.split(':').next().unwrap_or(decl).trim().to_string();
+ Some(match e {
+ ContextualParseError::UnsupportedPropertyDeclaration(decl, _, _) if UNSEEN.iter().any(|p| name(decl).trim_start_matches(['-', '_']).ends_with(p)) || name(decl).starts_with('_') => return None,
+ ContextualParseError::UnsupportedPropertyDeclaration(decl, _, selectors) => {
+ let at = selectors.last().map_or("a style attribute".to_string(), |s| s.to_css_string());
+ format!("{} in {}", name(decl), short(&at))
+ }
+ ContextualParseError::UnsupportedFontFaceDescriptor(decl, _) => format!("{} in @font-face", name(decl)),
+ ContextualParseError::InvalidRule(rule, _) | ContextualParseError::UnsupportedRule(rule, _) => format!("the rule {}", short(rule.split('{').next().unwrap_or(rule))),
+ ContextualParseError::InvalidKeyframeRule(rule, _) => format!("the keyframe {}", short(rule)),
+ ContextualParseError::InvalidMediaRule(rule, _) => format!("@media {}", short(rule)),
+ _ => return None,
+ })
+}
+
+/// What the page didn't get so far, left in place (the render's manifest, `not_applied`).
+pub fn seen() -> Vec<String> {
+ SEEN.lock().unwrap_or_else(|e| e.into_inner()).clone()
+}
+
+/// The note a render ends with, once (the list taken): what its page didn't apply, or None when it applied it all.
+pub fn said() -> Option<String> {
+ let all = take();
+ let n = all.len();
+ let more = if n > 20 { format!("\n and {} more", n - 20) } else { String::new() };
+ let list: String = all.iter().take(20).map(|w| format!("\n {w}")).collect();
+ (n > 0).then(|| format!("NOTE the page didn't apply {n} thing{}, and is drawn without {}:{list}{more}", if n == 1 { "" } else { "s" }, if n == 1 { "it" } else { "them" }))
+}
diff --git a/vendor/stylo/properties/declaration_block.rs b/vendor/stylo/properties/declaration_block.rs
index df7a2e0b..9755197b 100644
--- a/vendor/stylo/properties/declaration_block.rs
+++ b/vendor/stylo/properties/declaration_block.rs
@@ -1715,11 +1715,9 @@ fn report_one_css_error(
// The error no longer carries the property name, but `slice` is the
// declaration text, i.e. `<name>: <value>`.
let name = slice.split(':').next().unwrap_or("").trim();
- if is_non_mozilla_vendor_identifier(name) {
- // If the unrecognized property looks like a vendor-specific property,
- // silently ignore it instead of polluting the error output.
- return;
- }
+ // raea: (#34) a vendor-specific property is reported too (-webkit-text-stroke drawn as nothing was never said);
+ // raea's reporter (blitz-dom not_applied.rs) keeps quiet about the ones that change nothing in a picture
+ let _ = is_non_mozilla_vendor_identifier;
if let Some(alias) = alias_of_known_property(name) {
// This is an unknown property, but its -moz-* version is known.
// We don't want to report error if the -moz-* version is already
@@ -1751,10 +1749,10 @@ fn report_one_css_error(
) {
error = ParseError::custom(StyleParseErrorKind::OtherInvalidValue);
}
- if !slice.contains(':') {
- // For CSSOM we only have the value. If there's no `:`, prepend the property name.
- error_string = Cow::Owned(format!("{}: {slice}", property.to_css_string()));
- }
+ // raea: (#34) named by the property parsed, with the value after it. For CSSOM there's only the value, and a value
+ // error's slice can start past a leading `-` (-webkit-background-clip came as webkit-background-clip)
+ let value = slice.split_once(':').map_or(slice, |(_, v)| v.trim_start());
+ error_string = Cow::Owned(format!("{}: {value}", property.to_css_string()));
}
let error =
diff --git a/vendor/vendor.toml b/vendor/vendor.toml
index 66ea2999..d4342440 100644
--- a/vendor/vendor.toml
+++ b/vendor/vendor.toml
@@ -63,7 +63,7 @@ exit = "a Blitz release that draws these"
path = "vendor/blitz-dom"
upstream = "crates.io:0.3.0-beta.4"
kind = "patch"
-reason = "inline flex/grid baselines, auto table columns, table row rects, inline image load events, SVG text fonts, SVG non-scaling strokes, url() filters; Blitz main's #1244 and #1246; a node removed in a mutation batch dropped from the style, form and title nodes the batch flushes (raea #24); a node in a 3D rendering context (or with a projection) placed again on every resolve, so it follows a preserve-3d parent whose transform a script set (raea #19)"
+reason = "inline flex/grid baselines, auto table columns, table row rects, inline image load events, SVG text fonts, SVG non-scaling strokes, url() filters; Blitz main's #1244 and #1246; a node removed in a mutation batch dropped from the style, form and title nodes the batch flushes (raea #24); a node in a 3D rendering context (or with a projection) placed again on every resolve, so it follows a preserve-3d parent whose transform a script set (raea #19); a ParseErrorReporter (not_applied.rs) on every author parse, keeping what stylo drops for the render to say once (raea #34)"
exit = "a Blitz release with #1244/#1246 and these"
[parley_engine]
@@ -84,7 +84,7 @@ exit = "parley carrying the fix"
path = "vendor/stylo"
upstream = "crates.io:0.22.0"
kind = "patch"
-reason = "line-clamp, text-wrap-style (with Chrome's pretty) and pointer-events' SVG keywords (all, visible, painted...) for Servo too, Gecko-only upstream; url() filters; ::-webkit-slider-thumb and ::-moz-range-thumb as the slider thumb"
+reason = "line-clamp, text-wrap-style (with Chrome's pretty) and pointer-events' SVG keywords (all, visible, painted...) for Servo too, Gecko-only upstream; url() filters; ::-webkit-slider-thumb and ::-moz-range-thumb as the slider thumb; unknown vendor-prefixed properties reported like any other, so a page can be told what it lost (raea #34)"
exit = "Servo's stylo enabling them"
[anyrender]