commit fc05c7b385310c68f791aad57d4bf4a10801169a
parent d151c1720d9b0e975fc3aaaffde27f04cfb52d62
Author: Koji Ishii <kojii@chromium.org>
Date: Mon, 17 Nov 2025 21:50:31 +0000
Bug 2000523 [wpt PR 56048] - [text-spacing-trim] Fix fallback + `chws` case, a=testonly
Automatic update from web-platform-tests
[text-spacing-trim] Fix fallback + `chws` case
This patch fixes excessive kerning when font fallback occurs
with the fonts with the `chws` feature. The initial patch to
support font fallback in crbug.com/431660829 disabled the
`chws` code path, as scanning all characters is necessary to
prevent insufficient kerning.
Reviewing it further, when disabling the `chws` code path,
the risk of excessive kerning was overlooked. The excessive
cases could occur more often than insufficient cases, and
excessive kerning is generally worse than insufficient kerning.
This patch thus fixes the excessive cases. Fixing the
insufficient cases should be in future patches.
Bug: 440947112
Change-Id: I63dc4d1313e90c81a75def775aaa6feae31f0632
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7156034
Reviewed-by: Kent Tamura <tkent@chromium.org>
Auto-Submit: Koji Ishii <kojii@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1545692}
--
wpt-commits: 9836906f29f845546f4ff976e0644d85c789d75c
wpt-pr: 56048
Diffstat:
2 files changed, 64 insertions(+), 0 deletions(-)
diff --git a/testing/web-platform/tests/css/css-text/text-spacing-trim/text-spacing-trim-fallback-002-ref.html b/testing/web-platform/tests/css/css-text/text-spacing-trim/text-spacing-trim-fallback-002-ref.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<script src="support/variant-class.js"></script>
+<style>
+@font-face {
+ font-family: halt-font;
+ font-display: block;
+ src: url('/fonts/noto/cjk/NotoSansCJKjp-Regular-subset-halt.otf');
+}
+#container {
+ font-family: Arial, halt-font;
+ font-size: 20px;
+ text-spacing-trim: space-all;
+}
+:root.vrl {
+ writing-mode: vertical-rl;
+}
+halt {
+ font-feature-settings: 'halt' 1, 'vhal' 1;
+}
+</style>
+<div id="container" lang="ja">
+ <div>(1<halt>)</halt>。</div>
+ <div>(?<halt>)</halt>、</div>
+ <div>(1<halt>)</halt>)</div>
+ <div>(1<halt>。</halt>。</div>
+</div>
diff --git a/testing/web-platform/tests/css/css-text/text-spacing-trim/text-spacing-trim-fallback-002.html b/testing/web-platform/tests/css/css-text/text-spacing-trim/text-spacing-trim-fallback-002.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<link rel="help" href="https://drafts.csswg.org/css-text-4/#text-spacing-trim-property">
+<link rel="match" href="text-spacing-trim-fallback-002-ref.html">
+<meta name="variant" content="?class=halt,htb">
+<meta name="variant" content="?class=chws,htb">
+<meta name="variant" content="?class=halt,vrl">
+<meta name="variant" content="?class=chws,vrl">
+<script src="support/variant-class.js"></script>
+<style>
+@font-face {
+ font-family: halt-font;
+ font-display: block;
+ src: url('/fonts/noto/cjk/NotoSansCJKjp-Regular-subset-halt.otf');
+}
+@font-face {
+ font-family: chws-font;
+ font-display: block;
+ src: url('/fonts/noto/cjk/NotoSansCJKjp-Regular-subset-chws.otf');
+}
+#container {
+ font-family: Arial, halt-font;
+ font-size: 20px;
+}
+.chws #container {
+ font-family: Arial, chws-font;
+}
+:root.vrl {
+ writing-mode: vertical-rl;
+}
+</style>
+<div id="container" lang="ja">
+ <div>(1)。</div>
+ <div>(?)、</div>
+ <div>(1))</div>
+ <div>(1。。</div>
+</div>