fix: 修复行缘、切分还原与语言解析并同步文档

保留逐字 margin/jiya.bias 字体后备方案;补齐 demo 重排、量测边界说明及共享规则 1.0.1 反例向量。

验证:完整构建通过,Node 376 项、WKWebView 64 项及原生 demo 9 项通过;Firefox 仍暂缓。
This commit is contained in:
2026-10-03 21:15:54 +08:00
parent 024ad5da93
commit 3a4fa1c932
33 changed files with 983 additions and 140 deletions
+13 -1
View File
@@ -187,7 +187,7 @@ test("shared rules: Ajv 2020 strict validation, rejection cases, exports, and co
assert.equal(rulesSchema.$schema, "https://json-schema.org/draft/2020-12/schema");
assert.equal(vectorsSchema.$schema, "https://json-schema.org/draft/2020-12/schema");
assert.equal(rules.schemaVersion, 1);
assert.equal(rules.rulesetVersion, "1.0.0");
assert.equal(rules.rulesetVersion, "1.0.1");
assert.equal(rules.unicodeProfile.version, "17.0.0");
assert.equal(vectorsDoc.schemaVersion, 1);
assert.equal(vectorsDoc.rulesetVersion, rules.rulesetVersion);
@@ -312,6 +312,18 @@ test("shared rules: explicit script identifiers match whole subtags", () =>
}
});
test("Web locale: own lang and explicit unknown stop inheritance", () =>
{
const dom = new JSDOM('<main lang="zh-Hans"><p lang=""><span>甲</span></p></main>');
const paragraph = dom.window.document.querySelector("p");
assert.equal(adapter.effectiveLang(paragraph, "ja"), "");
assert.equal(adapter.effectiveLang(paragraph.firstChild.firstChild, "ja"), "");
assert.equal(adapter.effectiveLang(dom.window.document.querySelector("main"), "ja"), "zh-hans");
paragraph.removeAttribute("lang");
assert.equal(adapter.effectiveLang(paragraph, "ja"), "zh-hans");
dom.window.close();
});
test("shared rules: locale defaults and all language vectors match the Web adapter", () =>
{
const config = { default: "zh-Hant", policy: {} };