fix(web): 修復排版邊界與增量生命週期

This commit is contained in:
2026-10-02 19:08:02 +08:00
parent 1c2fb0ed59
commit b1a16c4969
39 changed files with 4763 additions and 673 deletions
+7 -3
View File
@@ -691,7 +691,7 @@ test("moved IVS ownership: anchor and text-move throws roll back exactly", () =>
}
});
test("moved IVS ownership: partial roots and detached links restore as one unit", () =>
test("moved IVS ownership: partial roots restore as one unit; deleted carrier stays deleted", () =>
{
const original = '<strong id="partial-base">\u{20000}</strong>'
+ '<em id="partial-selector">\u{E0100}A</em>';
@@ -746,10 +746,14 @@ test("moved IVS ownership: partial roots and detached links restore as one unit"
}
jz.revert(revertRoot);
assert.equal(paragraph.innerHTML, original, `${kind} restores exact author DOM`);
// 移除整個載體即刪除其原文;不能因回退另一端而復活已刪 base/VS。
const expected = kind === "detached-gap"
? '<strong id="partial-base"></strong><em id="partial-selector">A</em>' : original;
assert.equal(paragraph.innerHTML, expected, `${kind} restores or preserves exact author DOM`);
assert.equal(paragraph.querySelector("#partial-base"), base, `${kind} base identity`);
assert.equal(paragraph.querySelector("#partial-selector"), selectorParent, `${kind} parent identity`);
assert.equal(selectorParent.textContent, "\u{E0100}A", `${kind} selector original parent`);
assert.equal(selectorParent.textContent, kind === "detached-gap" ? "A" : "\u{E0100}A",
`${kind} selector original parent`);
assert.equal(countTag(paragraph, "jz-hws"), 0, `${kind} removes linked gap`);
assert.equal(
Array.from(outside.childNodes).filter((node) => node.nodeType === 8).length,