Repository navigation
fix(font): 补全泛族 :700 别名与平台族谱成对加载——修复 system-ui 粗体标题细体与 DejaVu w400 误粗体 - #139
Open
leizongmin wants to merge 6 commits into
Open
leizongmin wants to merge 6 commits into
leizongmin wants to merge 6 commits into
Conversation
P9-D2(R5061):build_font_resolver 仅为 sans-serif/serif 注册 :700 别名, system-ui/cursive/fantasy 缺 :700 键时 resolve_font_face 的 [":700",""] 查找 直接落 regular face(probe2 B1:system-ui w700 渲染细体);monospace:700 按 CSS Fonts 4 §5.2 族内语义回退族内唯一 face,不套用 sans 链跨族兜底。平台 角色加载补成对:bold 角色此前只载 DejaVuSans-Bold,"DejaVu Sans" 族单 face, w400 亦命中粗体(probe2 A3);primary 角色只载 NotoSans-Regular,GitHub 栈 含 "Noto Sans"(先于 sans-serif)时 w700 停在栈中途——分别补同族 Regular/Bold companion(Linux 清单;macOS/Windows 族谱成对加载留 FIXME)。 测试资产:新增内联 reftest css-fonts/system-ui-bold-zw-001(system-ui w700 ≍ sans-serif w700;本地孪生 tests/wpt-runner/local-reftests/css/css-fonts/, make import-wpt 登记账本与 manifest);loader/system 各增 p9d2 断言。 验证:probe2 真机对照 B1 细体→粗体、A3 误粗体→regular、B4 mono w700 族内 回退保持 regular,Chrome 双端一致;make reftest 709/709(新案通过、无像素 回归);make test 20495/0;cargo clippy --workspace --all-targets -D warnings(默认 v8)绿;cargo fmt --check 干净。 Co-Authored-By: Claude Code <noreply@anthropic.com>
leizongmin
force-pushed
the
site-opt/20261008-github
branch
from
October 11, 2026 17:15
8a5bada to
352032b
Compare
# Conflicts: # tests/wpt-runner/imported-tests.txt
双审查缺陷角色 DF-1(major 非阻断):仅装 fonts-dejavu-core 的环境 primary 与
bold-regular 命中同一 DejaVuSans.ttf,load_first 无去重致 family_map=
[Reg,RegDup,Bold]、自动注册 {family}:700=ids.get(1)=RegDup——w700 渲染细体,
对 base(该环境 [Reg,Bold] 正确)回归。修复:load_first 与 generic 族循环共享
loaded_paths 集合按路径去重,同路径只载一次;新增 DF-1 去重单测。
另更正 DF-3 注释矛盾:monospace:700 的 :700 语义跟随解析结果族(mono 命中
专属族取族内 Bold/自身;generic 全落空时取 default 族谱系),此前「禁跨族」
表述与 default 臂实际行为不符——禁的是 R3993「任意族第二 face」兜底。
验证:cargo test -p zero-render-foundation --lib font 168/0(含 DF-1 测试);
fmt 干净;clippy workspace -D warnings 绿(默认 v8)。DF-2(清单错位无运行时
校验)挂账与平台族谱 FIXME 一并处理。
Co-Authored-By: Claude Code <noreply@anthropic.com>
drain_next_async_callback_if_pending 原先仅在 try_recv 空档检查 20ms 预算; 被排水的回调以 setTimeout(fn, 0) 自续时(service worker 轮询链每跳含宿主 调用,解析耗时大于定时器线程 spawn),多链并行供给使通道永无空档,Ok 分支 无限消耗——make test 全量并行下测试线程在单次 execute_script 内 100% 单核 空转(实测 101.6s 不返回),serial 锁被占、后续测试全部泊住,二进制挂到 test-guard 900s 墙钟(leg 上下文 3/3 复现)。 排水循环顶部补每轮 deadline 检查:等待语义不变(recv_timeout 仍受剩余预算 约束),仅将消耗总量限制在预算内,恢复 execute_script 同步调用必须返回的 契约。新增 async_drain_bound 回归测试(4 条慢跳永续链):修复前 call 0 耗时 101.6s 断言失败,修复后全套 1.32s 通过;workspace make test 20531P/0F、 60s 警告 0,reftest 709/709。 Co-Authored-By: Claude Code <noreply@anthropic.com>
leizongmin
marked this pull request as ready for review
October 12, 2026 02:02
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: c4e55650-ce23-4d11-a01e-e0848a86f3cf) |
…hub(imported-tests.txt 双保留) 同步 main(#140–#144:R5073–R5079 layout/css 修复、webmessaging M2/M3、CORS range safelist、shape_fallback 中文字体 fallback chain)。冲突仅 tests/wpt-runner/ imported-tests.txt:双方新增条目均保留(main 4 条 + 本分支 css-fonts/system-ui-bold-zw-001 1 条),无产品代码手工改动。 Co-Authored-By: Claude Code <noreply@anthropic.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 35ccbba5-94cc-4b4c-a1fd-13766fe7920f) |
…创建、还原 image_cache 测试拼接 归因(均存在于 main tip 247ad10,非本分支改动引入;merge-tree 单侧变更不产生 冲突,故障内容随 main 带入): 1. async_load.rs:580 `expect("session")` panic——zero-webview lib 26 个测试失败 (async_load 家族 + redirect_tv1)及 zero-webdriver http_session 8 个 500, 同一根因:e776d6875/0620e8103「移除 T5DIAG 临时诊断」把生产行 `self.render_session = Some(BudgetedRenderSession::new(html, css_for_render))` 一并删除(30e0e7c0d 与 e776d68^ 均在场;main tip 上 BudgetedRenderSession::new 仅剩 webview.rs 测试内的直接构造)。恢复该行,使 0620e81 自述保留的 substitute_css_vars_text 生产路径重新接线(css_for_render 不再是死局部变量)。 2. image_cache.rs 测试块拼接损伤——zero-render-foundation lib test 编译失败 (duplicated attribute / dead_code / needless_borrow 三错):3ed4223cf 插入 decode_data_uri_svg_background 时替换了原测试的 fn 头,致原 decode_image_bytes_dispatches_by_magic 失去 #[test] 且被改名 test_decode_image_bytes_dispatches_by_magic,新测试带双 #[test]。按其本意还原: 原测试恢复原名与属性,SVG 测试独立置于其后(&src→src)。 两处在 main 上均未被 pr-precheck 覆盖(workspace check 不含 lib test 目标与 集成测试执行)。本提交使合并头恢复可测基线,供全量门禁与 PR #139 交付。 Co-Authored-By: Claude Code <noreply@anthropic.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 1615c4bf-1a4f-4953-9761-b86d9b7fe65f) |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
解决了什么
ZeroWeb 里
font-weight:700的system-ui文本渲染成细体(GitHub 顶部标题类元素同症状),而"DejaVu Sans"常规字重(w400)反而渲染成粗体。根因有两处(问题卡 P9-D2,R5072):sans-serif/serif注册了:700粗体别名;system-ui/cursive/fantasy缺键,w700 查找直接落到 regular 面。monospace族只有单 face,按 CSS Fonts 4 §5.2 的族内语义回退到族内唯一面。DejaVuSans-Bold.ttf,导致 "DejaVu Sans" 族单 face、任意字重都命中粗体;primary 角色只载NotoSans-Regular.ttf,GitHub 栈里先于sans-serif出现的"Noto Sans"命中后 w700 停在栈中途。修复:解析器补三族
:700别名(与sans-serif:700同值)和monospace:700族内回退;平台加载补同族 Regular/Bold 成对清单(Linux,macOS/Windows 留 FIXME 待各平台族谱核对),并按路径去重防止极简环境族谱重复 face(首轮审查 DF-1 返修,c7a3c128c)。附带修复:execute_script 回调排水 livelock(P9-11,254e51e35)
全量测试中 webview SW 套件在 leg 上下文必现挂死(make test 900s 墙钟掐树;main 上已有 3 次同型 flake:e55038a2a、763cfd996、bf4b25787)。真机 /proc 取证:测试线程在单次
execute_script内 R 态 100% 单核空转。根因——drain_next_async_callback_if_pending仅在回调通道空档(try_recv返回 Empty)检查 20ms 预算,而 service worker 轮询链(pollRegistration / pollClientMessages)以setTimeout(fn,0)自续、每跳含宿主调用(解析耗时大于定时器线程 spawn);多链并行时供给压倒排水、通道永无空档,排水循环永不返回,serial 锁被占,整个测试二进制挂死。修复:排水循环每轮迭代先查 deadline,超预算即返回(等待语义不变,
recv_timeout仍受剩余预算约束,setInterval 提前返回保留)。确定性探针:修复前 4 条慢链下单次execute_script卡 101.585s(exit 101),修复后 1.32s 通过;新增回归测试execute_script_returns_with_eternal_zero_timeout_chain以同形态锁死该机制。怎么验证
system-uiw700 细体 → 修复后粗体;A3"DejaVu Sans"w400 误粗体 → 修复后 regular;B4monospacew700 保持 regular(族内单 face 回退,正确)。Chrome 同探针双端一致。css-fonts/system-ui-bold-zw-001(system-ui w700 ≍ sans-serif w700;本地孪生文件入tests/wpt-runner/local-reftests/css/css-fonts/,make import-wpt已登记账本与 manifest)。make reftest709/709 全过(Layout 506/506、Text 203/203)——Noto Sans Bold / DejaVu Sans Regular 进入族谱后无任何既有用例像素回归。make test全量 20531 passed / 0 failed、60s 慢测试警告 0 条(含新增字重单测与排水回归测试);make test内 11 腿cargo clippy --workspace --all-targets -- -D warnings(默认 v8 feature)全 Finished;cargo fmt --all -- --check干净。navigator_update_rejects_non_javascript_main_script_as_security_error等测试在最终头通过;solo webview lib 套件 749/749(23.82s);4 慢链探针 101.585s→1.32s(单链对照 1.32s)。还有什么问题
@font-facewebfont 未应用(Mona Sans 加载缺失,CSSFontFaceRule在 JS 中未定义、document.fonts为空);P9-9 GitHub 真实样式表形状下 computedfont-family返回空串(简单 fixture 下 var()/font 简写均正常);P9-10@font-face页面 paint 停帧(DOM 已更新但屏幕停留在旧帧)。本修复不改这三项,首页标题字重由它们主导。:7000)留平台 FIXME 挂账(首轮审查 DF-2,minor,非阻断)。优化前后截图
场景 1 / 问题 ID:P9-D2 最小复现探针(本地 fixture,非真实网站)——probe2 页各字族/字重组合渲染
4aa0fc428(修复前构建)/ 本 PR head254e51e35(最终头构建重拍,与 r1 附件字节级一致:sha256f5ed8be6…)场景 2 / 问题 ID:github.com 首页真实站点(登录前首页 hero 区域)
前图 / 后图版本:parent best
4aa0fc428(修复前构建)/ 本 PR head254e51e35(最终头重拍;GitHub 页面内容随时间演化故字节不同,视觉状态相同:标题仍细体)捕获条件:https://github.com/ 登录前首页、同 viewport 800×600、DPR 1、zero-browser 生产构建(前图 4aa0fc4 构建 2026-10-11、后图 254e51e 构建 2026-10-12)
观察到的变化及剩余差异:标题字重无可见变化(预期,原因见上);首页剩余视觉问题为 P9-8/9/10,已另行登记待后续切片
脱敏范围:登录前公开页面无敏感内容 / 附件内容核验:下载件渲染核验通过 / PR 图片呈现核验:回读通过
已验证 best / PR head:parent best
4aa0fc428/ 本 PR head254e51e35实验停止原因 / 截图交付状态:运行中(未停止)/ 附件均已上传并回读核验
独立审查
未解决阻断项:0。
报告保留在本地运行目录;以上为报告记录,独立性与交付就绪另由门禁核验。
Note
Medium Risk
Font resolution and platform startup loading affect all text rendering; the webview drain change alters async JS timing under load but is bounded and test-covered.
Overview
Fixes font-weight 700 and w400 vs bold mismatches by extending
build_font_resolverwithsystem-ui/cursive/fantasy:700(same face assans-serif:700) andmonospace:700(bold within the resolved mono family, or the sole face). On Linux, platform font loading now loads Regular+Bold pairs for primary and bold roles, dedupes by file path so duplicate faces do not steal the:700slot, and adds regression tests plus a system-ui w700 reftest.Also fixes
execute_scriptlivelock: the async-callback drain loop now checks the deadline on every iteration (not only when the channel is empty), with a new bounded regression test. Minor test hygiene inimage_cache; budgeted page load restores creatingBudgetedRenderSessionwhen starting a render.Reviewed by Cursor Bugbot for commit 9184053. Bugbot is set up for automated code reviews on this repo. Configure here.