Repository navigation
fix(engine-dom): t8s1 DOMParser 快照 Text/Comment adopt 物化——insertBefore ref 无 handle 静默丢元素 - #132
Merged
Merged
Conversation
…e ref 无 handle 静默丢元素 真站 bilibili 播放器模板引擎 T.d(npd.314 bundle 模块 86806)用 `while(body.lastChild) frag.insertBefore(adoptNode(body.lastChild), frag.firstChild||null)` 倒序排空 DOMParser 快照 body:renderFragment HTML 带尾随空白 → 末子是文本。 t8q(PR #129)adoptNode 物化只覆盖 nodeType 1——快照文本 identity 返回无 host handle;其插入 fragment 成功但作 ref 时 host 桥按 ref handle 定位失败 → 第二轮的元素静默丢失 → `.bpx-video-info` 注册表查询全 miss → npd.314 四处 `template.info/online` null 崩(resize/hideDm/renderParts/classList)。 修复:_zwMText/_zwMComment 盖 __zwIsMEl 家族印章(与 _zwMEl 同款 non-enumerable,唯一消费者是 adoptNode 落地分支守卫);守卫与物化返回 判定扩至 nodeType 1|3|8。spec concept-node-adopt「完整搬入本文档」。 验证: - 钉测 ×2(js_dom_bridge_tests/part18.rs):T.d 倒序排空真站同构 + Comment ref/数据保真/原父摘除/identity 零回归;红态验证复现崩读数 (fragTypes:3|barInfo:null)后恢复修复复跑绿 - zero-engine lib 2967 passed;make test MAKE_EXIT=0 - clippy v8 全 workspace + quickjs 腿 -D warnings 零告警;fmt 干净 - 真站验证:docker=true 完整态两轮 errCount=0(修复前同态 9-10 条同簇), npd.314 chunk 确认加载 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: 6376619d-a9cd-4469-b06a-61a67ce90a97) |
①前导/尾随空白表述统一(首轮 A nit4 / B nit2);②_zwMText 印章注释 如实记录盖章面拓宽的同文档 adopt identity 偏差面(B nit1);③变体钉测 补 Comment data 逐字断言(A nit1);④补物化产物二次 adopt identity 直接断言(A nit2)。返修后 t8s1 钉测 2 passed + engine lib 2967 passed + fmt 干净。 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: 152b0ab4-0cee-4364-9dee-6e033fc45b9d) |
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.
变化
真站 bilibili 视频页 npd.314 播放器 danmaku widget install 链崩簇(
Cannot read properties of null×4 消费点:resize/hideDm/renderParts/classList 全读template.info/online)根因修复。根因链(真站证据 + 微探针矩阵三角化定谳)
while(body.lastChild) frag.insertBefore(document.adoptNode(body.lastChild), frag.firstChild||null)倒序排空 DOMParser 快照 body;renderFragment HTML 带尾随空白 → body 末子是文本节点。nodeType===1:快照顶层裸 Text 走 R192 既有分支 identity 返回,无 host handle。.bpx-video-info注册表查询全 miss → 四消费点 null 崩。微探针矩阵(执行体 about:blank CDP,修复前二进制):坏格精确为 {DOMParser adopt 快照文本作 ref} × {ref 非 null 的 fragment.insertBefore}——ref=本地文本(M2)、ref=null(M4)、普通文档节点同组合(R4)全部正常;single-op adoptNode/lastChild/removeChild(Q1-Q4)全对。
修复(最小面,3 文件)
part03.js:_zwMText/_zwMComment盖__zwIsMEl家族印章(与_zwMEl同款 non-enumerable;全库唯一运行时消费者是 adoptNode 落地分支守卫)。part06.js:adoptNode 守卫与物化返回判定nodeType===1→1|3|8;_zwParseEl instanceof || __zwIsMEl双识别保持。验证
fragTypes:3|fragInfo:miss|barInfo:null(与真站崩读数同构)→ cp 恢复 md5 校验 → 复跑绿make testpipefail 复跑 MAKE_EXIT=0--all-targets -D warnings零告警;quickjs 腿(engine)零告警cargo fmt --all -- --check干净make browser-build后grep -a -c _eMElTagT zero-renderer=1(产物本体核验)双审查状态
_zwMText印章注释如实记录同文档 adopt identity 偏差面(B①);③变体钉测补 Comment data 逐字断言(A①);④补物化产物二次 adopt identity 直接断言(A②)。返修后 t8s1 钉测 2 passed + engine lib 2967 passed + fmt 干净。非作者复核进行中,完成后更新本节。截图
无适用画面:本修复修复的是 console 层脚本崩溃簇(widget install 链 null TypeError),优化前后无对应可见画面差异——修复前崩簇由 console error 计数证明(9-10 条 → 0),已在上表与运行目录
.acceptance/site-optimizer/bilibili-20261002-r1/out-t8s1-verify{,2}/verify.json留档。danmaku widget 本身未登录态不可见,无视觉验收面。已知边界(不属本 PR)
text/xmlmimeType 的 DOMParser shim 层统一按 HTML 解析,快照 Text/Comment 同走1|3|8物化(首轮 A③ 指认的同形面经首轮 B 核验为同域覆盖,此处如实记录口径;shim XML 根元素大小写/命名空间差异为既有已知限制,不属本 PR)[1,3]vs Chrome[3,1,3])——独立差异已入池 OBS-t8s1-1;T.d/tr.t 链不依赖前导空白存活。__zwIsMEl盖章面含new Text()/cloneNode等全部 M 家族产物:其同文档 adopt 由 R192 identity 变为物化副本(spec 要求返回自身)——审查 B 核实当前 shim 无内部 adoptNode 调用方、无测试/站点消费面受害;如需 identity 保真再拆独立印章(注释已记录,part03.js)。adoptNode(own 版,part06.js:3620)未扩 3/8——t8q 元素既有不对称的对称延伸,nit 级。🤖 Generated with Claude Code
Note
Medium Risk
Changes adoptNode materialization for parser snapshot text/comment nodes; documented tradeoff that same-document adopt of some M-family nodes may no longer return identity (R192).
Overview
Fixes bilibili player crashes where adopting a DOMParser snapshot body in reverse order left trailing text nodes without host handles, so a later
insertBeforewith that text as ref silently dropped the real element and broke.bpx-video-infolookups.Shim:
_zwMText/_zwMCommentnow stamp__zwIsMEl, anddocument.adoptNodematerialization applies to elements, text, and comments (not onlynodeType === 1), still using_wcRebuildAsHandleand parent removal per concept-node-adopt.Tests: Two new t8s1 bridge tests mirror the T.d drain loop plus comment-ref, data fidelity, and adopt identity regressions; t8q comments note top-level text/comment adopt is in scope.
Reviewed by Cursor Bugbot for commit 153b129. Bugbot is set up for automated code reviews on this repo. Configure here.