mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-24 23:44:18 -08:00
test(dpip): [PKG-DPIP-02] reproduce window races and DOM rollback failures
This commit is contained in:
1 parent
efbbdb4782
commit
202351934b
13 files changed
+574
-13
No files matched your search
@@ -0,0 +1,136 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"task": "PKG-DPIP-02",
|
||||
"status": "done",
|
||||
"checks": [
|
||||
{
|
||||
"command": "node --test test/dpip.test.js refactor/scripts/dpip-contract.test.mjs",
|
||||
"result": "pass",
|
||||
"tests": 64,
|
||||
"historicalLifecycle": 48,
|
||||
"contract": 16
|
||||
},
|
||||
{
|
||||
"command": "playwright test test/browser/dpip.spec.js",
|
||||
"result": "pass",
|
||||
"tests": 48,
|
||||
"skipped": 0,
|
||||
"browsers": [
|
||||
{
|
||||
"project": "chromium",
|
||||
"version": "153.0.8010.12",
|
||||
"platform": "win32"
|
||||
},
|
||||
{
|
||||
"project": "firefox",
|
||||
"version": "155.0",
|
||||
"platform": "win32"
|
||||
},
|
||||
{
|
||||
"project": "webkit",
|
||||
"version": "26.6",
|
||||
"platform": "win32"
|
||||
}
|
||||
],
|
||||
"scope": "four frozen implementations x two actual cores x three engines x two real DOM iframe scenarios; explicit historical failures, not fixes or native Document PiP"
|
||||
},
|
||||
{
|
||||
"command": "focused eslint --no-fix",
|
||||
"result": "pass"
|
||||
},
|
||||
{
|
||||
"command": "yarn ci:check",
|
||||
"result": "pass",
|
||||
"tests": {
|
||||
"unit": 986,
|
||||
"engineering": 14,
|
||||
"baseline": 116,
|
||||
"mainTotal": 1116,
|
||||
"repeatedContractExecutions": 44
|
||||
},
|
||||
"strictProductionTypeScriptFiles": 284
|
||||
}
|
||||
],
|
||||
"limitations": [
|
||||
"Historical failure assertions are reproductions, not candidate fixes.",
|
||||
"Controlled Node host destroy does not model all core cleanup.",
|
||||
"Real browser iframe DOM and events are used; requestWindow and close are controlled, not native Document PiP.",
|
||||
"WebKit reports width640 for the 320-wide fixture in the styled player; preserved as a historical observation, not intrinsic-size acceptance.",
|
||||
"Native window/user activation, media continuity, focus, proxies and devices remain task05."
|
||||
],
|
||||
"parentCommit": "efbbdb4782be75d80c2f51e62e0eb8c5e98b83eb",
|
||||
"inputs": [
|
||||
{
|
||||
"file": "test/dpip.test.js",
|
||||
"sha256LF": "0f73444b07821642b6291bd24c10087708867b1fcac5e23b9c4a1d901904163c"
|
||||
},
|
||||
{
|
||||
"file": "test/helpers/dpip.js",
|
||||
"sha256LF": "93941787e7fd34a332eb46f47becb8a306f25871a511d9c83b792c04f8035131"
|
||||
},
|
||||
{
|
||||
"file": "test/browser/dpip.spec.js",
|
||||
"sha256LF": "0626ddd9ef96aab5d68f47496266708c5f4be8cd9c9f3984db371b1612b6921e"
|
||||
},
|
||||
{
|
||||
"file": "refactor/baselines/dpip-release.json",
|
||||
"sha256LF": "afcf54f22fb3f57186e19bdf384a130c6388e972164774ee56eeca23fc814c23"
|
||||
},
|
||||
{
|
||||
"file": "packages/artplayer-plugin-document-pip/src/index.js",
|
||||
"sha256LF": "655818d30d82e43443e9a7ea185f91fc951eb72ad11edaaed0264182e62f32ba"
|
||||
},
|
||||
{
|
||||
"file": "package.json",
|
||||
"sha256LF": "d7ee39161397f3e9121975b79592c84c65200ccf043d4449ac5b9a9fbb1a93f0"
|
||||
}
|
||||
],
|
||||
"logs": [
|
||||
{
|
||||
"file": "refactor/.cache/dpip02-node-first.log",
|
||||
"sha256": "866a8985af2db6953dcb35cc8dc0405d99c3944075c264424ccd2703b09194d9"
|
||||
},
|
||||
{
|
||||
"file": "refactor/.cache/dpip02-node-final.log",
|
||||
"sha256": "946cce2d8663e4d06b969d6ba3f5463d074c6cb593d4fca0de1d0eca3402e5a9"
|
||||
},
|
||||
{
|
||||
"file": "refactor/.cache/dpip02-lint-final.log",
|
||||
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
},
|
||||
{
|
||||
"file": "refactor/.cache/dpip02-browser-first.log",
|
||||
"sha256": "dd4af0c08a2a33250f7b712074e3e13ae4775ab613972dc7f35ab35632bde20f"
|
||||
},
|
||||
{
|
||||
"file": "refactor/.cache/dpip02-browser-final.log",
|
||||
"sha256": "10556a704038d1e0052c59769443b14348a9e8d81cd8e72f0009ad807050df9b"
|
||||
},
|
||||
{
|
||||
"file": "refactor/.cache/dpip02-browser-third.log",
|
||||
"sha256": "cb5e301223d6b7ddb2b5dd4222e1e1cd45ee0f8403d66814f174de963a118e9b"
|
||||
},
|
||||
{
|
||||
"file": "refactor/.cache/dpip02-ci.log",
|
||||
"sha256": "0fe1f724a072ed13b802346e213a2ed638330f4a8bd55154d44b82b90008da26"
|
||||
},
|
||||
{
|
||||
"file": "refactor/.cache/dpip02-first-results/report.json",
|
||||
"sha256": "e1dca0e28bbdf0b537e15a71b846da64303d75b14084082f58db971b3c652f2a"
|
||||
},
|
||||
{
|
||||
"file": "refactor/.cache/dpip02-second-results/report.json",
|
||||
"sha256": "029b99b64c0463376c6dfd3a622d92e31c2de6608b3689d9b185864dca6e91ef"
|
||||
},
|
||||
{
|
||||
"file": "refactor/.cache/dpip02-final-results/report.json",
|
||||
"sha256": "7175394fe821285107950c846aad33acf01062d40036708d7d181742cdf20e00"
|
||||
}
|
||||
],
|
||||
"browserArtifacts": [
|
||||
{
|
||||
"file": "refactor/.cache/dpip02-final-results/results/.last-run.json",
|
||||
"sha256": "91d1c43004802cd49950d78eb11c8fa7d05da8ffffe219a8b13b2f561bc00903"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
# PKG-DPIP-02 窗口竞争与还原失败
|
||||
|
||||
本步只建立历史可重跑测试,不修改插件生产源码。三份实际可执行发布(1.0.1、
|
||||
1.0.2、1.1.0)和冻结工作区各12项,共48项;1.0.0缺运行时仍不加入行为矩阵。
|
||||
正常/错误对照包含请求拒绝后重试、pagehide/unload只关闭一次、不支持两种fallback、
|
||||
source替换保持节点身份及resize调用。明确复现的缺陷:
|
||||
|
||||
- close或destroy发生在requestWindow完成前,迟到窗口仍接管播放器,逃逸open可重开。
|
||||
- 并发open覆盖还原目标,前一窗口/监听器/占位节点遗留,close把播放器还原到前一窗口。
|
||||
- open/close的sleep完成后仍在销毁实例发resize;激活事件里销毁同样未撤销后续效果。
|
||||
- adoption失败未回滚窗口与占位;占位节点被外部移动后,close先adopt再insert失败,
|
||||
播放器成为无父节点,窗口仍active且关闭监听器已经移除。
|
||||
- 从其他document迁入的播放器可还原,但复制的样式来自全局document,遗漏原文档样式。
|
||||
- 1.1.0/冻结源码在DOMContentLoaded前重复执行会重复注入相同id;1.0.1/1.0.2的
|
||||
Parcel模块缓存使相同bundle重复执行只有一份,不能把新版本缺陷写成全部版本都有。
|
||||
|
||||
受控宿主的destroy只触发插件可见通知,不模拟核心全量回收,保留控件/监听器的断言
|
||||
只证明插件本身没有释放,不能据此声称实际核心destroy一定保留整个UI。
|
||||
|
||||
浏览器矩阵为四实现×两实际核心(npm5.4.0/候选)×三引擎×两场景,共48项。
|
||||
使用原生iframe的document/adoptNode/insertBefore/Event,控制requestWindow和close;
|
||||
验证同一个player/video节点迁入与还原、媒体已加载、pagehide/unload、实际notice DOM,
|
||||
并明确断言历史pending-close和移动占位导致的失败状态。未伪装为原生文档PiP窗口,
|
||||
不证明用户激活、焦点/键盘、原生窗口关闭或跨窗连续播放。能力检测在替换API前记录。
|
||||
|
||||
首次Node运行45/48通过:两份Parcel bundle重复执行缓存与预计不同,冻结源码重复
|
||||
eval遇到词法重声明。loader现在只加函数作用域隔离,不改执行代码;保留旧Parcel缓存
|
||||
的实际1节点断言。首次浏览器16/48通过:24项错误使用notice.show getter读文字,
|
||||
改为$noticeInner.textContent;另8项WebKit对320宽媒体返回640(当前CSS宽度),
|
||||
现以精确历史引擎差异记录,不能把其通过称为正确原生像素/内在尺寸通过。首次完整报告、
|
||||
trace和截图保留,尺寸原因及原生媒体连续性留05进一步对照。
|
||||
|
||||
第二轮37/48通过:跨文档迁移后的原生媒体/resize事件会把notice改成Aspect Ratio,
|
||||
错误断言需要在close同步失败路径刚写入DOM时取证,不能稍后假定它永远不被覆盖。
|
||||
另外iframe默认300×150触发布局变化,WebKit读数也出现266;最终固定测试iframe为
|
||||
640×360并等待明确的640宽读数,保留其他引擎320宽对照,没有把任意正数作为通过。
|
||||
第二轮报告同样完整归档。该改动稳定DOM测试环境,不解决或解释原生媒体内在尺寸。
|
||||
|
||||
结果见[验证证据](../baselines/dpip-behavior-validation.json)。03将分离窗口状态机、
|
||||
DOM迁移/样式、控件与事件资源,新增候选正向断言并保留本文件对应旧失败对照;
|
||||
04处理类型/导出,05继续原生窗口和代理/设备组合。本步测试失败可独立回退,
|
||||
不会修改已发布归档。不推送、发布或升级版本。
|
||||
|
||||
最终64项Node定向检查(48生命周期+16正常契约)、48项浏览器和lint通过;完整CI1116项(986单元+14工程+116基线)通过,另44项重复契约观察。284生产TS文件严格检查。本步done并独立提交,已复现风险保持open,由03/05完成修复和原生验收。
|
||||
@@ -21,3 +21,13 @@ test/helpers/dpip.js是受控DOM/window边界:验证ownerDocument、节点身
|
||||
|
||||
证据入口:[01记录](changes/2026-09-12-PKG-DPIP-01-contract.md)、
|
||||
[01验证](baselines/dpip-contract-validation.json)。正常契约测试通过不关闭源码观察风险。
|
||||
|
||||
## 生命周期历史复现(02)
|
||||
|
||||
`yarn test:dpip`:48项(四实现×12组),覆盖拒绝/fallback、重复/迟到打开、close/destroy、
|
||||
延迟resize、激活重入、adoption失败、占位移动、跨文档样式、source节点身份及重复样式。
|
||||
`yarn test:browser test/browser/dpip.spec.js`:48项,四实现×两实际核心×三引擎×两场景。
|
||||
真实DOM用于迁移、还原与错误验证;窗口API受控,不能作为原生Document PiP验收。
|
||||
当前WebKit的640宽读数与320宽fixture不同,精确保留为历史观察,待05查清尺寸和媒体
|
||||
连续性;测试不会宽泛允许任意尺寸。初次错误与修正原因见[02记录](changes/2026-09-12-PKG-DPIP-02-tests.md),
|
||||
验收状态见[02证据](baselines/dpip-behavior-validation.json)。03必须新增候选修复断言。
|
||||
+3
-2
@@ -4,7 +4,7 @@
|
||||
|
||||
基线:`40fcda6a37d0049d42e49c1e64e70d4fd9ba5f7f`。总任务 221 项,范围 22 个包及工作区/示例。
|
||||
|
||||
状态:todo 121 / doing 6 / blocked 0 / done 94 / deferred 0。风险 L/M/H 表示兼容风险,不表示工期。
|
||||
状态:todo 120 / doing 6 / blocked 0 / done 95 / deferred 0。风险 L/M/H 表示兼容风险,不表示工期。
|
||||
|
||||
前置依赖是启动条件;验收是完成条件。任务可以继续拆分,但不能复用或悄悄删除旧 ID。
|
||||
|
||||
@@ -294,7 +294,7 @@
|
||||
| ID | 范围 / 步骤 | 前置依赖 | 交付物 | 验收条件 | 风险 | 状态 |
|
||||
| --- | --- | --- | --- | --- | --- | --- |
|
||||
| PKG-DPIP-01 | artplayer-plugin-document-pip<br>核对包契约与历史用法 | BASE-05 | width/height/placeholder/fallbackToVideoPiP、open/close/toggle 返回 | 源码/声明/README/demo/发布包差异已登记;公开形状和版本范围冻结 | H | done |
|
||||
| PKG-DPIP-02 | artplayer-plugin-document-pip<br>建立特有行为与错误测试 | PKG-DPIP-01, ENG-03, ENG-05 | 不支持/拒绝、重复打开、pagehide、核心销毁和视频 PiP fallback | 旧版本行为可重跑,成功/失败/切源/销毁有必要断言 | H | todo |
|
||||
| PKG-DPIP-02 | artplayer-plugin-document-pip<br>建立特有行为与错误测试 | PKG-DPIP-01, ENG-03, ENG-05 | 不支持/拒绝、重复打开、pagehide、核心销毁和视频 PiP fallback | 旧版本行为可重跑,成功/失败/切源/销毁有必要断言 | H | done |
|
||||
| PKG-DPIP-03 | artplayer-plugin-document-pip<br>整理内部职责与资源 | PKG-DPIP-02, CORE-16, CORE-17 | 窗口生命周期、DOM 迁移、样式与事件 document 重绑分离 | 结构变化和缺陷修复分开记录;原 API/事件/资源生命周期通过 | H | todo |
|
||||
| PKG-DPIP-04 | artplayer-plugin-document-pip<br>迁移自有源码和公开类型 | PKG-DPIP-03, ENG-04, ENG-06, CORE-07 | Document PiP 可选能力和真实状态/返回类型 | 严格类型检查、旧消费样例通过;声明路径/导出和同步异步兼容 | H | todo |
|
||||
| PKG-DPIP-05 | artplayer-plugin-document-pip<br>验证新旧核心和组合 | PKG-DPIP-04, CORE-22, PKG-CANVAS-04, PKG-MB-04 | 原生视频及两个 proxy、键盘/焦点/全屏与关闭还原 | 最终核心与原支持范围核心分别通过;设备/SDK 缺证据不能标完成 | H | todo |
|
||||
@@ -507,6 +507,7 @@
|
||||
- PKG-VAST-02: [记录](changes/2026-09-12-PKG-VAST-02-tests.md) [记录](baselines/vast-behavior-validation.json) [记录](baselines/vast-core.json) [记录](vast-validation.md)
|
||||
- PKG-VAST-03: [记录](changes/2026-09-12-PKG-VAST-03-lifecycle.md) [记录](baselines/vast-lifecycle-validation.json) [记录](vast-compatibility-decision.md)
|
||||
- PKG-DPIP-01: [记录](changes/2026-09-12-PKG-DPIP-01-contract.md) [记录](baselines/dpip-release.json) [记录](baselines/dpip-contract.md) [记录](baselines/dpip-contract-validation.json) [记录](dpip-validation.md)
|
||||
- PKG-DPIP-02: [记录](changes/2026-09-12-PKG-DPIP-02-tests.md) [记录](baselines/dpip-behavior-validation.json) [记录](dpip-validation.md)
|
||||
- PKG-CANVAS-01: [记录](changes/2026-09-12-PKG-CANVAS-01-contract.md) [记录](baselines/canvas-contract.md) [记录](baselines/canvas-release.json) [记录](canvas-validation.md) [记录](baselines/canvas-contract-validation.json)
|
||||
- PKG-CANVAS-02: [记录](changes/2026-09-12-PKG-CANVAS-02-tests.md) [记录](baselines/canvas-behavior-validation.json) [记录](canvas-validation.md)
|
||||
- PKG-CANVAS-03: [记录](changes/2026-09-12-PKG-CANVAS-03-lifecycle.md) [记录](baselines/canvas-lifecycle-validation.json) [记录](canvas-validation.md)
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
# 进度与证据
|
||||
|
||||
## 最新完成:Document PiP-02 生命周期历史复现
|
||||
|
||||
四实现×12组共48项复现迟到/重复窗口、销毁后效果、DOM回滚失败和样式差异,
|
||||
另16项正常契约通过。三浏览器×两核心×四实现×两场景48项真实DOM iframe检查通过,
|
||||
其中历史缺陷断言通过不代表修复;原生窗口/用户激活/连续播放仍待05。
|
||||
完整CI1116项通过,另44项重复契约观察,284生产TS文件严格检查。
|
||||
当前221项:95 done、6 doing、120 todo。见[本步记录](changes/2026-09-12-PKG-DPIP-02-tests.md)
|
||||
和[验证证据](baselines/dpip-behavior-validation.json)。下一步03拆分TS状态与资源并修复,
|
||||
保留历史负例;每任务独立本地提交,不推送/发布。
|
||||
|
||||
## 最新完成:Document PiP-01 实际发布契约
|
||||
|
||||
冻结四个npm归档/21成员及7个Git工作区输入。实际1.0.0缺少三个运行时入口,
|
||||
|
||||
@@ -162,5 +162,7 @@
|
||||
| DPIP-PACK-01 | open / 已复现 | Published Document PiP 1.0.0 tarball omits every declared runtime entry | PKG-DPIP-06 |
|
||||
| DPIP-DIST-01 | open / 已复现 | Document PiP namespace.default in 1.0.1/1.0.2 differs from callable 1.1.0 export | PKG-DPIP-04, PKG-DPIP-06 |
|
||||
| DPIP-TYPE-01 | open / 已复现 | Document PiP requires options and declares void actions and writable flags that differ from runtime | PKG-DPIP-04 |
|
||||
| DPIP-LIFE-01 | open / 源码/产物事实 | Document PiP has no separate ownership for pending window requests and delayed post-transition callbacks | PKG-DPIP-02, PKG-DPIP-03, PKG-DPIP-05 |
|
||||
| DPIP-DOM-01 | open / 源码/产物事实 | Document PiP copies global-document styles and retains original parent without transactional rollback | PKG-DPIP-02, PKG-DPIP-03, PKG-DPIP-05 |
|
||||
| DPIP-LIFE-01 | open / 已复现 | Document PiP has no separate ownership for pending window requests and delayed post-transition callbacks | PKG-DPIP-02, PKG-DPIP-03, PKG-DPIP-05 |
|
||||
| DPIP-DOM-01 | open / 已复现 | Document PiP copies global-document styles and retains original parent without transactional rollback | PKG-DPIP-02, PKG-DPIP-03, PKG-DPIP-05 |
|
||||
| DPIP-STYLE-01 | open / 已复现 | Document PiP 1.1.0 and frozen source duplicate style IDs when evaluated before DOMContentLoaded | PKG-DPIP-03 |
|
||||
| DPIP-MEDIA-01 | open / 已复现 | WebKit reports styled width640 for width320 media in the controlled Document PiP iframe matrix | PKG-DPIP-05 |
|
||||
+38
-4
@@ -3486,7 +3486,7 @@
|
||||
{
|
||||
"id": "DPIP-LIFE-01",
|
||||
"title": "Document PiP has no separate ownership for pending window requests and delayed post-transition callbacks",
|
||||
"confirmation": "source-observed",
|
||||
"confirmation": "reproduced",
|
||||
"owners": [
|
||||
"PKG-DPIP-02",
|
||||
"PKG-DPIP-03",
|
||||
@@ -3498,13 +3498,15 @@
|
||||
"evidence": [
|
||||
"refactor/baselines/dpip-release.json",
|
||||
"refactor/baselines/dpip-contract.md",
|
||||
"refactor/changes/2026-09-12-PKG-DPIP-01-contract.md"
|
||||
"refactor/changes/2026-09-12-PKG-DPIP-01-contract.md",
|
||||
"refactor/changes/2026-09-12-PKG-DPIP-02-tests.md",
|
||||
"refactor/baselines/dpip-behavior-validation.json"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "DPIP-DOM-01",
|
||||
"title": "Document PiP copies global-document styles and retains original parent without transactional rollback",
|
||||
"confirmation": "source-observed",
|
||||
"confirmation": "reproduced",
|
||||
"owners": [
|
||||
"PKG-DPIP-02",
|
||||
"PKG-DPIP-03",
|
||||
@@ -3516,7 +3518,39 @@
|
||||
"evidence": [
|
||||
"refactor/baselines/dpip-release.json",
|
||||
"refactor/baselines/dpip-contract.md",
|
||||
"refactor/changes/2026-09-12-PKG-DPIP-01-contract.md"
|
||||
"refactor/changes/2026-09-12-PKG-DPIP-01-contract.md",
|
||||
"refactor/changes/2026-09-12-PKG-DPIP-02-tests.md",
|
||||
"refactor/baselines/dpip-behavior-validation.json"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "DPIP-STYLE-01",
|
||||
"title": "Document PiP 1.1.0 and frozen source duplicate style IDs when evaluated before DOMContentLoaded",
|
||||
"owners": [
|
||||
"PKG-DPIP-03"
|
||||
],
|
||||
"compatibleResolution": "Preserve the style id and injection timing while deduplicating at insertion and releasing loading listeners.",
|
||||
"closureCriteria": "Historical two-node versus Parcel cached one-node difference stays explicit; candidate has one final style node under duplicate evaluation.",
|
||||
"confirmation": "reproduced",
|
||||
"status": "open",
|
||||
"evidence": [
|
||||
"refactor/changes/2026-09-12-PKG-DPIP-02-tests.md",
|
||||
"refactor/baselines/dpip-behavior-validation.json"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "DPIP-MEDIA-01",
|
||||
"title": "WebKit reports styled width640 for width320 media in the controlled Document PiP iframe matrix",
|
||||
"owners": [
|
||||
"PKG-DPIP-05"
|
||||
],
|
||||
"compatibleResolution": "Use independent native media controls to determine the dimension behavior and verify real Document PiP playback and proxy dimensions.",
|
||||
"closureCriteria": "Exact browser/version evidence distinguishes layout-driven reports from intrinsic pixels and validates native media continuity; do not treat controlled iframe success as native PiP acceptance.",
|
||||
"confirmation": "reproduced",
|
||||
"status": "open",
|
||||
"evidence": [
|
||||
"refactor/changes/2026-09-12-PKG-DPIP-02-tests.md",
|
||||
"refactor/baselines/dpip-behavior-validation.json"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
+6
-2
@@ -3009,11 +3009,15 @@
|
||||
"ENG-03",
|
||||
"ENG-05"
|
||||
],
|
||||
"status": "todo",
|
||||
"status": "done",
|
||||
"risk": "H",
|
||||
"deliverable": "不支持/拒绝、重复打开、pagehide、核心销毁和视频 PiP fallback",
|
||||
"acceptance": "旧版本行为可重跑,成功/失败/切源/销毁有必要断言",
|
||||
"evidence": []
|
||||
"evidence": [
|
||||
"changes/2026-09-12-PKG-DPIP-02-tests.md",
|
||||
"baselines/dpip-behavior-validation.json",
|
||||
"dpip-validation.md"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "PKG-DPIP-03",
|
||||
|
||||
Reference in new issue
Block a user