From b3fc6c9c82e92f4161e895ec511682b715eb02b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Fri, 9 Oct 2026 09:01:13 -0400 Subject: [PATCH] ElyMark: the probe also requires each task box drawn (R2.14) --- apps/ely-mark/examples/markprobe.rs | 3 ++- tasks/reviews/R2.14-r2.md | 3 +++ tests/scripts/mark-content.sh | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 tasks/reviews/R2.14-r2.md diff --git a/apps/ely-mark/examples/markprobe.rs b/apps/ely-mark/examples/markprobe.rs index b0ca08f..754328d 100644 --- a/apps/ely-mark/examples/markprobe.rs +++ b/apps/ely-mark/examples/markprobe.rs @@ -63,7 +63,8 @@ const CHECK: &str = r#" const line = range.getClientRects()[0]; const top = item.getBoundingClientRect().top + parseFloat(mark.marginTop); const size = parseFloat(getComputedStyle(item).fontSize); - return [parseFloat(mark.width) / size, parseFloat(mark.height) / size, top + parseFloat(mark.height) / 2 - (line.top + line.height / 2)]; + const drawn = mark.content !== 'none' && parseFloat(mark.borderTopWidth) > 0 && mark.borderTopStyle !== 'none'; + return [parseFloat(mark.width) / size, parseFloat(mark.height) / size, top + parseFloat(mark.height) / 2 - (line.top + line.height / 2), drawn]; }), cells: view.querySelectorAll('.milkdown td').length, notes: view.querySelectorAll('[data-type="footnote_definition"]').length, diff --git a/tasks/reviews/R2.14-r2.md b/tasks/reviews/R2.14-r2.md new file mode 100644 index 0000000..0770ef3 --- /dev/null +++ b/tasks/reviews/R2.14-r2.md @@ -0,0 +1,3 @@ +FAIL + +apps/ely-mark/examples/markprobe.rs:60(tests/scripts/mark-content.sh:66):任务框回归只读取伪元素的计算样式,遗漏任务框实际生成及可见性的断言。复现:在独立副本中仅删除 main.css:121 的 `content: '';`,重新构建并完整运行 `bash tests/scripts/mark-content.sh`,原生窗口截图中已勾选和未勾选框均消失,脚本仍以 0 退出并输出 `ok: mark content (background share 0.9458)`;visual、themed、preview 三阶段的两个框仍各报告 `[1,1,0.04688]`,会放过违反 R2.14 的任务框消失回退。修复方向:逐项校验伪元素确已生成且可见,并加入删除 `content` 声明的负例,使框消失触发测试失败。 diff --git a/tests/scripts/mark-content.sh b/tests/scripts/mark-content.sh index b8bffcf..1d1838a 100755 --- a/tests/scripts/mark-content.sh +++ b/tests/scripts/mark-content.sh @@ -63,8 +63,8 @@ for step in ("visual", "themed", "preview"): ("cells", 2), ("notes", 1), ("font", True), ("editors", 1)]: want(step, key, value) # Every task box: text-sized, centred on its line. - for width, height, off in seen[step]["boxes"]: - if abs(width - 1) > 0.01 or abs(height - 1) > 0.01 or abs(off) > 1: + for width, height, off, drawn in seen[step]["boxes"]: + if not drawn or abs(width - 1) > 0.01 or abs(height - 1) > 0.01 or abs(off) > 1: sys.exit(f"FAIL: {step} task boxes are {seen[step]['boxes']}") blocks = seen[step]["blocks"] if [block["language"] for block in blocks] != languages: