commit dff960f9fda13bafe881683b9d67db7bd8e59b92
parent 94d205f41cb305039a7e9a96224d0a1bbc7cf088
Author: Kent Tamura <tkent@chromium.org>
Date: Fri, 19 Dec 2025 09:14:27 +0000
Bug 2006232 [wpt PR 56768] - text-justify: Do not expand between cursive script characters, a=testonly
Automatic update from web-platform-tests
text-justify: Do not expand between cursive script characters
* core/layout/inline/
Support to add space before atomic inlines and ruby columns
* platform/text/character.*
Add IsCursiveScript(). It's used in justification_opportunity.cc.
* platform/text/justification_opportunity.*
** JustificationContext: Add a field to keep track the previous
character type.
** Each of consecutive atomic-inlines and consecutive cursive script
characters should be handled as a single typographic unit, so an
atomic-inline or a cursive script character should not produce
after-glyph opportunity, and we should produce before-glyph
opportunity on changing character type.
Bug: 40321528
Change-Id: I67987f0abc214cbba1af4174e163b967441e89b3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7250410
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Auto-Submit: Kent Tamura <tkent@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1559066}
--
wpt-commits: dc284ebad4f21c3bbef0095c3b27a1005d1c5a38
wpt-pr: 56768
Diffstat:
2 files changed, 61 insertions(+), 0 deletions(-)
diff --git a/testing/web-platform/tests/css/css-text/text-justify/text-justify-inter-character-cursive-ref.html b/testing/web-platform/tests/css/css-text/text-justify/text-justify-inter-character-cursive-ref.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<style>
+p {
+ font-size: 2em;
+ border: 1px solid black;
+ padding: 10px 0px;
+}
+.test {
+ text-align-last: justify;
+ text-justify: inter-character;
+}
+.test img {
+ width: 20px;
+ height: 20px;
+ vertical-align: top;
+}
+span {
+ text-justify: none;
+}
+</style>
+</head>
+<body>
+<p class="test"><span>مرحبا</span> <span>بالعالم</span>foo</p>
+<p class="test"><span>مرحبا</span> <span>بالعالم</span><img src="/images/blue.png"></p>
+</body>
+</html>
diff --git a/testing/web-platform/tests/css/css-text/text-justify/text-justify-inter-character-cursive.html b/testing/web-platform/tests/css/css-text/text-justify/text-justify-inter-character-cursive.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>text-justify: inter-character for cursive script</title>
+<link rel="author" href="mailto:tkent@chromium.org">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#valdef-text-justify-inter-character">
+<link rel="help" href="https://drafts.csswg.org/css-text-3/#justify-cursive">
+<link rel='match' href='text-justify-inter-character-cursive-ref.html'>
+<meta name="assert" content="text-justify:inter-character should not break connected characters.">
+<style>
+p {
+ font-size: 2em;
+ border: 1px solid black;
+ padding: 10px 0px;
+}
+.test {
+ text-align-last: justify;
+ text-justify: inter-character;
+}
+.test img {
+ width: 20px;
+ height: 20px;
+ vertical-align: top;
+}
+</style>
+</head>
+<body>
+<p class="test">مرحبا بالعالمfoo</p>
+<p class="test">مرحبا بالعالم<img src="/images/blue.png"></p>
+</body>
+</html>