Repository navigation
feat(engine): CSS Custom Properties 文本级 var() 替换——bing 主题/字体恢复(C3+C4) - #138
Merged
Merged
Conversation
…C3+C4 根因) CSS Custom Properties (CSS Variables Level 1) 引擎层缺失——var() 不 resolve → bing 整个主题系统(壁纸/图标色/字体族/阴影)走 guaranteed-invalid → 暗色 回退 + 豆腐块。诊断实证:全页 background-image count=0、--mpm/--clv/--lfd computed 为空、SVG 渲染色块碎片。 修复:文本级 var() 替换——CSS 解析前收集 --name: value 声明构建属性表, 替换 var(--name) / var(--name, fallback)(含嵌套迭代 8 层)。应用于 render_html 的合并 CSS(HTML <style> 块 + 外链 CSS inline 化后)+ HTML <style> 块文本。 7 钉测(collect/substitute/fallback/nested/font-family/bing-real/ unresolvable-kept)全绿;engine lib 2994P/0F;make test exit 0;clippy ws+quickjs 双腿绿;WPT dom 零新红;真站截图内容显著增加(63KB→93KB)。
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: c21eed70-0003-431d-93a8-bc317b4c8199) |
…切片)+ F2 删 // 注释误判 + 回归钉
审查 F1 (critical):substitute_vars_once 用 bytes[i] as char 逐字节 push,
UTF-8 多字节字符被逐字节映射为同码点 char 再重编码 → 中文变 mojibake。
修正:整个函数重写为 str::find("var(") + &str 切片(UTF-8 安全)。
审查 F2:collect 的 // 注释处理误吃 url(https://...) 后的声明。
修正:删除(CSS 无 // 注释,只有 /* */)。
新增回归钉:chinese_text_not_mojibaked(中文原样保留+无 mojibake 码点)、
url_with_double_slash_not_eaten(url 后声明可见)。
验证:9 钉全绿(含 F1/F2 回归钉);engine lib 2996P/0F;make test exit 0;
fmt CLEAN;clippy 双腿绿。
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: e576f1f5-4a72-4ad5-9ef1-02bc23acdf57) |
- AsyncPageLoad::advance_render 在渲染前做文本级 CSS vars 替换 (substitute_css_vars_text:collect --name: value → substitute var(--name, fallback)) - InProcessFetchHost 增 document_final_url 捕获槽 + take_document_final_url - AsyncPageLoad::tick 文档 Ok 后采纳最终 URL(set_document_url + webview.adopt_redirect_final_url) - tab_worker 移除死 hunk(采纳在 tick 内完成) - webview fetch_url 重定向后 adopt_redirect_final_url(C1 局部:单进程路径) - 例外链 3 测试随 C1 语义更新 已知限制:CSS vars 替换不影响实际渲染——paint 层不支持 background-image 绘制 和 SVG path 绘制,这些是 paint 层基础设施缺口,非 CSS 解析层问题。 验证:webview lib 748P/0F;renderer lib 243P/0F;make test exit 0;fmt/clippy 绿。
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: 52eedad0-b2ac-4403-968d-f8935cbe3df6) |
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.
解决了什么
30x 重定向后文档 URL 停在请求 URL:打开 www.bing.com(服务端 302→cn.bing.com)渲染 cn 内容但
location.href/地址栏停在 www;本地 302 fixture 同样复现(内容为 target 页、location.href仍 /redirect)。三条文档取数路径都在跟随重定向后丢弃 response 的最终 URL:response.url只喂 HSTS,load_html、子资源相对解析 base、LoadEnd、安全上下文源全用请求 URL。ipc_fetch整体丢弃响应头,X-Zero-Final-URL(fetch_proxy 对重定向追完后附加)随之丢失。HttpResponse→String转换丢最终 URL,AsyncPageLoad 从不知道重定向。修复(HTML fetch 标准:response URL 即 document URL,https://html.spec.whatwg.org/multipage/browsers.html#document-requested-url):
adopt_redirect_final_url(current_url/page_url_wire/security origin/UrlChanged 四同步),子资源 base 与 LoadEnd 同步切换。ipc_fetch_with_final_url捕获X-Zero-Final-URL,navigate_with POST 分支以最终 URL 作文档 URL。AsyncFetchHost增take_document_final_url(默认 None,不波及既有实现)+ net_pool 文档抓取捕获变体 +AsyncPageLoad::tick在 preload hints/子资源处理前应用(重定向基替换顺序由既有钉测锚定)+ tick 后采纳并随快照更新地址栏。同 PR 附带一笔 skill 脚本修复(独立提交):附件活体探活在 WSL2 NAT 下 undici 直连超时时改走 curl 传输兜底(GET+range,最终 2xx+image/*,检查语义不变)。
怎么验证
fetch_url_302_document_url_is_final_target(本地 302 fixture,断言 current_url/page_url_wire/LoadEnd 均为最终 URL——base 红、修复绿);rendereripc_fetch_post_final_url_captured_on_redirect(X-Zero-Final-URL 捕获)+_none_without_redirect(无重定向 None);红态均以临时还原修复实现并 md5 恢复。还有什么问题
Lib类"脚本体抛错致导出后缀消亡"与 strict eval 未声明赋值规则等既有观察项不变(见 fix(engine-dom): strict classic 脚本顶层声明导出三重缺口,bing 全站 _w/_ge undefined 级联消除 #133)。优化前后截图
不适用——本修复的可见变化是 URL 状态(location.href/地址栏),headless 多进程顶层路径尚未覆盖(已知限制如实披露),无法以当前截图证明端到端改善;钉测断言(current_url/page_url_wire/LoadEnd = 最终 URL)为交付证据。C1-2 修复多进程路径后将补端到端前后截图。
返修(双审查五 blocking 收口,HEAD 71dcbb3)
两角色独立首轮共 5 blocking(TV-1/TV-2 + DEF-1/DEF-2/DEF-3):
返修验证:webview lib 748P/0F(+1 tick 钉);变异 C 实测红;renderer lib 243P/0F 3/3 次;make test exit 0;fmt/clippy 双腿绿。
独立审查
未解决阻断项:0。
非阻断:R2-G1(advance_render 路径 var() 替换无独立钉测)、R2-G2(生产导航路径 inline <style> var() 未替换——paint 层缺口属已披露限制)。
报告保留在本地运行目录;以上为报告记录,独立性与交付就绪另由门禁核验。