tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit ef1e4efe8c5de32113541ada472046bbcf92a2ab
parent 6f5eca3c03871900231431b411cb995ecf1a248f
Author: Tatsunori Uchino <tats.u@live.jp>
Date:   Thu,  9 Oct 2025 14:11:51 +0000

Bug 1950321 - Treat IDEOGRAPHIC SPACE as CJK punctuation. r=layout-reviewers,dshin

Differential Revision: https://phabricator.services.mozilla.com/D267510

Diffstat:
Mintl/unicharutil/util/nsUnicharUtils.cpp | 10+++++++++-
Atesting/web-platform/tests/css/css-text/line-breaking/segment-break-transformation-punctuation-003-ref.html | 10++++++++++
Atesting/web-platform/tests/css/css-text/line-breaking/segment-break-transformation-punctuation-003.html | 15+++++++++++++++
3 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/intl/unicharutil/util/nsUnicharUtils.cpp b/intl/unicharutil/util/nsUnicharUtils.cpp @@ -533,10 +533,18 @@ bool IsEastAsianPunctuation(uint32_t u) { // Punctuation). So we treat FULLWIDTH TILDE as punctuation here to give the // two characters consistent behavior. constexpr uint32_t kFullwidthTilde = 0xFF5E; + // U+3000 IDEOGRAPHIC SPACE has General Category = Zs (not Punctuation), + // but it conflicts with a JLReq rule that space added after + // question or exclamation mark is stipulated to be full-width if line is + // broken after full-width space following such a punctuation mark but + // line break is replaced by a space. So we treat IDEOGRAPHIC SPACE as + // punctuation here to allow line breaks after it while maintaining + // compatibility with JLReq. + constexpr uint32_t kIdeographicSpace = 0x3000; return intl::UnicodeProperties::IsEastAsianWidthFHW(u) && ((intl::UnicodeProperties::IsPunctuation(u) && u != kWonCurrencySign) || - u == kFullwidthTilde); + u == kFullwidthTilde || u == kIdeographicSpace); } bool IsPunctuationForWordSelect(char16_t aCh) { diff --git a/testing/web-platform/tests/css/css-text/line-breaking/segment-break-transformation-punctuation-003-ref.html b/testing/web-platform/tests/css/css-text/line-breaking/segment-break-transformation-punctuation-003-ref.html @@ -0,0 +1,10 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>Segment break transformation: CJK punctuation</title> + +<p lang="ja"> +日本語のテキスト! English textを埋め込む。 +</p> +<p lang="ja"> +日本語のテキスト! English textを埋め込む。 +</p> diff --git a/testing/web-platform/tests/css/css-text/line-breaking/segment-break-transformation-punctuation-003.html b/testing/web-platform/tests/css/css-text/line-breaking/segment-break-transformation-punctuation-003.html @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>Segment break transformation: CJK punctuation</title> +<link rel="author" title="Tatsunori Uchino" href="mailto:tats.u@live.jp"> +<link rel="match" href="segment-break-transformation-punctuation-003-ref.html"> +<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1950321"> +<meta name="flags" content="should" /> + +<p lang="ja"> +日本語のテキスト!  +English textを埋め込む。 +</p> +<p lang="ja"> +日本語のテキスト! English textを埋め込む。 +</p>