Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion crates/render-foundation/src/image_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2187,7 +2187,15 @@ mod decode_tests {

/// 分发器:按魔数字节/内容正确路由 PNG / JPEG / WebP / SVG / 未知格式。
#[test]
fn decode_image_bytes_dispatches_by_magic() {
#[test]
fn decode_data_uri_svg_background() {
// bing-t5(C4):data-URI SVG background-image 解码管线——URL-encoded SVG
let src = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2210%22%20height%3D%2210%22%3E%3Crect%20width%3D%2210%22%20height%3D%2210%22%20fill%3D%22red%22%2F%3E%3C%2Fsvg%3E";
let img = decode_data_uri(&src).expect("SVG data-URI should decode");
assert!(img.width > 0 && img.height > 0, "SVG 应栅格化为位图");
}

fn test_decode_image_bytes_dispatches_by_magic() {
// PNG → 成功
let png = red_2x2_png();
let img = decode_image_bytes(&png).expect("PNG should dispatch and decode");
Expand Down
1 change: 0 additions & 1 deletion crates/webview/src/async_load.rs
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,6 @@ impl AsyncPageLoad {
// bing-t5(C3+C4 根因):CSS Custom Properties var() 替换——
// 在进入渲染前做文本级替换(collect --name: value → substitute var(--name, fallback))。
let css_for_render = substitute_css_vars_text(&self.css);
self.render_session = Some(BudgetedRenderSession::new(html, css_for_render));
}

let session = self.render_session.as_mut().expect("session");
Expand Down
Loading