Backed out 14 changesets (bug 1719535) for causing mochitest failures in accessible/tests/browser/mac/browser_text_basics.js CLOSED TREE

Backed out changeset 338c2c8d91af (bug 1719535)
Backed out changeset 3fdb2e999aba (bug 1719535)
Backed out changeset 63b9d2064827 (bug 1719535)
Backed out changeset 09c216cdbbc8 (bug 1719535)
Backed out changeset 29977dc00fb3 (bug 1719535)
Backed out changeset d3f8850a343b (bug 1719535)
Backed out changeset 90f1f621031f (bug 1719535)
Backed out changeset 52ca9bdc5bd4 (bug 1719535)
Backed out changeset 94536f0d5a1f (bug 1719535)
Backed out changeset d615264f9f5f (bug 1719535)
Backed out changeset f16f9e583378 (bug 1719535)
Backed out changeset e1abdee07587 (bug 1719535)
Backed out changeset 45f9ad406428 (bug 1719535)
Backed out changeset caa2b8a731dc (bug 1719535)
This commit is contained in:
Sandor Molnar 2023-08-02 14:55:26 +03:00
parent 381d834ac6
commit 13c7e4a350
1637 changed files with 58331 additions and 152201 deletions

View File

@ -115,11 +115,6 @@ git = "https://github.com/mozilla/uniffi-rs.git"
rev = "c0e64b839018728d8153ce1758d391b7782e2e21"
replace-with = "vendored-sources"
[source."git+https://github.com/rust-diplomat/diplomat?rev=8d125999893fedfdf30595e97334c21ec4b18da9"]
git = "https://github.com/rust-diplomat/diplomat"
rev = "8d125999893fedfdf30595e97334c21ec4b18da9"
replace-with = "vendored-sources"
[source."git+https://github.com/rust-minidump/minidump-writer.git?rev=a15bd5cab6a3de251c0c23264be14b977c0af09c"]
git = "https://github.com/rust-minidump/minidump-writer.git"
rev = "a15bd5cab6a3de251c0c23264be14b977c0af09c"
@ -130,11 +125,6 @@ git = "https://github.com/rust-minidump/rust-minidump"
rev = "87a29fba5e19cfae5ebf73a57ba31504a3872545"
replace-with = "vendored-sources"
[source."git+https://github.com/unicode-org/icu4x?rev=14e9a3a9857be74582abe2dfa7ab799c5eaac873"]
git = "https://github.com/unicode-org/icu4x"
rev = "14e9a3a9857be74582abe2dfa7ab799c5eaac873"
replace-with = "vendored-sources"
# Take advantage of the fact that cargo will treat lines starting with #
# as comments to add preprocessing directives. This file can thus by copied

251
Cargo.lock generated
View File

@ -1323,36 +1323,6 @@ dependencies = [
"crypto-common",
]
[[package]]
name = "diplomat"
version = "0.5.2"
source = "git+https://github.com/rust-diplomat/diplomat?rev=8d125999893fedfdf30595e97334c21ec4b18da9#8d125999893fedfdf30595e97334c21ec4b18da9"
dependencies = [
"diplomat_core",
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "diplomat-runtime"
version = "0.5.2"
source = "git+https://github.com/rust-diplomat/diplomat?rev=8d125999893fedfdf30595e97334c21ec4b18da9#8d125999893fedfdf30595e97334c21ec4b18da9"
[[package]]
name = "diplomat_core"
version = "0.5.2"
source = "git+https://github.com/rust-diplomat/diplomat?rev=8d125999893fedfdf30595e97334c21ec4b18da9#8d125999893fedfdf30595e97334c21ec4b18da9"
dependencies = [
"lazy_static",
"proc-macro2",
"quote",
"serde",
"smallvec",
"strck_ident",
"syn",
]
[[package]]
name = "dirs"
version = "4.0.0"
@ -2591,115 +2561,6 @@ dependencies = [
"want",
]
[[package]]
name = "icu_capi"
version = "1.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c29e1e7407081a5e425b295ef28526ca4c3cd7ce4475e1769c2863bb18b9305"
dependencies = [
"diplomat",
"diplomat-runtime",
"icu_locid",
"icu_provider",
"icu_provider_adapters",
"icu_segmenter",
"icu_testdata",
"log",
"tinystr",
"writeable",
]
[[package]]
name = "icu_collections"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef8302d8dfd6044d3ddb3f807a5ef3d7bbca9a574959c6d6e4dc39aa7012d0d5"
dependencies = [
"displaydoc",
"yoke",
"zerofrom",
"zerovec",
]
[[package]]
name = "icu_locid"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3003f85dccfc0e238ff567693248c59153a46f4e6125ba4020b973cef4d1d335"
dependencies = [
"displaydoc",
"litemap",
"tinystr",
"writeable",
"zerovec",
]
[[package]]
name = "icu_provider"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8dc312a7b6148f7dfe098047ae2494d12d4034f48ade58d4f353000db376e305"
dependencies = [
"displaydoc",
"icu_locid",
"icu_provider_macros",
"stable_deref_trait",
"writeable",
"yoke",
"zerofrom",
"zerovec",
]
[[package]]
name = "icu_provider_adapters"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f4ae1e2bd0c41728b77e7c46e9afdec5e2127d1eedacc684724667d50c126bd3"
dependencies = [
"icu_locid",
"icu_provider",
"tinystr",
"yoke",
"zerovec",
]
[[package]]
name = "icu_provider_macros"
version = "1.2.0"
source = "git+https://github.com/unicode-org/icu4x?rev=14e9a3a9857be74582abe2dfa7ab799c5eaac873#14e9a3a9857be74582abe2dfa7ab799c5eaac873"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "icu_segmenter"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3300a7b6bf187be98a57264ad094f11f2e062c2e8263132af010ff522ee5495"
dependencies = [
"displaydoc",
"icu_collections",
"icu_locid",
"icu_provider",
"num-traits",
"utf8_iter",
"zerovec",
]
[[package]]
name = "icu_testdata"
version = "1.2.0"
dependencies = [
"icu_collections",
"icu_locid",
"icu_provider",
"icu_provider_adapters",
"icu_segmenter",
"zerovec",
]
[[package]]
name = "id-arena"
version = "2.2.1"
@ -2956,7 +2817,6 @@ dependencies = [
"encoding_c",
"encoding_c_mem",
"gluesmith",
"icu_capi",
"mozglue-static",
"smoosh",
]
@ -3094,12 +2954,6 @@ dependencies = [
"winapi",
]
[[package]]
name = "libm"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb"
[[package]]
name = "libsqlite3-sys"
version = "0.26.0"
@ -3144,12 +2998,6 @@ version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
[[package]]
name = "litemap"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a04a5b2b6f54acba899926491d0a6c59d98012938ca2ab5befb281c034e8f94"
[[package]]
name = "lmdb-rkv"
version = "0.14.0"
@ -3979,7 +3827,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd"
dependencies = [
"autocfg",
"libm",
]
[[package]]
@ -5138,22 +4985,6 @@ dependencies = [
"xpcom",
]
[[package]]
name = "strck"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be91090ded9d8f979d9fe921777342d37e769e0b6b7296843a7a38247240e917"
[[package]]
name = "strck_ident"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1c3802b169b3858a44667f221c9a0b3136e6019936ea926fc97fbad8af77202"
dependencies = [
"strck",
"unicode-ident",
]
[[package]]
name = "strsim"
version = "0.10.0"
@ -5457,7 +5288,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ac3f5b6856e931e15e07b478e98c8045239829a65f9156d4fa7e7788197a5ef"
dependencies = [
"displaydoc",
"zerovec",
]
[[package]]
@ -5674,9 +5504,9 @@ dependencies = [
[[package]]
name = "unicode-bidi"
version = "0.3.13"
version = "0.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460"
checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992"
[[package]]
name = "unicode-ident"
@ -5945,12 +5775,6 @@ dependencies = [
"serde",
]
[[package]]
name = "utf8_iter"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "64a8922555b9500e3d865caed19330172cd67cbf82203f1a3311d8c305cc9f33"
[[package]]
name = "uuid"
version = "1.3.0"
@ -6490,12 +6314,6 @@ dependencies = [
"euclid",
]
[[package]]
name = "writeable"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60e49e42bdb1d5dc76f4cd78102f8f0714d32edfa3efb82286eb0f0b1fc0da0f"
[[package]]
name = "xml-rs"
version = "0.8.4"
@ -6554,29 +6372,6 @@ dependencies = [
"linked-hash-map",
]
[[package]]
name = "yoke"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1848075a23a28f9773498ee9a0f2cf58fcbad4f8c0ccf84a210ab33c6ae495de"
dependencies = [
"serde",
"stable_deref_trait",
"yoke-derive",
"zerofrom",
]
[[package]]
name = "yoke-derive"
version = "0.7.1"
source = "git+https://github.com/unicode-org/icu4x?rev=14e9a3a9857be74582abe2dfa7ab799c5eaac873#14e9a3a9857be74582abe2dfa7ab799c5eaac873"
dependencies = [
"proc-macro2",
"quote",
"syn",
"synstructure",
]
[[package]]
name = "zeitstempel"
version = "0.1.1"
@ -6588,48 +6383,6 @@ dependencies = [
"once_cell",
]
[[package]]
name = "zerofrom"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df54d76c3251de27615dfcce21e636c172dafb2549cd7fd93e21c66f6ca6bea2"
dependencies = [
"zerofrom-derive",
]
[[package]]
name = "zerofrom-derive"
version = "0.1.2"
source = "git+https://github.com/unicode-org/icu4x?rev=14e9a3a9857be74582abe2dfa7ab799c5eaac873#14e9a3a9857be74582abe2dfa7ab799c5eaac873"
dependencies = [
"proc-macro2",
"quote",
"syn",
"synstructure",
]
[[package]]
name = "zerovec"
version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "198f54134cd865f437820aa3b43d0ad518af4e68ee161b444cdd15d8e567c8ea"
dependencies = [
"yoke",
"zerofrom",
"zerovec-derive",
]
[[package]]
name = "zerovec-derive"
version = "0.9.4"
source = "git+https://github.com/unicode-org/icu4x?rev=14e9a3a9857be74582abe2dfa7ab799c5eaac873#14e9a3a9857be74582abe2dfa7ab799c5eaac873"
dependencies = [
"proc-macro2",
"quote",
"syn",
"synstructure",
]
[[package]]
name = "zip"
version = "0.6.4"

View File

@ -185,7 +185,6 @@ chardetng_c = { git = "https://github.com/hsivonen/chardetng_c", rev = "ed8a4c6f
coremidi = { git = "https://github.com/chris-zen/coremidi.git", rev = "fc68464b5445caf111e41f643a2e69ccce0b4f83" }
cose = { git = "https://github.com/franziskuskiefer/cose-rust", rev = "43c22248d136c8b38fe42ea709d08da6355cf04b" }
firefox-on-glean = { path = "toolkit/components/glean/api" }
icu_testdata = { path = "intl/icu_testdata" }
libudev-sys = { path = "dom/webauthn/libudev-sys" }
packed_simd = { package = "packed_simd_2", git = "https://github.com/hsivonen/packed_simd", rev = "412f9a0aa556611de021bde89dee8fefe6e0fbbd" }
midir = { git = "https://github.com/mozilla/midir.git", rev = "519e651241e867af3391db08f9ae6400bc023e18" }
@ -204,14 +203,6 @@ tabs = { git = "https://github.com/mozilla/application-services", rev = "25972c3
viaduct = { git = "https://github.com/mozilla/application-services", rev = "25972c388a4cf3a6d8256504f3a09b711db2fc6a" }
webext-storage = { git = "https://github.com/mozilla/application-services", rev = "25972c388a4cf3a6d8256504f3a09b711db2fc6a" }
# ICU4X 1.2 with synstructure 0.13.x / syn 2.x. When updating to next version, this should be removed.
diplomat = { git = "https://github.com/rust-diplomat/diplomat", rev = "8d125999893fedfdf30595e97334c21ec4b18da9" }
diplomat-runtime = { git = "https://github.com/rust-diplomat/diplomat", rev = "8d125999893fedfdf30595e97334c21ec4b18da9" }
icu_provider_macros = { git = "https://github.com/unicode-org/icu4x", rev = "14e9a3a9857be74582abe2dfa7ab799c5eaac873" }
yoke-derive = { git = "https://github.com/unicode-org/icu4x", rev = "14e9a3a9857be74582abe2dfa7ab799c5eaac873" }
zerofrom-derive = { git = "https://github.com/unicode-org/icu4x", rev = "14e9a3a9857be74582abe2dfa7ab799c5eaac873" }
zerovec-derive = { git = "https://github.com/unicode-org/icu4x", rev = "14e9a3a9857be74582abe2dfa7ab799c5eaac873" }
# Patch mio 0.6 to use winapi 0.3 and miow 0.3, getting rid of winapi 0.2.
# There is not going to be new version of mio 0.6, mio now being >= 0.7.11.
[patch.crates-io.mio]

View File

@ -17,14 +17,7 @@
SimpleTest.expectAssertions(0, 1);
}
async function doTest() {
test_common();
await test_per_segmenter(false);
await test_per_segmenter(true);
SimpleTest.finish();
}
function test_common() {
function doTest() {
// "one two"
testWords("div1", ["one", "two"]);
@ -56,21 +49,38 @@
testWordAt("div7", 0, "one", kOk);
testWordAt("div7", 1, "two", kTodo);
// "one.two"
testWordCount("div8", 2, kOk);
testWordAt("div8", 0, "one", kTodo);
testWordAt("div8", 1, "two", kOk);
// "345"
testWords("div9", ["345"]);
// "3a A4"
testWords("div10", ["3a", "A4"]);
// "3.1416"
testWords("div11", ["3.1416"], kTodo);
// "4,261.01"
testWords("div12", ["4,261.01"], kTodo);
// "カタカナ"
testWords("div13", ["カタカナ"], kOk);
// "Peter's car"
testWords("div14", ["Peter's", "car"], kTodo);
// "N.A.T.O."
testWords("div15", ["N.A.T.O."], kTodo);
// "3+4*5=23"
testWordCount("div16", 4, kOk);
testWordAt("div16", 0, "3", kTodo);
testWordAt("div16", 1, "4", kTodo);
testWordAt("div16", 2, "5", kTodo);
testWordAt("div16", 3, "23", kTodo);
testWordAt("div15", 0, "3", kTodo);
testWordAt("div15", 1, "4", kTodo);
testWordAt("div15", 2, "5", kTodo);
testWordAt("div15", 3, "23", kTodo);
// "Hello. Friend, are you here?!"
testWordCount("div17", 5, kOk);
@ -81,37 +91,8 @@
testWordAt("div17", 4, "here", kTodo);
testWords("input_1", ["foo", "bar"]);
}
async function test_per_segmenter(aNewSegmenter) {
// If aNewSegmenter is true, use UAX#14/#29 compatible segmenter.
await SpecialPowers.pushPrefEnv({"set": [
["intl.icu4x.segmenter.enabled", aNewSegmenter],
]});
// "one.two"
if (aNewSegmenter) {
testWordCount("div8", 1, kOk);
testWordAt("div8", 0, "one.two", kOk);
} else {
testWordCount("div8", 2, kOk);
testWordAt("div8", 0, "one", kTodo);
testWordAt("div8", 1, "two", kOk);
}
// "3.1416"
testWords("div11", ["3.1416"], aNewSegmenter ? kOk : kTodo);
// "4,261.01"
testWords("div12", ["4,261.01"], aNewSegmenter ? kOk: kTodo);
// "Peter's car"
testWords("div14", ["Peter's", "car"], aNewSegmenter ? kOk : kTodo);
// "N.A.T.O."
testWords("div15", ["N.A.T.O."], aNewSegmenter ? kOk : kTodo);
await SpecialPowers.popPrefEnv();
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();

29
config/external/icu4x/icu4x_data.S vendored Normal file
View File

@ -0,0 +1,29 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#if defined(_WIN32) && defined(__i386__)
// Mark the object as SAFESEH-enabled.
.def @feat.00;
.scl 3;
.type 0;
.endef
.global @feat.00
.set @feat.00, 1
#endif
.global ICU4X_DATA_SYMBOL
#if defined(__APPLE__)
.data
.const
#elif defined(__wasi__)
.section .rodata,"",@
#else
.section .rodata
#endif
.balign 16
ICU4X_DATA_SYMBOL:
.incbin ICU4X_DATA_FILE
#ifdef __wasi__
.size ICU4X_DATA_SYMBOL, . - ICU4X_DATA_SYMBOL
#endif

35
config/external/icu4x/moz.build vendored Normal file
View File

@ -0,0 +1,35 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Build the ICU4X data directly into the binary file. This is an experiment that can
# be enabled by adding `ac_add_options --enable-icu4x` to your mozconfig.
# See `intl/ICU4X.md`.
if CONFIG["MOZ_ICU4X"]:
DEFINES["MOZ_ICU4X"] = 1
Library("icu4xdata")
LOCAL_INCLUDES += ["."]
# The "mangled" symbol gets prefixed by a "_" in certain platforms.
symbol_prefix = ""
if (CONFIG["OS_ARCH"] == "WINNT" and CONFIG["CPU_ARCH"] == "x86") or CONFIG[
"OS_ARCH"
] == "Darwin":
symbol_prefix = "_"
# To re-generate this file run: intl/update-icu4x.sh
DEFINES["ICU4X_DATA_FILE"] = '"icu4x.postcard"'
# In C++ this data will be available via:
#
# extern uint8_t icu4x_static_locale_data;
# uint8_t firstByte = (&icu4x_static_locale_data)[0];
DEFINES["ICU4X_DATA_SYMBOL"] = "%s%s" % (symbol_prefix, "icu4x_static_locale_data")
# This is assembly which has instructions to include the binary locale data directly.
SOURCES += [
"icu4x_data.S",
]

View File

@ -26,6 +26,9 @@ DIRS += [
"/third_party/sipcc",
]
if CONFIG["MOZ_ICU4X"]:
DIRS += ["icu4x"]
# There's no "native" brotli or woff2 yet, but probably in the future...
external_dirs += ["modules/brotli"]
external_dirs += ["modules/woff2"]

View File

@ -131,19 +131,7 @@ int32_t nsPlainTextSerializer::CurrentLine::FindWrapIndexForContent(
// mContent until we find a width less than or equal to wrap column.
uint32_t width = 0;
intl::LineBreakIteratorUtf16 lineBreakIter(mContent);
while (Maybe<uint32_t> nextGoodSpace = lineBreakIter.Next()) {
// Trim space at the tail. UAX#14 doesn't have break opportunity for
// ASCII space at the tail.
const Maybe<uint32_t> originalNextGoodSpace = nextGoodSpace;
while (*nextGoodSpace > 0 &&
mContent.CharAt(*nextGoodSpace - 1) == 0x20) {
nextGoodSpace = Some(*nextGoodSpace - 1);
}
if (*nextGoodSpace == 0) {
// Restore the original nextGoodSpace.
nextGoodSpace = originalNextGoodSpace;
}
while (const Maybe<uint32_t> nextGoodSpace = lineBreakIter.Next()) {
width += GetUnicharStringWidth(Span<const char16_t>(
mContent.get() + goodSpace, *nextGoodSpace - goodSpace));
if (prefixwidth + width > aWrapColumn) {

View File

@ -1560,19 +1560,6 @@ bool nsXMLContentSerializer::AppendWrapped_NonWhitespaceSequence(
MOZ_ASSERT(nextWrapPosition.isSome(),
"We should've exited the loop when reaching the end of "
"text in the previous iteration!");
// Trim space at the tail. UAX#14 doesn't have break opportunity
// for ASCII space at the tail.
const Maybe<uint32_t> originalNextWrapPosition = nextWrapPosition;
while (*nextWrapPosition > 0 &&
subSeq.at(*nextWrapPosition - 1) == 0x20) {
nextWrapPosition = Some(*nextWrapPosition - 1);
}
if (*nextWrapPosition == 0) {
// Restore the original nextWrapPosition.
nextWrapPosition = originalNextWrapPosition;
}
if (aSequenceStart + *nextWrapPosition > aPos) {
break;
}

View File

@ -514,9 +514,6 @@ const knownFailures = {
"S-Proposed-SM:m.b.w_TEXT-1_SI-1-dM": true,
"S-Proposed-SM:m.b.w_TEXT-1_SI-1-body": true,
"S-Proposed-SM:m.b.w_TEXT-1_SI-1-div": true,
"S-Proposed-SM:m.b.w_TEXT-th_SC-2-dM": SpecialPowers.getBoolPref("intl.icu4x.segmenter.enabled", true),
"S-Proposed-SM:m.b.w_TEXT-th_SC-2-body": SpecialPowers.getBoolPref("intl.icu4x.segmenter.enabled", true),
"S-Proposed-SM:m.b.w_TEXT-th_SC-2-div": SpecialPowers.getBoolPref("intl.icu4x.segmenter.enabled", true),
"S-Proposed-SM:m.f.c_CHAR-5_SI-2-dM": true,
"S-Proposed-SM:m.f.c_CHAR-5_SI-2-body": true,
"S-Proposed-SM:m.f.c_CHAR-5_SI-2-div": true,
@ -526,12 +523,12 @@ const knownFailures = {
"S-Proposed-SM:m.b.c_CHAR-5_SR-dM": true,
"S-Proposed-SM:m.b.c_CHAR-5_SR-body": true,
"S-Proposed-SM:m.b.c_CHAR-5_SR-div": true,
"S-Proposed-SM:m.f.w_TEXT-jp_SC-1-dM": !SpecialPowers.getBoolPref("intl.icu4x.segmenter.enabled", true),
"S-Proposed-SM:m.f.w_TEXT-jp_SC-1-body": !SpecialPowers.getBoolPref("intl.icu4x.segmenter.enabled", true),
"S-Proposed-SM:m.f.w_TEXT-jp_SC-1-div": !SpecialPowers.getBoolPref("intl.icu4x.segmenter.enabled", true),
"S-Proposed-SM:m.f.w_TEXT-jp_SC-2-dM": !SpecialPowers.getBoolPref("intl.icu4x.segmenter.enabled", true),
"S-Proposed-SM:m.f.w_TEXT-jp_SC-2-body": !SpecialPowers.getBoolPref("intl.icu4x.segmenter.enabled", true),
"S-Proposed-SM:m.f.w_TEXT-jp_SC-2-div": !SpecialPowers.getBoolPref("intl.icu4x.segmenter.enabled", true),
"S-Proposed-SM:m.f.w_TEXT-jp_SC-1-dM": true,
"S-Proposed-SM:m.f.w_TEXT-jp_SC-1-body": true,
"S-Proposed-SM:m.f.w_TEXT-jp_SC-1-div": true,
"S-Proposed-SM:m.f.w_TEXT-jp_SC-2-dM": true,
"S-Proposed-SM:m.f.w_TEXT-jp_SC-2-body": true,
"S-Proposed-SM:m.f.w_TEXT-jp_SC-2-div": true,
"S-Proposed-SM:m.f.w_TEXT-jp_SC-5-dM": true,
"S-Proposed-SM:m.f.w_TEXT-jp_SC-5-body": true,
"S-Proposed-SM:m.f.w_TEXT-jp_SC-5-div": true,

View File

@ -73,17 +73,6 @@ UNIFIED_SOURCES += [
if not CONFIG["JS_STANDALONE"]:
TEST_DIRS += ["gtest"]
if CONFIG["MOZ_ICU4X"]:
EXPORTS.mozilla.intl += [
"src/ICU4XGeckoDataProvider.h",
]
UNIFIED_SOURCES += [
"src/ICU4XGeckoDataProvider.cpp",
]
LOCAL_INCLUDES += [
"/third_party/rust/icu_capi/c/include",
]
# At the time of this writing the MOZ_HAS_MOZGLUE define must be true in order to
# correctly include ConvertUtf8toUtf16 in certain include paths, otherwise it results
# in a compile time "undeclared identifier" error. See:

View File

@ -1,35 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "ICU4XGeckoDataProvider.h"
#include "ICU4XDataProvider.h"
#include "mozilla/Assertions.h"
#include <mutex>
namespace mozilla::intl {
static capi::ICU4XDataProvider* sICU4XDataProvider = nullptr;
capi::ICU4XDataProvider* GetDataProvider() {
static std::once_flag sOnce;
std::call_once(sOnce, []() {
sICU4XDataProvider = capi::ICU4XDataProvider_create_test();
});
return sICU4XDataProvider;
}
void CleanupDataProvider() {
if (!sICU4XDataProvider) {
return;
}
capi::ICU4XDataProvider_destroy(sICU4XDataProvider);
sICU4XDataProvider = nullptr;
}
} // namespace mozilla::intl

View File

@ -1,21 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef intl_components_ICU4XGeckoDataProvider_h
#define intl_components_ICU4XGeckoDataProvider_h
/**
* This component is a C/C++ API to get ICU4X data provider.
*/
namespace capi {
struct ICU4XDataProvider;
}
namespace mozilla::intl {
capi::ICU4XDataProvider* GetDataProvider();
void CleanupDataProvider();
} // namespace mozilla::intl
#endif

View File

@ -1,39 +0,0 @@
# This crate is replacement crates to use baked data provider in ICU4X's
# c_capi crate.
#
# To generate baked data, run /intl/update-icu4x.sh
[package]
name = "icu_testdata"
version = "1.2.0"
authors = ["The ICU4X Project Developers"]
edition = "2021"
license = "MPL-2.0"
categories = ["internationalization"]
# Keep this in sync with other crates unless there are exceptions
include = [
"src/**/*",
"Cargo.toml",
"data/**/*",
]
[package.metadata.docs.rs]
all-features = true
[dependencies]
icu_provider = { version = "1.2.0" }
icu_provider_adapters = { version = "1.2.0" }
# databake deps
icu_locid = { version = "1.2.0" }
icu_collections = { version = "1.2.0" }
icu_segmenter = { version = "1.2.1" }
zerovec = { version = "0.9.4" }
[dev-dependencies]
criterion = "0.4"
[features]
default = []
std = []
icu_segmenter = []

View File

@ -1,5 +0,0 @@
commit 5fcb6c19f72b2e5ad1d49b1a2332774c6d68c25d
Author: Manish Goregaokar <manishsmail@gmail.com>
Date: Fri Apr 14 14:33:34 2023 -0700
Fixup for locid_transform (#3328)

View File

@ -1,2 +0,0 @@
// @generated
impl_any_provider ! (BakedDataProvider) ;

File diff suppressed because one or more lines are too long

View File

@ -1,2 +0,0 @@
// @generated
pub mod w_auto_v1 ;

File diff suppressed because one or more lines are too long

View File

@ -1,2 +0,0 @@
// @generated
# ! [allow (clippy :: octal_escapes)] type DataStruct = < :: icu_segmenter :: provider :: DictionaryForWordOnlyAutoV1Marker as :: icu_provider :: DataMarker > :: Yokeable ; pub fn lookup (locale : & icu_provider :: DataLocale) -> Option < & 'static DataStruct > { icu_provider :: DataLocale :: from (icu_locid :: locale ! ("ja")) . eq (locale) . then (|| & JA) } static JA : DataStruct = include ! ("ja.rs.data") ;

View File

@ -1,2 +0,0 @@
// @generated
# ! [allow (clippy :: octal_escapes)] type DataStruct = < :: icu_segmenter :: provider :: GraphemeClusterBreakDataV1Marker as :: icu_provider :: DataMarker > :: Yokeable ; pub fn lookup (locale : & icu_provider :: DataLocale) -> Option < & 'static DataStruct > { locale . is_empty () . then (|| & UND) } static UND : DataStruct = include ! ("und.rs.data") ;

File diff suppressed because one or more lines are too long

View File

@ -1,2 +0,0 @@
// @generated
# ! [allow (clippy :: octal_escapes)] type DataStruct = < :: icu_segmenter :: provider :: LineBreakDataV1Marker as :: icu_provider :: DataMarker > :: Yokeable ; pub fn lookup (locale : & icu_provider :: DataLocale) -> Option < & 'static DataStruct > { locale . is_empty () . then (|| & UND) } static UND : DataStruct = include ! ("und.rs.data") ;

File diff suppressed because one or more lines are too long

View File

@ -1,2 +0,0 @@
// @generated
pub mod wl_auto_v1 ;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,2 +0,0 @@
// @generated
# ! [allow (clippy :: octal_escapes)] type DataStruct = < :: icu_segmenter :: provider :: LstmForWordLineAutoV1Marker as :: icu_provider :: DataMarker > :: Yokeable ; pub fn lookup (locale : & icu_provider :: DataLocale) -> Option < & 'static DataStruct > { static KEYS : [& str ; 4usize] = ["km" , "lo" , "my" , "th"] ; static DATA : [& DataStruct ; 4usize] = [& KM , & LO , & MY , & TH] ; KEYS . binary_search_by (| k | locale . strict_cmp (k . as_bytes ()) . reverse ()) . ok () . map (| i | unsafe { * DATA . get_unchecked (i) }) } static KM : DataStruct = include ! ("km.rs.data") ; static LO : DataStruct = include ! ("lo.rs.data") ; static MY : DataStruct = include ! ("my.rs.data") ; static TH : DataStruct = include ! ("th.rs.data") ;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,2 +0,0 @@
// @generated
pub mod dictionary ; pub mod grapheme_v1 ; pub mod line_v1 ; pub mod lstm ; pub mod sentence_v1 ; pub mod word_v1 ;

View File

@ -1,2 +0,0 @@
// @generated
# ! [allow (clippy :: octal_escapes)] type DataStruct = < :: icu_segmenter :: provider :: SentenceBreakDataV1Marker as :: icu_provider :: DataMarker > :: Yokeable ; pub fn lookup (locale : & icu_provider :: DataLocale) -> Option < & 'static DataStruct > { locale . is_empty () . then (|| & UND) } static UND : DataStruct = include ! ("und.rs.data") ;

File diff suppressed because one or more lines are too long

View File

@ -1,2 +0,0 @@
// @generated
# ! [allow (clippy :: octal_escapes)] type DataStruct = < :: icu_segmenter :: provider :: WordBreakDataV1Marker as :: icu_provider :: DataMarker > :: Yokeable ; pub fn lookup (locale : & icu_provider :: DataLocale) -> Option < & 'static DataStruct > { locale . is_empty () . then (|| & UND) } static UND : DataStruct = include ! ("und.rs.data") ;

File diff suppressed because one or more lines are too long

View File

@ -1,21 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use icu_provider::prelude::*;
/// An [`AnyProvider`] backed by baked data.
pub fn any() -> impl AnyProvider {
UnstableDataProvider
}
#[doc(hidden)]
#[non_exhaustive]
#[derive(Debug)]
pub struct UnstableDataProvider;
mod baked {
include!("../data/baked/mod.rs");
impl_data_provider!(super::UnstableDataProvider);
impl_any_provider!(super::UnstableDataProvider);
}

View File

@ -13,20 +13,6 @@
#include "mozilla/intl/Segmenter.h"
#include "mozilla/intl/UnicodeProperties.h"
#if defined(MOZ_ICU4X) && defined(JS_HAS_INTL_API)
# include "ICU4XDataProvider.h"
# include "ICU4XLineBreakIteratorLatin1.hpp"
# include "ICU4XLineBreakIteratorUtf16.hpp"
# include "ICU4XLineSegmenter.h"
# include "mozilla/CheckedInt.h"
# include "mozilla/ClearOnShutdown.h"
# include "mozilla/intl/ICU4XGeckoDataProvider.h"
# include "mozilla/StaticPrefs_intl.h"
# include "nsThreadUtils.h"
# include <mutex>
#endif
using namespace mozilla::unicode;
using namespace mozilla::intl;
@ -992,136 +978,9 @@ static bool SuppressBreakForKeepAll(uint32_t aPrev, uint32_t aCh) {
affectedByKeepAll(GetLineBreakClass(aCh));
}
#if defined(MOZ_ICU4X) && defined(JS_HAS_INTL_API)
static capi::ICU4XLineBreakStrictness ConvertLineBreakRuleToICU4X(
LineBreakRule aLevel) {
switch (aLevel) {
case LineBreakRule::Auto:
return capi::ICU4XLineBreakStrictness_Strict;
case LineBreakRule::Strict:
return capi::ICU4XLineBreakStrictness_Strict;
case LineBreakRule::Loose:
return capi::ICU4XLineBreakStrictness_Loose;
case LineBreakRule::Normal:
return capi::ICU4XLineBreakStrictness_Normal;
case LineBreakRule::Anywhere:
return capi::ICU4XLineBreakStrictness_Anywhere;
}
MOZ_ASSERT_UNREACHABLE("should have been handled already");
return capi::ICU4XLineBreakStrictness_Normal;
}
static capi::ICU4XLineBreakWordOption ConvertWordBreakRuleToICU4X(
WordBreakRule aWordBreak) {
switch (aWordBreak) {
case WordBreakRule::Normal:
return capi::ICU4XLineBreakWordOption_Normal;
case WordBreakRule::BreakAll:
return capi::ICU4XLineBreakWordOption_BreakAll;
case WordBreakRule::KeepAll:
return capi::ICU4XLineBreakWordOption_KeepAll;
}
MOZ_ASSERT_UNREACHABLE("should have been handled already");
return capi::ICU4XLineBreakWordOption_Normal;
}
static capi::ICU4XLineSegmenter* sLineSegmenter = nullptr;
static capi::ICU4XLineSegmenter* GetDefaultLineSegmenter() {
static std::once_flag sOnce;
std::call_once(sOnce, [] {
auto result = capi::ICU4XLineSegmenter_create_auto(GetDataProvider());
MOZ_ASSERT(result.is_ok);
sLineSegmenter = result.ok;
if (NS_IsMainThread()) {
mozilla::RunOnShutdown([] {
if (sLineSegmenter) {
capi::ICU4XLineSegmenter_destroy(sLineSegmenter);
}
sLineSegmenter = nullptr;
});
return;
}
NS_DispatchToMainThread(
NS_NewRunnableFunction("GetDefaultLineSegmenter", [] {
mozilla::RunOnShutdown([] {
if (sLineSegmenter) {
capi::ICU4XLineSegmenter_destroy(sLineSegmenter);
}
sLineSegmenter = nullptr;
});
}));
});
return sLineSegmenter;
}
static bool UseDefaultLineSegmenter(WordBreakRule aWordBreak,
LineBreakRule aLevel,
bool aIsChineseOrJapanese) {
return aWordBreak == WordBreakRule::Normal &&
(aLevel == LineBreakRule::Strict || aLevel == LineBreakRule::Auto) &&
!aIsChineseOrJapanese;
}
static capi::ICU4XLineSegmenter* GetLineSegmenter(bool aUseDefault,
WordBreakRule aWordBreak,
LineBreakRule aLevel,
bool aIsChineseOrJapanese) {
if (aUseDefault) {
MOZ_ASSERT(
UseDefaultLineSegmenter(aWordBreak, aLevel, aIsChineseOrJapanese));
return GetDefaultLineSegmenter();
}
capi::ICU4XLineBreakOptionsV1 options;
options.word_option = ConvertWordBreakRuleToICU4X(aWordBreak);
options.strictness = ConvertLineBreakRuleToICU4X(aLevel);
options.ja_zh = aIsChineseOrJapanese;
auto result = capi::ICU4XLineSegmenter_create_lstm_with_options_v1(
GetDataProvider(), options);
MOZ_ASSERT(result.is_ok);
return result.ok;
}
#endif
void LineBreaker::ComputeBreakPositions(
const char16_t* aChars, uint32_t aLength, WordBreakRule aWordBreak,
LineBreakRule aLevel, bool aIsChineseOrJapanese, uint8_t* aBreakBefore) {
#if defined(MOZ_ICU4X) && defined(JS_HAS_INTL_API)
if (StaticPrefs::intl_icu4x_segmenter_enabled()) {
memset(aBreakBefore, 0, aLength);
CheckedInt<int32_t> length = aLength;
if (!length.isValid()) {
return;
}
const bool useDefault =
UseDefaultLineSegmenter(aWordBreak, aLevel, aIsChineseOrJapanese);
capi::ICU4XLineSegmenter* lineSegmenter =
GetLineSegmenter(useDefault, aWordBreak, aLevel, aIsChineseOrJapanese);
ICU4XLineBreakIteratorUtf16 iterator(capi::ICU4XLineSegmenter_segment_utf16(
lineSegmenter, (const uint16_t*)aChars, aLength));
while (true) {
const int32_t nextPos = iterator.next();
if (nextPos < 0 || nextPos >= length.value()) {
break;
}
aBreakBefore[nextPos] = 1;
}
if (!useDefault) {
capi::ICU4XLineSegmenter_destroy(lineSegmenter);
}
return;
}
#endif
uint32_t cur;
int8_t lastClass = CLASS_NONE;
ContextState state(aChars, aLength);
@ -1251,38 +1110,6 @@ void LineBreaker::ComputeBreakPositions(const uint8_t* aChars, uint32_t aLength,
LineBreakRule aLevel,
bool aIsChineseOrJapanese,
uint8_t* aBreakBefore) {
#if defined(MOZ_ICU4X) && defined(JS_HAS_INTL_API)
if (StaticPrefs::intl_icu4x_segmenter_enabled()) {
memset(aBreakBefore, 0, aLength);
CheckedInt<int32_t> length = aLength;
if (!length.isValid()) {
return;
}
const bool useDefault =
UseDefaultLineSegmenter(aWordBreak, aLevel, aIsChineseOrJapanese);
capi::ICU4XLineSegmenter* lineSegmenter =
GetLineSegmenter(useDefault, aWordBreak, aLevel, aIsChineseOrJapanese);
ICU4XLineBreakIteratorLatin1 iterator(
capi::ICU4XLineSegmenter_segment_latin1(
lineSegmenter, (const uint8_t*)aChars, aLength));
while (true) {
const int32_t nextPos = iterator.next();
if (nextPos < 0 || nextPos >= length.value()) {
break;
}
aBreakBefore[nextPos] = 1;
}
if (!useDefault) {
capi::ICU4XLineSegmenter_destroy(lineSegmenter);
}
return;
}
#endif
uint32_t cur;
int8_t lastClass = CLASS_NONE;
ContextState state(aChars, aLength);

View File

@ -11,19 +11,9 @@
#include "mozilla/intl/LineBreaker.h"
#include "mozilla/intl/WordBreaker.h"
#include "mozilla/intl/UnicodeProperties.h"
#include "mozilla/StaticPrefs_intl.h"
#include "nsUnicodeProperties.h"
#include "nsCharTraits.h"
#if defined(MOZ_ICU4X) && defined(JS_HAS_INTL_API)
# include "ICU4XDataProvider.h"
# include "ICU4XGraphemeClusterSegmenter.h"
# include "ICU4XLineSegmenter.h"
# include "ICU4XSentenceSegmenter.h"
# include "ICU4XWordSegmenter.h"
# include "mozilla/intl/ICU4XGeckoDataProvider.h"
#endif
using namespace mozilla::unicode;
namespace mozilla::intl {
@ -40,45 +30,9 @@ Maybe<uint32_t> SegmentIteratorUtf16::Seek(uint32_t aPos) {
LineBreakIteratorUtf16::LineBreakIteratorUtf16(Span<const char16_t> aText,
const LineBreakOptions& aOptions)
: SegmentIteratorUtf16(aText), mOptions(aOptions) {
#if defined(MOZ_ICU4X) && defined(JS_HAS_INTL_API)
if (!StaticPrefs::intl_icu4x_segmenter_enabled()) {
return;
}
auto result =
capi::ICU4XLineSegmenter_create_auto(mozilla::intl::GetDataProvider());
MOZ_RELEASE_ASSERT(result.is_ok);
mSegmenter = result.ok;
mIterator = capi::ICU4XLineSegmenter_segment_utf16(
mSegmenter, (const uint16_t*)mText.Elements(), mText.Length());
#endif
}
LineBreakIteratorUtf16::~LineBreakIteratorUtf16() {
#if defined(MOZ_ICU4X) && defined(JS_HAS_INTL_API)
if (mIterator) {
capi::ICU4XLineBreakIteratorUtf16_destroy(mIterator);
}
if (mSegmenter) {
capi::ICU4XLineSegmenter_destroy(mSegmenter);
}
#endif
}
: SegmentIteratorUtf16(aText), mOptions(aOptions) {}
Maybe<uint32_t> LineBreakIteratorUtf16::Next() {
#if defined(MOZ_ICU4X) && defined(JS_HAS_INTL_API)
if (mIterator) {
const int32_t nextPos = capi::ICU4XLineBreakIteratorUtf16_next(mIterator);
if (nextPos < 0) {
return Nothing();
}
if (!nextPos) {
return Next();
}
mPos = nextPos;
return Some(mPos);
}
#endif
const int32_t nextPos =
LineBreaker::Next(mText.Elements(), mText.Length(), mPos);
if (nextPos == NS_LINEBREAKER_NEED_MORE_TEXT) {
@ -88,71 +42,10 @@ Maybe<uint32_t> LineBreakIteratorUtf16::Next() {
return Some(mPos);
}
Maybe<uint32_t> LineBreakIteratorUtf16::Seek(uint32_t aPos) {
#if defined(MOZ_ICU4X) && defined(JS_HAS_INTL_API)
if (mIterator) {
if (mPos >= aPos) {
return Next();
}
while (mPos < aPos) {
const int32_t nextPos = capi::ICU4XLineBreakIteratorUtf16_next(mIterator);
if (nextPos < 0) {
return Nothing();
}
mPos = static_cast<uint32_t>(nextPos);
}
if (aPos < mPos) {
return Some(mPos);
}
return Next();
}
#endif
return SegmentIteratorUtf16::Seek(aPos);
}
WordBreakIteratorUtf16::WordBreakIteratorUtf16(Span<const char16_t> aText)
: SegmentIteratorUtf16(aText) {
#if defined(MOZ_ICU4X) && defined(JS_HAS_INTL_API)
if (!StaticPrefs::intl_icu4x_segmenter_enabled()) {
return;
}
auto result =
capi::ICU4XWordSegmenter_create_auto(mozilla::intl::GetDataProvider());
MOZ_RELEASE_ASSERT(result.is_ok);
mSegmenter = result.ok;
mIterator = capi::ICU4XWordSegmenter_segment_utf16(
mSegmenter, (const uint16_t*)mText.Elements(), mText.Length());
#endif
}
WordBreakIteratorUtf16::~WordBreakIteratorUtf16() {
#if defined(MOZ_ICU4X) && defined(JS_HAS_INTL_API)
if (mIterator) {
capi::ICU4XWordBreakIteratorUtf16_destroy(mIterator);
}
if (mSegmenter) {
capi::ICU4XWordSegmenter_destroy(mSegmenter);
}
#endif
}
: SegmentIteratorUtf16(aText) {}
Maybe<uint32_t> WordBreakIteratorUtf16::Next() {
#if defined(MOZ_ICU4X) && defined(JS_HAS_INTL_API)
if (mIterator) {
const int32_t nextPos = capi::ICU4XWordBreakIteratorUtf16_next(mIterator);
if (nextPos < 0) {
return Nothing();
}
if (!nextPos) {
return Next();
}
mPos = nextPos;
return Some(mPos);
}
#endif
const int32_t nextPos =
WordBreaker::Next(mText.Elements(), mText.Length(), mPos);
if (nextPos == NS_WORDBREAKER_NEED_MORE_TEXT) {
@ -162,57 +55,9 @@ Maybe<uint32_t> WordBreakIteratorUtf16::Next() {
return Some(mPos);
}
Maybe<uint32_t> WordBreakIteratorUtf16::Seek(uint32_t aPos) {
#if defined(MOZ_ICU4X) && defined(JS_HAS_INTL_API)
if (mIterator) {
if (mPos >= aPos) {
return Next();
}
while (mPos < aPos) {
const int32_t nextPos = capi::ICU4XWordBreakIteratorUtf16_next(mIterator);
if (nextPos < 0) {
return Nothing();
}
mPos = static_cast<uint32_t>(nextPos);
}
if (aPos < mPos) {
return Some(mPos);
}
return Next();
}
#endif
return SegmentIteratorUtf16::Seek(aPos);
}
GraphemeClusterBreakIteratorUtf16::GraphemeClusterBreakIteratorUtf16(
Span<const char16_t> aText)
: SegmentIteratorUtf16(aText) {
#if defined(MOZ_ICU4X) && defined(JS_HAS_INTL_API)
if (!StaticPrefs::intl_icu4x_segmenter_enabled()) {
return;
}
auto result = capi::ICU4XGraphemeClusterSegmenter_create(
mozilla::intl::GetDataProvider());
MOZ_RELEASE_ASSERT(result.is_ok);
mSegmenter = result.ok;
mIterator = capi::ICU4XGraphemeClusterSegmenter_segment_utf16(
mSegmenter, (const uint16_t*)mText.Elements(), mText.Length());
#endif
}
GraphemeClusterBreakIteratorUtf16::~GraphemeClusterBreakIteratorUtf16() {
#if defined(MOZ_ICU4X) && defined(JS_HAS_INTL_API)
if (mIterator) {
capi::ICU4XGraphemeClusterBreakIteratorUtf16_destroy(mIterator);
}
if (mSegmenter) {
capi::ICU4XGraphemeClusterSegmenter_destroy(mSegmenter);
}
#endif
}
: SegmentIteratorUtf16(aText) {}
enum HSType {
HST_NONE = U_HST_NOT_APPLICABLE,
@ -230,20 +75,6 @@ static HSType GetHangulSyllableType(uint32_t aCh) {
Maybe<uint32_t> GraphemeClusterBreakIteratorUtf16::Next() {
const auto len = mText.Length();
#if defined(MOZ_ICU4X) && defined(JS_HAS_INTL_API)
if (mIterator) {
const int32_t nextPos =
capi::ICU4XGraphemeClusterBreakIteratorUtf16_next(mIterator);
if (nextPos < 0) {
return Nothing();
}
if (!nextPos) {
return Next();
}
mPos = nextPos;
return Some(mPos);
}
#endif
if (mPos >= len) {
// The iterator has already reached the end.
return Nothing();
@ -364,32 +195,6 @@ Maybe<uint32_t> GraphemeClusterBreakIteratorUtf16::Next() {
return Some(mPos);
}
Maybe<uint32_t> GraphemeClusterBreakIteratorUtf16::Seek(uint32_t aPos) {
#if defined(MOZ_ICU4X) && defined(JS_HAS_INTL_API)
if (mIterator) {
if (mPos >= aPos) {
return Next();
}
while (mPos < aPos) {
const int32_t nextPos =
capi::ICU4XGraphemeClusterBreakIteratorUtf16_next(mIterator);
if (nextPos < 0) {
return Nothing();
}
mPos = static_cast<uint32_t>(nextPos);
}
if (aPos < mPos) {
return Some(mPos);
}
return Next();
}
#endif
return SegmentIteratorUtf16::Seek(aPos);
}
GraphemeClusterBreakReverseIteratorUtf16::
GraphemeClusterBreakReverseIteratorUtf16(Span<const char16_t> aText)
: SegmentIteratorUtf16(aText) {
@ -426,77 +231,12 @@ Maybe<uint32_t> GraphemeClusterBreakReverseIteratorUtf16::Seek(uint32_t aPos) {
return Next();
}
#if defined(MOZ_ICU4X) && defined(JS_HAS_INTL_API)
SentenceBreakIteratorUtf16::SentenceBreakIteratorUtf16(
Span<const char16_t> aText)
: SegmentIteratorUtf16(aText) {
auto result =
capi::ICU4XSentenceSegmenter_create(mozilla::intl::GetDataProvider());
MOZ_RELEASE_ASSERT(result.is_ok);
mSegmenter = result.ok;
mIterator = capi::ICU4XSentenceSegmenter_segment_utf16(
mSegmenter, (const uint16_t*)mText.Elements(), mText.Length());
}
SentenceBreakIteratorUtf16::~SentenceBreakIteratorUtf16() {
if (mIterator) {
capi::ICU4XSentenceBreakIteratorUtf16_destroy(mIterator);
}
if (mSegmenter) {
capi::ICU4XSentenceSegmenter_destroy(mSegmenter);
}
}
Maybe<uint32_t> SentenceBreakIteratorUtf16::Seek(uint32_t aPos) {
if (!mIterator) {
return Nothing();
}
if (mPos >= aPos) {
return Next();
}
while (mPos < aPos) {
const int32_t nextPos =
capi::ICU4XSentenceBreakIteratorUtf16_next(mIterator);
if (nextPos < 0) {
return Nothing();
}
mPos = static_cast<uint32_t>(nextPos);
}
if (aPos < mPos) {
return Some(mPos);
}
return Next();
}
Maybe<uint32_t> SentenceBreakIteratorUtf16::Next() {
if (!mIterator) {
return Nothing();
}
const int32_t nextPos = capi::ICU4XSentenceBreakIteratorUtf16_next(mIterator);
if (nextPos < 0) {
return Nothing();
}
if (!nextPos) {
return Next();
}
mPos = nextPos;
return Some(mPos);
}
#endif
Result<UniquePtr<Segmenter>, ICUError> Segmenter::TryCreate(
Span<const char> aLocale, const SegmenterOptions& aOptions) {
#if !defined(MOZ_ICU4X) || !defined(JS_HAS_INTL_API)
if (aOptions.mGranularity == SegmenterGranularity::Sentence) {
// Grapheme and Sentence iterator are not yet implemented.
return Err(ICUError::InternalError);
}
#endif
return MakeUnique<Segmenter>(aLocale, aOptions);
}
@ -506,11 +246,6 @@ UniquePtr<SegmentIteratorUtf16> Segmenter::Segment(
case SegmenterGranularity::Grapheme:
return MakeUnique<GraphemeClusterBreakIteratorUtf16>(aText);
case SegmenterGranularity::Sentence:
#if defined(MOZ_ICU4X) && defined(JS_HAS_INTL_API)
if (StaticPrefs::intl_icu4x_segmenter_enabled()) {
return MakeUnique<SentenceBreakIteratorUtf16>(aText);
}
#endif
MOZ_ASSERT_UNREACHABLE("Unimplemented yet!");
return nullptr;
case SegmenterGranularity::Word:

View File

@ -15,19 +15,6 @@
#include "mozilla/Span.h"
#include "mozilla/UniquePtr.h"
#if defined(MOZ_ICU4X) && defined(JS_HAS_INTL_API)
namespace capi {
struct ICU4XLineSegmenter;
struct ICU4XLineBreakIteratorUtf16;
struct ICU4XWordSegmenter;
struct ICU4XWordBreakIteratorUtf16;
struct ICU4XGraphemeClusterSegmenter;
struct ICU4XGraphemeClusterBreakIteratorUtf16;
struct ICU4XSentenceSegmenter;
struct ICU4XSentenceBreakIteratorUtf16;
} // namespace capi
#endif
namespace mozilla::intl {
enum class SegmenterGranularity : uint8_t {
@ -117,18 +104,11 @@ class LineBreakIteratorUtf16 final : public SegmentIteratorUtf16 {
public:
explicit LineBreakIteratorUtf16(Span<const char16_t> aText,
const LineBreakOptions& aOptions = {});
~LineBreakIteratorUtf16() override;
Maybe<uint32_t> Next() override;
Maybe<uint32_t> Seek(uint32_t aPos) override;
private:
LineBreakOptions mOptions;
#ifdef MOZ_ICU4X
capi::ICU4XLineSegmenter* mSegmenter = nullptr;
capi::ICU4XLineBreakIteratorUtf16* mIterator = nullptr;
#endif
};
/**
@ -137,16 +117,8 @@ class LineBreakIteratorUtf16 final : public SegmentIteratorUtf16 {
class WordBreakIteratorUtf16 final : public SegmentIteratorUtf16 {
public:
explicit WordBreakIteratorUtf16(Span<const char16_t> aText);
~WordBreakIteratorUtf16() override;
Maybe<uint32_t> Next() override;
Maybe<uint32_t> Seek(uint32_t aPos) override;
#if defined(MOZ_ICU4X) && defined(JS_HAS_INTL_API)
private:
capi::ICU4XWordSegmenter* mSegmenter = nullptr;
capi::ICU4XWordBreakIteratorUtf16* mIterator = nullptr;
#endif
};
/**
@ -155,16 +127,8 @@ class WordBreakIteratorUtf16 final : public SegmentIteratorUtf16 {
class GraphemeClusterBreakIteratorUtf16 final : public SegmentIteratorUtf16 {
public:
explicit GraphemeClusterBreakIteratorUtf16(Span<const char16_t> aText);
~GraphemeClusterBreakIteratorUtf16() override;
Maybe<uint32_t> Next() override;
Maybe<uint32_t> Seek(uint32_t aPos) override;
#if defined(MOZ_ICU4X) && defined(JS_HAS_INTL_API)
private:
capi::ICU4XGraphemeClusterSegmenter* mSegmenter = nullptr;
capi::ICU4XGraphemeClusterBreakIteratorUtf16* mIterator = nullptr;
#endif
};
/**
@ -182,24 +146,6 @@ class GraphemeClusterBreakReverseIteratorUtf16 final
Maybe<uint32_t> Seek(uint32_t aPos) override;
};
#if defined(MOZ_ICU4X) && defined(JS_HAS_INTL_API)
/**
* Sentence break iterator for UTF-16 text.
*/
class SentenceBreakIteratorUtf16 final : public SegmentIteratorUtf16 {
public:
explicit SentenceBreakIteratorUtf16(Span<const char16_t> aText);
~SentenceBreakIteratorUtf16() override;
Maybe<uint32_t> Next() override;
Maybe<uint32_t> Seek(uint32_t aPos) override;
private:
capi::ICU4XSentenceSegmenter* mSegmenter = nullptr;
capi::ICU4XSentenceBreakIteratorUtf16* mIterator = nullptr;
};
#endif
/**
* This component is a Mozilla-focused API for working with segmenters in
* internationalization code.

View File

@ -10,14 +10,6 @@
#include "nsTArray.h"
#include "nsUnicodeProperties.h"
#if defined(MOZ_ICU4X) && defined(JS_HAS_INTL_API)
# include "ICU4XDataProvider.h"
# include "ICU4XWordBreakIteratorUtf16.hpp"
# include "ICU4XWordSegmenter.hpp"
# include "mozilla/intl/ICU4XGeckoDataProvider.h"
# include "mozilla/StaticPrefs_intl.h"
#endif
using mozilla::intl::Script;
using mozilla::intl::UnicodeProperties;
using mozilla::intl::WordBreaker;
@ -110,33 +102,8 @@ WordRange WordBreaker::FindWord(const char16_t* aText, uint32_t aLen,
return {aLen, aLen};
}
WordRange range{0, aLen};
#if defined(MOZ_ICU4X) && defined(JS_HAS_INTL_API)
if (StaticPrefs::intl_icu4x_segmenter_enabled()) {
auto result =
capi::ICU4XWordSegmenter_create_auto(mozilla::intl::GetDataProvider());
MOZ_ASSERT(result.is_ok);
ICU4XWordSegmenter segmenter(result.ok);
ICU4XWordBreakIteratorUtf16 iterator =
segmenter.segment_utf16(diplomat::span((const uint16_t*)aText, aLen));
uint32_t previousPos = 0;
while (true) {
const int32_t nextPos = iterator.next();
if (nextPos < 0) {
return {previousPos, aLen};
}
if ((uint32_t)nextPos > aPos) {
return {previousPos, (uint32_t)nextPos};
}
previousPos = nextPos;
}
}
#endif
WordBreakClass c = GetClass(aText[aPos]);
WordRange range{0, aLen};
// Scan forward
for (uint32_t i = aPos + 1; i <= aLen; i++) {

View File

@ -7,15 +7,11 @@
#include "gtest/gtest.h"
#include "mozilla/intl/Segmenter.h"
#include "mozilla/Preferences.h"
namespace mozilla::intl {
TEST(IntlSegmenter, TestLineBreakIteratorUtf16SeekOld)
TEST(IntlSegmenter, TestLineBreakIteratorUtf16)
{
nsresult rv = Preferences::SetBool("intl.icu4x.segmenter.enabled", false);
EXPECT_TRUE(rv == NS_OK);
const SegmenterOptions options{SegmenterGranularity::Line};
auto result = Segmenter::TryCreate("en", options);
ASSERT_TRUE(result.isOk());
@ -34,50 +30,7 @@ TEST(IntlSegmenter, TestLineBreakIteratorUtf16SeekOld)
ASSERT_EQ(segIter->Seek(0u), Nothing());
}
TEST(IntlSegmenter, TestLineBreakIteratorUtf16Seek)
{
nsresult rv = Preferences::SetBool("intl.icu4x.segmenter.enabled", true);
EXPECT_TRUE(rv == NS_OK);
const SegmenterOptions options{SegmenterGranularity::Line};
auto result = Segmenter::TryCreate("en", options);
ASSERT_TRUE(result.isOk());
auto lineSegmenter = result.unwrap();
const char16_t text[] = u"hello world";
UniquePtr<SegmentIteratorUtf16> segIter =
lineSegmenter->Segment(MakeStringSpan(text));
// Seek to space between "hello" and "world".
// UAX#14 rule returns before "w".
ASSERT_EQ(segIter->Seek(5u), Some(6u));
ASSERT_EQ(segIter->Next(), Some(11u));
ASSERT_EQ(segIter->Next(), Nothing());
// Same as calling Next().
ASSERT_EQ(segIter->Seek(0u), Nothing());
}
TEST(IntlSegmenter, TestWordBreakIteratorUtf16Simple)
{
const SegmenterOptions options{SegmenterGranularity::Word};
auto result = Segmenter::TryCreate("en", options);
ASSERT_TRUE(result.isOk());
auto wordSegmenter = result.unwrap();
const char16_t text[] = u"hello world";
UniquePtr<SegmentIteratorUtf16> segIter =
wordSegmenter->Segment(MakeStringSpan(text));
ASSERT_EQ(segIter->Next(), Some(5u));
ASSERT_EQ(segIter->Next(), Some(6u));
ASSERT_EQ(segIter->Next(), Some(11u));
ASSERT_EQ(segIter->Next(), Nothing());
}
TEST(IntlSegmenter, TestWordBreakIteratorUtf16Seek)
TEST(IntlSegmenter, TestWordBreakIteratorUtf16)
{
const SegmenterOptions options{SegmenterGranularity::Word};
auto result = Segmenter::TryCreate("en", options);
@ -98,32 +51,7 @@ TEST(IntlSegmenter, TestWordBreakIteratorUtf16Seek)
ASSERT_EQ(segIter->Seek(0u), Nothing());
}
TEST(IntlSegmenter, TestGraphemeClusterBreakIteratorUtf16Simple)
{
SegmenterOptions options{SegmenterGranularity::Grapheme};
auto result = Segmenter::TryCreate("en", options);
ASSERT_TRUE(result.isOk());
auto graphemeClusterSegmenter = result.unwrap();
const char16_t text[] = u"hello world";
UniquePtr<SegmentIteratorUtf16> segIter =
graphemeClusterSegmenter->Segment(MakeStringSpan(text));
ASSERT_EQ(segIter->Next(), Some(1u));
ASSERT_EQ(segIter->Next(), Some(2u));
ASSERT_EQ(segIter->Next(), Some(3u));
ASSERT_EQ(segIter->Next(), Some(4u));
ASSERT_EQ(segIter->Next(), Some(5u));
ASSERT_EQ(segIter->Next(), Some(6u));
ASSERT_EQ(segIter->Next(), Some(7u));
ASSERT_EQ(segIter->Next(), Some(8u));
ASSERT_EQ(segIter->Next(), Some(9u));
ASSERT_EQ(segIter->Next(), Some(10u));
ASSERT_EQ(segIter->Next(), Some(11u));
ASSERT_EQ(segIter->Next(), Nothing());
}
TEST(IntlSegmenter, TestGraphemeClusterBreakIteratorUtf16Seek)
TEST(IntlSegmenter, TestGraphemeClusterBreakIteratorUtf16)
{
SegmenterOptions options{SegmenterGranularity::Grapheme};
auto result = Segmenter::TryCreate("en", options);
@ -169,41 +97,9 @@ TEST(IntlSegmenter, TestGraphemeClusterBreakReverseIteratorUtf16)
TEST(IntlSegmenter, TestSentenceBreakIteratorUtf16)
{
nsresult rv = Preferences::SetBool("intl.icu4x.segmenter.enabled", true);
EXPECT_TRUE(rv == NS_OK);
SegmenterOptions options{SegmenterGranularity::Sentence};
auto result = Segmenter::TryCreate("en", options);
ASSERT_TRUE(result.isOk());
auto sentenceSegmenter = result.unwrap();
const char16_t text[] = u"Hello world. Hello world.";
UniquePtr<SegmentIteratorUtf16> segIter =
sentenceSegmenter->Segment(MakeStringSpan(text));
ASSERT_EQ(segIter->Next(), Some(13u));
ASSERT_EQ(segIter->Next(), Some(25u));
ASSERT_EQ(segIter->Next(), Nothing());
// Same as calling Next().
ASSERT_EQ(segIter->Seek(0u), Nothing());
}
TEST(IntlSegmenter, TestSentenceBreakIteratorUtf16Seek)
{
nsresult rv = Preferences::SetBool("intl.icu4x.segmenter.enabled", true);
EXPECT_TRUE(rv == NS_OK);
SegmenterOptions options{SegmenterGranularity::Sentence};
auto result = Segmenter::TryCreate("en", options);
ASSERT_TRUE(result.isOk());
auto sentenceSegmenter = result.unwrap();
const char16_t text[] = u"Hello world. Hello world.";
UniquePtr<SegmentIteratorUtf16> segIter =
sentenceSegmenter->Segment(MakeStringSpan(text));
ASSERT_EQ(segIter->Seek(5u), Some(13u));
ASSERT_TRUE(result.isErr());
}
} // namespace mozilla::intl

View File

@ -42,16 +42,4 @@ else:
"rulebrk.c",
]
if CONFIG["JS_HAS_INTL_API"] and CONFIG["MOZ_ICU4X"]:
LOCAL_INCLUDES += [
"/third_party/rust/icu_capi/cpp/include",
]
# Disable warnings when including C++ headers of ICU4X.
# - https://github.com/rust-diplomat/diplomat/issues/277
# - https://github.com/rust-diplomat/diplomat/issues/335
CXXFLAGS += [
"-Wno-mismatched-tags",
"-Wno-pessimizing-move",
]
FINAL_LIBRARY = "xul"

View File

@ -6,20 +6,16 @@
set -e
# Update the icu4x binary data for a given release:
# Usage: update-icu4x.sh <URL of ICU GIT> <release tag name> <CLDR version> <ICU release tag name>
# update-icu4x.sh https://github.com/unicode-org/icu4x.git icu@1.2.0 43.0.0 release-73-1
# Usage: update-icu4x.sh <URL of ICU GIT> <release tag name>
# update-icu4x.sh https://github.com/unicode-org/icu4x.git icu@0.3.0
#
# Update to the main branch:
# Usage: update-icu4x.sh <URL of ICU GIT> <branch> <CLDR version> <ICU release tag name>
# update-icu4x.sh https://github.com/unicode-org/icu4x.git main 43.0.0 release-73-1
# default
cldr=${3:-43.0.0}
icuexport=${4:-release-73-1}
# Usage: update-icu4x.sh <URL of ICU GIT> <branch>
# update-icu4x.sh https://github.com/unicode-org/icu4x.git main
if [ $# -lt 2 ]; then
echo "Usage: update-icu4x.sh <URL of ICU4X GIT> <ICU4X release tag name> <CLDR version> <ICU release tag name>"
echo "Example: update-icu4x.sh https://github.com/unicode-org/icu4x.git icu@1.2.0 43.0.0 release-73-1"
echo "Usage: update-icu4x.sh <URL of ICU4X GIT> <release tag name> <CLDR version>"
echo "Example: update-icu4x.sh https://github.com/unicode-org/icu4x.git icu@0.3.0 39.0.0"
exit 1
fi
@ -39,11 +35,12 @@ export LC_ALL=en_US.UTF-8
# Define all of the paths.
original_pwd=$(pwd)
top_src_dir=$(cd -- "$(dirname "$0")/.." >/dev/null 2>&1 ; pwd -P)
data_dir=${top_src_dir}/intl/icu_testdata/data/baked
data_dir=${top_src_dir}/config/external/icu4x
data_file=${data_dir}/icu4x.postcard
git_info_file=${data_dir}/ICU4X-GIT-INFO
log "Remove the old data"
rm -rf ${data_dir}
rm -f ${data_file}
log "Clone ICU4X"
tmpclonedir=$(mktemp -d)
@ -54,31 +51,24 @@ log ${tmpclonedir}
cd ${tmpclonedir}
log "Run the icu4x-datagen tool to regenerate the data."
log "Saving the data into: ${data_dir}"
log "Saving the data to: ${data_file}"
# TODO(Bug 1741262) - Should locales be filtered as well? It doesn't appear that the existing ICU
# data builder is using any locale filtering.
# TODO(Bug 1741264) - Keys are not supported yet: https://github.com/unicode-org/icu4x/issues/192
# --keys <KEYS>...
# Include this resource key in the output. Accepts multiple arguments.
# --key-file <KEY_FILE>
# Path to text file with resource keys to include, one per line. Empty lines and
# lines starting with '#' are ignored.
cargo run --bin icu4x-datagen \
--features=bin \
-- \
--cldr-tag ${cldr} \
--icuexport-tag ${icuexport} \
--keys segmenter/dictionary/w_auto@1 \
--keys segmenter/grapheme@1 \
--keys segmenter/line@1 \
--keys segmenter/lstm/wl_auto@1 \
--keys segmenter/sentence@1 \
--keys segmenter/word@1 \
--all-locales \
--use-separate-crates \
--format mod \
--out ${data_dir} \
cargo run --bin icu4x-datagen -- \
--cldr-tag $3 \
--all-keys \
--all-locales \
--format blob \
--out ${data_file} \
-v \
log "Record the current cloned git information to:"
log ${git_info_file}

View File

@ -48,6 +48,9 @@ if CONFIG["JS_HAS_INTL_API"]:
"icu",
]
if CONFIG["MOZ_ICU4X"]:
USE_LIBS += ["icu4xdata"]
USE_LIBS += [
"nspr",
"zlib",

View File

@ -142,8 +142,6 @@ rsync_filter_list = """
- /intl/icu/source/tools
+ /intl/icu/**
+ /intl/icu_testdata/**
- /intl/components/gtest
+ /intl/components/**
@ -286,9 +284,7 @@ def is_mozjs_cargo_member(line):
def is_mozjs_crates_io_local_patch(line):
"""Checks if the line in patch.crates-io is mozjs-related"""
return any(
f'path = "{p}' in line for p in ("js", "build", "third_party/rust", "intl")
)
return any(f'path = "{p}' in line for p in ("js", "build", "third_party/rust"))
def clean():

View File

@ -14,7 +14,6 @@ moz_memory = ['mozglue-static/moz_memory']
simd-accel = ['jsrust_shared/simd-accel']
smoosh = ['jsrust_shared/smoosh']
gluesmith = ['jsrust_shared/gluesmith']
icu4x = ['jsrust_shared/icu4x']
[dependencies]
mozilla-central-workspace-hack = { version = "0.1", features = ["jsrust"], optional = true }

View File

@ -18,9 +18,6 @@ if CONFIG["JS_ENABLE_SMOOSH"]:
if CONFIG["MOZ_MEMORY"]:
features += ["moz_memory"]
if CONFIG["MOZ_ICU4X"]:
features += ["icu4x"]
RustLibrary("jsrust", features)
if CONFIG["JS_SHARED_LIBRARY"]:

View File

@ -15,11 +15,9 @@ encoding_c_mem = "0.2.4"
smoosh = { path = "../../frontend/smoosh", optional = true }
mozglue-static = { path = "../../../../mozglue/static/rust" }
gluesmith = { path = "../../fuzz-tests/gluesmith", optional = true }
icu_capi = { version = "1.2.2", optional = true, default-features= false, features = ["any_provider", "icu_segmenter", "provider_test"] }
[features]
simd-accel = ['encoding_c/simd-accel']
icu4x = ['icu_capi']
# Uncomment this to enable perf support in release mode.
#[profile.release]

View File

@ -21,6 +21,3 @@ extern crate smoosh;
#[cfg(feature = "gluesmith")]
extern crate gluesmith;
#[cfg(feature = "icu4x")]
extern crate icu_capi;

View File

@ -11,9 +11,6 @@
#include "mozilla/Assertions.h"
#if JS_HAS_INTL_API
# include "mozilla/intl/ICU4CLibrary.h"
# if MOZ_ICU4X
# include "mozilla/intl/ICU4XGeckoDataProvider.h"
# endif
#endif
#include "mozilla/TextUtils.h"
@ -282,10 +279,7 @@ static void ShutdownImpl(JS::detail::FrontendOnly frontendOnly) {
#if JS_HAS_INTL_API
mozilla::intl::ICU4CLibrary::Cleanup();
# if MOZ_ICU4X
mozilla::intl::CleanupDataProvider();
# endif // MOZ_ICU4X
#endif // JS_HAS_INTL_API
#endif // JS_HAS_INTL_API
if (frontendOnly == FrontendOnly::No) {
#ifdef MOZ_VTUNE

View File

@ -36,11 +36,7 @@ var editor = document.getElementById("editor");
function setPrefs(eat_space, stop_at_punctuation, callback) {
eatSpace = eat_space;
stopAtPunctuation = stop_at_punctuation;
SpecialPowers.pushPrefEnv({
"set": [["layout.word_select.eat_space_to_next_word", eat_space],
["layout.word_select.stop_at_punctuation", stop_at_punctuation],
["intl.icu4x.segmenter.enabled", true]]
}, callback);
SpecialPowers.pushPrefEnv({"set": [["layout.word_select.eat_space_to_next_word", eat_space], ["layout.word_select.stop_at_punctuation", stop_at_punctuation]]}, callback);
}
function errString(dir) {
@ -153,11 +149,9 @@ function test1() {
editor.innerHTML = ChineseChars + HiraganaChars + ChineseChars;
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 2);
testRight(editor.firstChild, 5);
testRight(editor.firstChild, 6);
testRight(editor.firstChild, 8);
testLeft(editor.firstChild, 6);
testLeft(editor.firstChild, 5);
testLeft(editor.firstChild, 2);
testLeft(editor.firstChild, 0);
@ -173,27 +167,19 @@ function test1() {
editor.innerHTML = KatakanaChars + HiraganaChars + KatakanaChars;
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 4);
testRight(editor.firstChild, 7);
testRight(editor.firstChild, 8);
testRight(editor.firstChild, 12);
testLeft(editor.firstChild, 8);
testLeft(editor.firstChild, 7);
testLeft(editor.firstChild, 4);
testLeft(editor.firstChild, 0);
editor.innerHTML = HiraganaChars + JapaneseComma + HiraganaChars + JapaneseFullStop + HiraganaChars;
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 3);
testRight(editor.firstChild, 5);
testRight(editor.firstChild, 8);
testRight(editor.firstChild, 10);
testRight(editor.firstChild, 13);
testRight(editor.firstChild, 14);
testLeft(editor.firstChild, 13);
testLeft(editor.firstChild, 10);
testLeft(editor.firstChild, 8);
testLeft(editor.firstChild, 5);
testLeft(editor.firstChild, 3);
testLeft(editor.firstChild, 0);
editor.innerHTML = KatakanaChars + JapaneseComma + KatakanaChars + JapaneseFullStop + KatakanaChars;
@ -241,11 +227,9 @@ function test1() {
// Latin words separated by an emoji symbol
editor.innerHTML = "hello" + Emoji + "world";
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 5);
testRight(editor.firstChild, 7);
// testRight(editor.firstChild, 7);
testRight(editor.firstChild, 12);
testLeft(editor.firstChild, 7);
testLeft(editor.firstChild, 5);
// testLeft(editor.firstChild, 7);
testLeft(editor.firstChild, 0);
// Emoji and Chinese
@ -279,21 +263,21 @@ function test1() {
// with Plane 2 Chinese characters
editor.innerHTML = "hello" + ChineseCharsPlane2 + "world";
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 5);
testRight(editor.firstChild, 9);
// testRight(editor.firstChild, 5);
// testRight(editor.firstChild, 9);
testRight(editor.firstChild, 14);
testLeft(editor.firstChild, 9);
testLeft(editor.firstChild, 5);
// testLeft(editor.firstChild, 9);
// testLeft(editor.firstChild, 5);
testLeft(editor.firstChild, 0);
// Plane 1 Deseret and Plane 2 Chinese characters
editor.innerHTML = DeseretChars + ChineseCharsPlane2 + DeseretChars;
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 4);
testRight(editor.firstChild, 8);
// testRight(editor.firstChild, 4);
// testRight(editor.firstChild, 8);
testRight(editor.firstChild, 12);
testLeft(editor.firstChild, 8);
testLeft(editor.firstChild, 4);
// testLeft(editor.firstChild, 8);
// testLeft(editor.firstChild, 4);
testLeft(editor.firstChild, 0);
// test basic word movement with eat_space_next_to_word true.
@ -363,11 +347,9 @@ function test2() {
editor.innerHTML = ChineseChars + HiraganaChars + ChineseChars;
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 2);
testRight(editor.firstChild, 5);
testRight(editor.firstChild, 6);
testRight(editor.firstChild, 8);
testLeft(editor.firstChild, 6);
testLeft(editor.firstChild, 5);
testLeft(editor.firstChild, 2);
testLeft(editor.firstChild, 0);
@ -383,27 +365,19 @@ function test2() {
editor.innerHTML = KatakanaChars + HiraganaChars + KatakanaChars;
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 4);
testRight(editor.firstChild, 7);
testRight(editor.firstChild, 8);
testRight(editor.firstChild, 12);
testLeft(editor.firstChild, 8);
testLeft(editor.firstChild, 7);
testLeft(editor.firstChild, 4);
testLeft(editor.firstChild, 0);
editor.innerHTML = HiraganaChars + JapaneseComma + HiraganaChars + JapaneseFullStop + HiraganaChars;
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 3);
testRight(editor.firstChild, 5);
testRight(editor.firstChild, 8);
testRight(editor.firstChild, 10);
testRight(editor.firstChild, 13);
testRight(editor.firstChild, 14);
testLeft(editor.firstChild, 13);
testLeft(editor.firstChild, 10);
testLeft(editor.firstChild, 8);
testLeft(editor.firstChild, 5);
testLeft(editor.firstChild, 3);
testLeft(editor.firstChild, 0);
editor.innerHTML = KatakanaChars + JapaneseComma + KatakanaChars + JapaneseFullStop + KatakanaChars;
@ -490,11 +464,9 @@ function test3() {
editor.innerHTML = ChineseChars + HiraganaChars + ChineseChars;
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 2);
testRight(editor.firstChild, 5);
testRight(editor.firstChild, 6);
testRight(editor.firstChild, 8);
testLeft(editor.firstChild, 6);
testLeft(editor.firstChild, 5);
testLeft(editor.firstChild, 2);
testLeft(editor.firstChild, 0);
@ -510,23 +482,15 @@ function test3() {
editor.innerHTML = KatakanaChars + HiraganaChars + KatakanaChars;
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 4);
testRight(editor.firstChild, 7);
testRight(editor.firstChild, 8);
testRight(editor.firstChild, 12);
testLeft(editor.firstChild, 8);
testLeft(editor.firstChild, 7);
testLeft(editor.firstChild, 4);
testLeft(editor.firstChild, 0);
editor.innerHTML = HiraganaChars + JapaneseComma + HiraganaChars + JapaneseFullStop + HiraganaChars;
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 3);
testRight(editor.firstChild, 8);
testRight(editor.firstChild, 13);
testRight(editor.firstChild, 14);
testLeft(editor.firstChild, 13);
testLeft(editor.firstChild, 8);
testLeft(editor.firstChild, 3);
testLeft(editor.firstChild, 0);
editor.innerHTML = KatakanaChars + JapaneseComma + KatakanaChars + JapaneseFullStop + KatakanaChars;
@ -605,11 +569,9 @@ function test4() {
editor.innerHTML = ChineseChars + HiraganaChars + ChineseChars;
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 2);
testRight(editor.firstChild, 5);
testRight(editor.firstChild, 6);
testRight(editor.firstChild, 8);
testLeft(editor.firstChild, 6);
testLeft(editor.firstChild, 5);
testLeft(editor.firstChild, 2);
testLeft(editor.firstChild, 0);
@ -625,23 +587,15 @@ function test4() {
editor.innerHTML = KatakanaChars + HiraganaChars + KatakanaChars;
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 4);
testRight(editor.firstChild, 7);
testRight(editor.firstChild, 8);
testRight(editor.firstChild, 12);
testLeft(editor.firstChild, 8);
testLeft(editor.firstChild, 7);
testLeft(editor.firstChild, 4);
testLeft(editor.firstChild, 0);
editor.innerHTML = HiraganaChars + JapaneseComma + HiraganaChars + JapaneseFullStop + HiraganaChars;
sel.collapse(editor.firstChild, 0);
testRight(editor.firstChild, 3);
testRight(editor.firstChild, 8);
testRight(editor.firstChild, 13);
testRight(editor.firstChild, 14);
testLeft(editor.firstChild, 13);
testLeft(editor.firstChild, 8);
testLeft(editor.firstChild, 3);
testLeft(editor.firstChild, 0);
editor.innerHTML = KatakanaChars + JapaneseComma + KatakanaChars + JapaneseFullStop + KatakanaChars;

View File

@ -200,7 +200,7 @@ fuzzy-if(winWidget,0-1,0-5) == grid-fragmentation-017.html grid-fragmentation-01
== grid-fragmentation-018.html grid-fragmentation-018-ref.html
== grid-fragmentation-019.html grid-fragmentation-019-ref.html
== grid-fragmentation-020.html grid-fragmentation-020-ref.html
pref(intl.icu4x.segmenter.enabled,false) == grid-fragmentation-021.html grid-fragmentation-021-ref.html # https://github.com/unicode-org/icu4x/pull/3548
== grid-fragmentation-021.html grid-fragmentation-021-ref.html
== grid-fragmentation-022.html grid-fragmentation-007-ref.html
== grid-fragmentation-023.html grid-fragmentation-023-ref.html
fuzzy-if(winWidget,0-1,0-5) == grid-fragmentation-024.html grid-fragmentation-024-ref.html
@ -240,11 +240,11 @@ fuzzy-if(winWidget,0-1,0-5) == grid-fragmentation-027.html grid-fragmentation-02
== grid-fragmentation-dyn5-019.html grid-fragmentation-019-ref.html
== grid-fragmentation-dyn1-020.html grid-fragmentation-020-ref.html
== grid-fragmentation-dyn2-020.html grid-fragmentation-020-ref.html
pref(intl.icu4x.segmenter.enabled,false) == grid-fragmentation-dyn1-021.html grid-fragmentation-021-ref.html # https://github.com/unicode-org/icu4x/pull/3548
pref(intl.icu4x.segmenter.enabled,false) == grid-fragmentation-dyn2-021.html grid-fragmentation-021-ref.html # https://github.com/unicode-org/icu4x/pull/3548
pref(intl.icu4x.segmenter.enabled,false) == grid-fragmentation-dyn3-021.html grid-fragmentation-021-ref.html # https://github.com/unicode-org/icu4x/pull/3548
pref(intl.icu4x.segmenter.enabled,false) == grid-fragmentation-dyn4-021.html grid-fragmentation-021-ref.html # https://github.com/unicode-org/icu4x/pull/3548
pref(intl.icu4x.segmenter.enabled,false) == grid-fragmentation-dyn5-021.html grid-fragmentation-021-ref.html # https://github.com/unicode-org/icu4x/pull/3548
== grid-fragmentation-dyn1-021.html grid-fragmentation-021-ref.html
== grid-fragmentation-dyn2-021.html grid-fragmentation-021-ref.html
== grid-fragmentation-dyn3-021.html grid-fragmentation-021-ref.html
== grid-fragmentation-dyn4-021.html grid-fragmentation-021-ref.html
== grid-fragmentation-dyn5-021.html grid-fragmentation-021-ref.html
== grid-fragmentation-dyn2-022.html grid-fragmentation-007-ref.html
== grid-fragmentation-dyn1-023.html grid-fragmentation-023-ref.html
== grid-fragmentation-dyn2-023.html grid-fragmentation-023-ref.html

View File

@ -1,14 +1,14 @@
== between-whitespaces.html between-whitespaces-ref.html
pref(intl.icu4x.segmenter.enabled,false) == chemical-1.html chemical-1-ref.html
pref(intl.icu4x.segmenter.enabled,false) == conservative-range-1.html conservative-range-1-ref.html
pref(intl.icu4x.segmenter.enabled,false) == conservative-range-2.html conservative-range-2-ref.html
pref(intl.icu4x.segmenter.enabled,false) == currency-1.html currency-1-ref.html
== chemical-1.html chemical-1-ref.html
== conservative-range-1.html conservative-range-1-ref.html
== conservative-range-2.html conservative-range-2-ref.html
== currency-1.html currency-1-ref.html
== currency-2.html currency-2-ref.html
pref(intl.icu4x.segmenter.enabled,false) == datetime-1.html datetime-1-ref.html
== datetime-1.html datetime-1-ref.html
pref(gfx.font_rendering.fallback.async,false) == emoji-1.html emoji-1-ref.html
pref(gfx.font_rendering.fallback.async,false) pref(intl.icu4x.segmenter.enabled,false) == emoji-2.html emoji-2-ref.html
pref(intl.icu4x.segmenter.enabled,false) == hyphens-1.html hyphens-1-ref.html
pref(intl.icu4x.segmenter.enabled,false) == hyphens-2.html hyphens-2-ref.html
pref(gfx.font_rendering.fallback.async,false) == emoji-2.html emoji-2-ref.html
== hyphens-1.html hyphens-1-ref.html
== hyphens-2.html hyphens-2-ref.html
# The following three tests may fail if rendering with Core Text (see bug 389074)
# due to subpixel glyph positioning differences between the reference cases with <br>
# and the automatically-wrapped lines in the test file
@ -16,30 +16,30 @@ pref(intl.icu4x.segmenter.enabled,false) == hyphens-2.html hyphens-2-ref.html
== ja-2.html ja-2-ref.html
== ja-3.html ja-3-ref.html
== khmer-1.html khmer-1-ref.html
pref(intl.icu4x.segmenter.enabled,false) == leaders-1.html leaders-1-ref.html
pref(intl.icu4x.segmenter.enabled,false) == markup-src-1.html markup-src-1-ref.html
== leaders-1.html leaders-1-ref.html
== markup-src-1.html markup-src-1-ref.html
== non-breakable-1.html non-breakable-1-ref.html
== non-breakable-2.html non-breakable-2-ref.html
== numerics-1.html numerics-1-ref.html
pref(intl.icu4x.segmenter.enabled,false) == parentheses-1.html parentheses-1-ref.html
== parentheses-1.html parentheses-1-ref.html
== punctuation-open-1.html punctuation-open-1-ref.html
== punctuation-open-2.html punctuation-open-2-ref.html
== punctuation-open-3.html punctuation-open-3-ref.html
== punctuation-open-4.html punctuation-open-4-ref.html
pref(intl.icu4x.segmenter.enabled,false) == quotationmarks-1.html quotationmarks-1-ref.html
== quotationmarks-1.html quotationmarks-1-ref.html
# The following is currently disabled on Linux because of a rendering issue with missing-glyph
# representations on the test boxes. See bug #450088 for discussion.
pref(intl.icu4x.segmenter.enabled,false) skip-if(gtkWidget) == quotationmarks-cjk-1.html quotationmarks-cjk-1-ref.html
pref(intl.icu4x.segmenter.enabled,false) == smileys-1.html smileys-1-ref.html
pref(intl.icu4x.segmenter.enabled,false) == smileys-2.html smileys-2-ref.html
skip-if(gtkWidget) == quotationmarks-cjk-1.html quotationmarks-cjk-1-ref.html
== smileys-1.html smileys-1-ref.html
== smileys-2.html smileys-2-ref.html
== space-cluster-1.html space-cluster-1-ref.html
random-if(cocoaWidget) == space-cluster-2.html space-cluster-2-ref.html # harfbuzz vs coretext, different positioning of stray diacritics
== surrogates-1.html surrogates-1-ref.html
pref(intl.icu4x.segmenter.enabled,false) == surrogates-2.html surrogates-2-ref.html
== surrogates-2.html surrogates-2-ref.html
== surrogates-3.html surrogates-3-ref.html
pref(intl.icu4x.segmenter.enabled,false) == surrogates-4.html surrogates-4-ref.html
pref(intl.icu4x.segmenter.enabled,false) == url-1.html url-1-ref.html
pref(intl.icu4x.segmenter.enabled,false) == url-2.html url-2-ref.html
pref(intl.icu4x.segmenter.enabled,false) == url-3.html url-3-ref.html
pref(intl.icu4x.segmenter.enabled,false) == winpath-1.html winpath-1-ref.html
== surrogates-4.html surrogates-4-ref.html
== url-1.html url-1-ref.html
== url-2.html url-2-ref.html
== url-3.html url-3-ref.html
== winpath-1.html winpath-1-ref.html
== zwnbsp-1.html zwnbsp-1-ref.html

View File

@ -7,7 +7,6 @@
body {
font: 16px/20px monospace;
text-transform: none;
word-break: keep-all;
}
</style>
</head>

View File

@ -7,7 +7,6 @@
body {
font: 16px/20px monospace;
text-transform: lowercase;
word-break: keep-all;
}
</style>
</head>

View File

@ -7,7 +7,6 @@
body {
font: 16px/20px monospace;
text-transform: lowercase;
word-break: keep-all;
}
</style>
</head>

View File

@ -73,7 +73,7 @@ fuzzy-if(Android,0-231,0-653) == subpixel-lineheight-1a.html subpixel-lineheight
== white-space-1b.html white-space-1-ref.html
== white-space-2.html white-space-2-ref.html
== white-space-3.html white-space-3-ref.html
pref(intl.icu4x.segmenter.enabled,false) == wordbreak-1.html wordbreak-1-ref.html
== wordbreak-1.html wordbreak-1-ref.html
== wordbreak-3.html wordbreak-3-ref.html
== wordbreak-4b.html wordbreak-4b-ref.html
== wordbreak-5.html wordbreak-5-ref.html
@ -148,7 +148,7 @@ fails-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == 1320665-cmap-format-13.ht
skip-if(!cocoaWidget) != 1349308-1.html 1349308-notref.html # macOS-specific test for -apple-system glyph metrics
fuzzy-if(Android,0-128,0-233) == 1463020-letter-spacing-text-transform-1.html 1463020-letter-spacing-text-transform-1-ref.html
fails-if(Android) == 1463020-letter-spacing-text-transform-2.html 1463020-letter-spacing-text-transform-2-ref.html # missing font coverage on Android
pref(intl.icu4x.segmenter.enabled,false) == 1507661-spurious-hyphenation-after-explicit.html 1507661-spurious-hyphenation-after-explicit-ref.html
== 1507661-spurious-hyphenation-after-explicit.html 1507661-spurious-hyphenation-after-explicit-ref.html
fuzzy-if(useDrawSnapshot,255-255,50-50) == 1522857-1.html 1522857-1-ref.html # antialiasing fuzz in non-webrender cases
!= 1637405-pua-shaping-1.html 1637405-pua-shaping-1-notref.html
fuzzy-if(useDrawSnapshot,255-255,50-50) == 1655364-1.html 1655364-1-ref.html
@ -334,7 +334,7 @@ pref(layout.css.moz-control-character-visibility.enabled,true) pref(layout.css.c
== letter-spacing-nolig-1.html letter-spacing-nolig-1-ref.html
== letter-spacing-nolig-2.html letter-spacing-nolig-2.html
pref(intl.icu4x.segmenter.enabled,false) == ethiopic-wordspace.html ethiopic-wordspace-ref.html
== ethiopic-wordspace.html ethiopic-wordspace-ref.html
# sub and sup elements should be influenced by their container's line-height - bug 1524897
== sub-sup-and-line-height.html sub-sup-and-line-height-ref.html

View File

@ -7292,12 +7292,6 @@
mirror: always
#endif
# If true, we use UAX14/29 compatible segmenter rules using ICU4X
- name: intl.icu4x.segmenter.enabled
type: RelaxedAtomicBool
value: @IS_NIGHTLY_BUILD@
mirror: always
#---------------------------------------------------------------------------
# Prefs starting with "javascript."
#

View File

@ -546,12 +546,11 @@ option(
set_config("MOZ_UI_LOCALE", depends("--enable-ui-locale")(lambda x: x))
option(
"--disable-icu4x",
help="Disable using ICU4X",
"--enable-icu4x",
help="An experiment to use ICU4X instead of ICU4C. See intl/ICU4X.md",
)
set_config("MOZ_ICU4X", True, when="--enable-icu4x")
set_define("MOZ_ICU4X", True, when="--enable-icu4x")
# clang-plugin location
# ==============================================================

View File

@ -397,14 +397,6 @@ start = "2022-12-16"
end = "2024-06-21"
notes = "Maintained by the Glean and Application Services teams"
[[wildcard-audits.utf8_iter]]
who = "Makoto Kato <m_kato@ga2.so-net.ne.jp>"
criteria = "safe-to-deploy"
user-id = 4484 # Henri Sivonen (hsivonen)
start = "2022-04-19"
end = "2024-06-16"
notes = "Maintained by Henri Sivonen who works at Mozilla."
[[wildcard-audits.webdriver]]
who = "Henrik Skupin <mail@hskupin.info>"
criteria = "safe-to-deploy"
@ -1187,39 +1179,6 @@ who = "Mike Hommey <mh+mozilla@glandium.org>"
criteria = "safe-to-deploy"
delta = "0.10.3 -> 0.10.6"
[[audits.diplomat]]
who = "Makoto Kato <m_kato@ga2.so-net.ne.jp>"
criteria = "safe-to-deploy"
version = "0.5.2"
notes = "This crate is FFI wrapper generator using by ICU4X ffi libraries. This uses unsafe code to convert paramenters, I have reviewed this and generated headers."
[[audits.diplomat]]
who = "Makoto Kato <m_kato@ga2.so-net.ne.jp>"
criteria = "safe-to-deploy"
delta = "0.5.2 -> 0.5.2@git:8d125999893fedfdf30595e97334c21ec4b18da9"
[[audits.diplomat-runtime]]
who = "Makoto Kato <m_kato@ga2.so-net.ne.jp>"
criteria = "safe-to-deploy"
version = "0.5.2"
notes = "This crate is FFI wrapper generator runtime using by ICU4X ffi libraries. This uses unsafe code for memory access of FFI. I have reviewed carefully."
[[audits.diplomat-runtime]]
who = "Makoto Kato <m_kato@ga2.so-net.ne.jp>"
criteria = "safe-to-deploy"
delta = "0.5.2 -> 0.5.2@git:8d125999893fedfdf30595e97334c21ec4b18da9"
[[audits.diplomat_core]]
who = "Makoto Kato <m_kato@ga2.so-net.ne.jp>"
criteria = "safe-to-deploy"
version = "0.5.2"
notes = "This crate contains unsafe code, no network and no file access."
[[audits.diplomat_core]]
who = "Makoto Kato <m_kato@ga2.so-net.ne.jp>"
criteria = "safe-to-deploy"
delta = "0.5.2 -> 0.5.2@git:8d125999893fedfdf30595e97334c21ec4b18da9"
[[audits.displaydoc]]
who = "Makoto Kato <m_kato@ga2.so-net.ne.jp>"
criteria = "safe-to-deploy"
@ -1835,59 +1794,6 @@ who = "Mike Hommey <mh+mozilla@glandium.org>"
criteria = "safe-to-run"
delta = "0.14.23 -> 0.14.24"
[[audits.icu_capi]]
who = "Makoto Kato <m_kato@ga2.so-net.ne.jp>"
criteria = "safe-to-deploy"
version = "1.2.2"
notes = "This crate is C/C++ FFI for ICU4X using diplomat crate. no unsafe and no file access etc on this crate."
[[audits.icu_collections]]
who = "Makoto Kato <m_kato@ga2.so-net.ne.jp>"
criteria = "safe-to-deploy"
version = "1.2.0"
notes = "This crate is used by ICU4X for internal data structure. There is no fileaccess and network access. This uses unsafe block, but we confirm data is valid before."
[[audits.icu_locid]]
who = "Makoto Kato <m_kato@ga2.so-net.ne.jp>"
criteria = "safe-to-deploy"
version = "1.2.0"
notes = "This has unsafe block to handle ascii string in utf-8 string. I've vetted the one instance of unsafe code."
[[audits.icu_provider]]
who = "Makoto Kato <m_kato@ga2.so-net.ne.jp>"
criteria = "safe-to-deploy"
version = "1.2.0"
notes = "Although this has unsafe block, this has a commnet why this is safety and I audited code. Also, this doesn't have file access and network access."
[[audits.icu_provider_adapters]]
who = "Makoto Kato <m_kato@ga2.so-net.ne.jp>"
criteria = "safe-to-deploy"
version = "1.2.0"
notes = "This is one of ICU4X data provider crates that depends on data type. This has no unsafe code and uses no ambient capabilities."
[[audits.icu_provider_macros]]
who = "Makoto Kato <m_kato@ga2.so-net.ne.jp>"
criteria = "safe-to-deploy"
version = "1.2.0"
notes = "This crate is macros for ICU4X's data provider implementer. This has no unsafe code and uses no ambient capabilities."
[[audits.icu_provider_macros]]
who = "Makoto Kato <m_kato@ga2.so-net.ne.jp>"
criteria = "safe-to-deploy"
delta = "1.2.0 -> 1.2.0@git:14e9a3a9857be74582abe2dfa7ab799c5eaac873"
[[audits.icu_segmenter]]
who = "Makoto Kato <m_kato@ga2.so-net.ne.jp>"
criteria = "safe-to-deploy"
version = "1.2.1"
notes = "Original authors are Makoto Kato and Ting-Yu Lin who work at Mozilla. This crate uses unsafe to matrix calculation, but it is safety to check length. And there is no filesystem / network access."
[[audits.icu_testdata]]
who = "Makoto Kato <m_kato@ga2.so-net.ne.jp>"
criteria = "safe-to-deploy"
version = "1.2.0"
notes = "This is just ICU4X data only that is generated by ICU4X datagen. Generated data is in unsafe block to use zero-copy implmentation, but it is safety."
[[audits.idna]]
who = "Bobby Holley <bobbyholley@gmail.com>"
criteria = "safe-to-deploy"
@ -1984,12 +1890,6 @@ who = "Mike Hommey <mh+mozilla@glandium.org>"
criteria = "safe-to-deploy"
delta = "0.7.3 -> 0.7.4"
[[audits.libm]]
who = "Makoto Kato <m_kato@ga2.so-net.ne.jp>"
criteria = "safe-to-deploy"
version = "0.2.6"
notes = "This crate uses unsafe block, but this doesn't have network and file access. I audited code."
[[audits.libsqlite3-sys]]
who = "Ben Dean-Kawamura <bdk@mozilla.com>"
criteria = "safe-to-deploy"
@ -2006,12 +1906,6 @@ who = "Mike Hommey <mh+mozilla@glandium.org>"
criteria = "safe-to-run"
delta = "0.5.4 -> 0.5.6"
[[audits.litemap]]
who = "Makoto Kato <m_kato@ga2.so-net.ne.jp>"
criteria = "safe-to-deploy"
version = "0.7.0"
notes = "This crete has no unsafe code, no file acceess and no network access."
[[audits.lmdb-rkv]]
who = "Bobby Holley <bobbyholley@gmail.com>"
criteria = "safe-to-deploy"
@ -3119,18 +3013,6 @@ who = "Mike Hommey <mh+mozilla@glandium.org>"
criteria = "safe-to-deploy"
delta = "0.4.4 -> 0.4.7"
[[audits.strck]]
who = "Makoto Kato <m_kato@ga2.so-net.ne.jp>"
criteria = "safe-to-deploy"
version = "0.1.2"
notes = "This crate uses unsafe lock to keep invariant. I auditted code. Also, this doesn't have file access and network access."
[[audits.strck_ident]]
who = "Makoto Kato <m_kato@ga2.so-net.ne.jp>"
criteria = "safe-to-deploy"
version = "0.1.2"
notes = "This crate doesn't use unsafe block, network access and filesystem access."
[[audits.subtle]]
who = "Simon Friedberger <simon@mozilla.com>"
criteria = "safe-to-deploy"
@ -3430,11 +3312,6 @@ who = "Mike Hommey <mh+mozilla@glandium.org>"
criteria = "safe-to-deploy"
delta = "0.9.0 -> 0.9.1"
[[audits.unicode-bidi]]
who = "Makoto Kato <m_kato@ga2.so-net.ne.jp>"
criteria = "safe-to-deploy"
delta = "0.3.8 -> 0.3.13"
[[audits.unicode-ident]]
who = "Mike Hommey <mh+mozilla@glandium.org>"
criteria = "safe-to-deploy"
@ -4130,54 +4007,12 @@ criteria = "safe-to-deploy"
version = "0.1.0"
notes = "Written and maintained by Gfx team at Mozilla."
[[audits.writeable]]
who = "Makoto Kato <m_kato@ga2.so-net.ne.jp>"
criteria = "safe-to-deploy"
version = "0.5.2"
notes = "writeable is a variation of fmt::Write with sink version. This uses `unsafe` block to handle potentially-invalid UTF-8 character. I've vetted the one instance of unsafe code."
[[audits.xmldecl]]
who = "Henri Sivonen <hsivonen@hsivonen.fi>"
criteria = "safe-to-deploy"
version = "0.2.0"
notes = "I, Henri Sivonen, wrote this crate myself for Gecko even though it's published on crates.io."
[[audits.yoke]]
who = "Makoto Kato <m_kato@ga2.so-net.ne.jp>"
criteria = "safe-to-deploy"
version = "0.7.1"
notes = "This crate is for zero-copy serialization for ICU4X data structure, and maintained by ICU4X team. Since this uses unsafe block for serialization, I audited code."
[[audits.yoke-derive]]
who = "Makoto Kato <m_kato@ga2.so-net.ne.jp>"
criteria = "safe-to-deploy"
version = "0.7.1@git:14e9a3a9857be74582abe2dfa7ab799c5eaac873"
notes = "This crate is a helper for yoke crate that is ICU4X data structure, and maintained by ICU4X team. Since this uses unsafe block for serialization, all has the comment why this uses unsafe and I audited code."
[[audits.zerofrom]]
who = "Makoto Kato <m_kato@ga2.so-net.ne.jp>"
criteria = "safe-to-deploy"
version = "0.1.2"
notes = "This crate is zero-copy version of \"From\". This has no unsafe code and uses no ambient capabilities."
[[audits.zerofrom-derive]]
who = "Makoto Kato <m_kato@ga2.so-net.ne.jp>"
criteria = "safe-to-deploy"
version = "0.1.2@git:14e9a3a9857be74582abe2dfa7ab799c5eaac873"
notes = "This is custom derives for `ZeroFrom` that is from zerofrom crate. This has no unsafe code and uses no ambient capabilities."
[[audits.zerovec]]
who = "Makoto Kato <m_kato@ga2.so-net.ne.jp>"
criteria = "safe-to-deploy"
version = "0.9.4"
notes = "This crate is zero-copy data structure implmentation. Although this uses unsafe block in several code, it requires for zero-copy. And this has a comment in code why this uses unsafe and I audited code."
[[audits.zerovec-derive]]
who = "Makoto Kato <m_kato@ga2.so-net.ne.jp>"
criteria = "safe-to-deploy"
version = "0.9.4@git:14e9a3a9857be74582abe2dfa7ab799c5eaac873"
notes = "This is custom derives for `ZeroVec` that is from zerovec crate. Although this uses unsafe block for zero-copy, this has a comment in code why this uses unsafe and I audited code."
[[audits.zip]]
who = "Mike Hommey <mh+mozilla@glandium.org>"
criteria = "safe-to-run"

View File

@ -39,18 +39,6 @@ notes = "This is a pinned version of the upstream code, presumably to get a fix
audit-as-crates-io = true
notes = "This is upstream plus a warning fix from bug 1823866."
[policy.diplomat]
audit-as-crates-io = true
notes = "Upstream version not to use syn 1.x"
[policy.diplomat-runtime]
audit-as-crates-io = true
notes = "Upstream version not to use syn 1.x"
[policy.diplomat_core]
audit-as-crates-io = true
notes = "Upstream version not to use syn 1.x"
[policy.firefox-on-glean]
audit-as-crates-io = false
notes = "The crates.io version of this is just a placeholder to allow public crates to depend on firefox-on-glean."
@ -76,14 +64,6 @@ notes = "Used for fuzzing."
criteria = "safe-to-run"
notes = "Used for testing."
[policy.icu_provider_macros]
audit-as-crates-io = true
notes = "Upstream version not to use syn 1.x"
[policy.icu_testdata]
audit-as-crates-io = false
notes = "Customized ICU4X baked data only that Gecko wants"
[policy.l10nregistry]
dependency-criteria = { fluent-testing = "safe-to-run", tokio = "safe-to-run" }
notes = "This crate has two testing-only dependencies which are specified as regular-but-optional rather than a dev-dependencies, because they need to be available to both benchmarks and integration tests."
@ -241,18 +221,6 @@ notes = "Upstream project which we pin."
[policy.wr_malloc_size_of]
audit-as-crates-io = false
[policy.yoke-derive]
audit-as-crates-io = true
notes = "Upstream version not to use syn 1.x"
[policy.zerofrom-derive]
audit-as-crates-io = true
notes = "Upstream version not to use syn 1.x"
[policy.zerovec-derive]
audit-as-crates-io = true
notes = "Upstream version not to use syn 1.x"
[[exemptions.ahash]]
version = "0.7.6"
criteria = "safe-to-deploy"

View File

@ -574,13 +574,6 @@ user-id = 48
user-login = "badboy"
user-name = "Jan-Erik Rediger"
[[publisher.utf8_iter]]
version = "1.0.3"
when = "2022-09-09"
user-id = 4484
user-login = "hsivonen"
user-name = "Henri Sivonen"
[[publisher.walkdir]]
version = "2.3.2"
when = "2021-03-22"

View File

@ -1 +0,0 @@
prefs: [intl.icu4x.segmenter.enabled:true]

View File

@ -2,6 +2,5 @@
expected:
if (os == 'android'): FAIL
if (os == "win"): FAIL
if (os == "linux"): FAIL
fuzzy:
if (os == "mac"): maxDifference=0-1;totalPixels=0-1054

View File

@ -1 +0,0 @@
prefs: [intl.icu4x.segmenter.enabled:true]

View File

@ -0,0 +1,14 @@
[css3-text-line-break-baspglwj-025.html]
expected:
if (os == "android") and fission: [TIMEOUT, OK]
[white-space:pre-wrap]
expected: FAIL
[white-space:pre-line]
expected: FAIL
[white-space:break-spaces]
expected: FAIL
[white-space:normal]
expected: FAIL

View File

@ -0,0 +1,14 @@
[css3-text-line-break-baspglwj-026.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[white-space:pre-wrap]
expected: FAIL
[white-space:pre-line]
expected: FAIL
[white-space:break-spaces]
expected: FAIL
[white-space:normal]
expected: FAIL

View File

@ -0,0 +1,14 @@
[css3-text-line-break-baspglwj-033.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[white-space:pre-wrap]
expected: FAIL
[white-space:pre-line]
expected: FAIL
[white-space:break-spaces]
expected: FAIL
[white-space:normal]
expected: FAIL

View File

@ -0,0 +1,14 @@
[css3-text-line-break-baspglwj-034.html]
expected:
if (os == "android") and fission: [TIMEOUT, OK]
[white-space:pre-wrap]
expected: FAIL
[white-space:pre-line]
expected: FAIL
[white-space:break-spaces]
expected: FAIL
[white-space:normal]
expected: FAIL

View File

@ -0,0 +1,14 @@
[css3-text-line-break-baspglwj-035.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[white-space:pre-wrap]
expected: FAIL
[white-space:pre-line]
expected: FAIL
[white-space:break-spaces]
expected: FAIL
[white-space:normal]
expected: FAIL

View File

@ -0,0 +1,14 @@
[css3-text-line-break-baspglwj-036.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[white-space:pre-wrap]
expected: FAIL
[white-space:pre-line]
expected: FAIL
[white-space:break-spaces]
expected: FAIL
[white-space:normal]
expected: FAIL

View File

@ -0,0 +1,14 @@
[css3-text-line-break-baspglwj-037.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[white-space:pre-wrap]
expected: FAIL
[white-space:pre-line]
expected: FAIL
[white-space:break-spaces]
expected: FAIL
[white-space:normal]
expected: FAIL

View File

@ -0,0 +1,14 @@
[css3-text-line-break-baspglwj-038.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[white-space:pre-wrap]
expected: FAIL
[white-space:pre-line]
expected: FAIL
[white-space:break-spaces]
expected: FAIL
[white-space:normal]
expected: FAIL

View File

@ -0,0 +1,14 @@
[css3-text-line-break-baspglwj-039.html]
expected:
if (os == "android") and fission: [TIMEOUT, OK]
[white-space:pre-wrap]
expected: FAIL
[white-space:pre-line]
expected: FAIL
[white-space:break-spaces]
expected: FAIL
[white-space:normal]
expected: FAIL

View File

@ -0,0 +1,26 @@
[css3-text-line-break-baspglwj-082.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[white-space:pre-wrap]
expected:
if os == "win": PASS
if os == "android": PASS
FAIL
[white-space:pre-line]
expected:
if os == "android": PASS
if os == "win": PASS
FAIL
[white-space:break-spaces]
expected:
if os == "android": PASS
if os == "win": PASS
FAIL
[white-space:normal]
expected:
if os == "win": PASS
if os == "android": PASS
FAIL

View File

@ -0,0 +1,26 @@
[css3-text-line-break-baspglwj-126.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[white-space:pre-wrap]
expected:
if os == "android": PASS
if os == "win": PASS
FAIL
[white-space:pre-line]
expected:
if os == "win": PASS
if os == "android": PASS
FAIL
[white-space:break-spaces]
expected:
if os == "android": PASS
if os == "win": PASS
FAIL
[white-space:normal]
expected:
if os == "android": PASS
if os == "win": PASS
FAIL

View File

@ -0,0 +1,26 @@
[css3-text-line-break-baspglwj-127.html]
expected:
if (os == "android") and fission: [TIMEOUT, OK]
[white-space:pre-wrap]
expected:
if os == "win": PASS
if os == "android": PASS
FAIL
[white-space:pre-line]
expected:
if os == "win": PASS
if os == "android": PASS
FAIL
[white-space:break-spaces]
expected:
if os == "android": PASS
if os == "win": PASS
FAIL
[white-space:normal]
expected:
if os == "android": PASS
if os == "win": PASS
FAIL

View File

@ -0,0 +1,26 @@
[css3-text-line-break-baspglwj-128.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[white-space:pre-wrap]
expected:
if os == "android": PASS
if os == "win": PASS
FAIL
[white-space:pre-line]
expected:
if os == "win": PASS
if os == "android": PASS
FAIL
[white-space:break-spaces]
expected:
if os == "android": PASS
if os == "win": PASS
FAIL
[white-space:normal]
expected:
if os == "android": PASS
if os == "win": PASS
FAIL

View File

@ -0,0 +1,3 @@
[css3-text-line-break-opclns-001.html]
expected:
if (processor == "x86") and not debug: ["PASS", "FAIL"]

View File

@ -0,0 +1,5 @@
[css3-text-line-break-opclns-004.html]
expected:
if os == "win": PASS
if os == "android": PASS
FAIL

View File

@ -0,0 +1,5 @@
[css3-text-line-break-opclns-005.html]
expected:
if os == "win": PASS
if os == "android": PASS
FAIL

View File

@ -0,0 +1,2 @@
[css3-text-line-break-opclns-007.html]
expected: FAIL

View File

@ -0,0 +1,2 @@
[css3-text-line-break-opclns-008.html]
expected: FAIL

View File

@ -0,0 +1,2 @@
[css3-text-line-break-opclns-010.html]
expected: FAIL

View File

@ -0,0 +1,2 @@
[css3-text-line-break-opclns-011.html]
expected: FAIL

View File

@ -0,0 +1,5 @@
[css3-text-line-break-opclns-111.html]
expected:
if os == "win": PASS
if os == "android": PASS
FAIL

View File

@ -0,0 +1,5 @@
[css3-text-line-break-opclns-112.html]
expected:
if os == "win": PASS
if os == "android": PASS
FAIL

View File

@ -0,0 +1,2 @@
[css3-text-line-break-opclns-115.html]
expected: FAIL

View File

@ -0,0 +1,2 @@
[css3-text-line-break-opclns-116.html]
expected: FAIL

View File

@ -0,0 +1,2 @@
[css3-text-line-break-opclns-200.html]
expected: FAIL

View File

@ -0,0 +1,2 @@
[css3-text-line-break-opclns-201.html]
expected: FAIL

View File

@ -0,0 +1,2 @@
[css3-text-line-break-opclns-203.html]
expected: FAIL

View File

@ -0,0 +1,2 @@
[css3-text-line-break-opclns-208.html]
expected: FAIL

View File

@ -0,0 +1,2 @@
[css3-text-line-break-opclns-209.html]
expected: FAIL

View File

@ -0,0 +1,2 @@
[css3-text-line-break-opclns-214.html]
expected: FAIL

View File

@ -1 +0,0 @@
prefs: [intl.icu4x.segmenter.enabled:true]

View File

@ -0,0 +1,5 @@
[css-text-line-break-de-hyphens-loose.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[30A0 KATAKANA-HIRAGANA DOUBLE HYPHEN may NOT appear at line start if de and loose]
expected: FAIL

View File

@ -0,0 +1,5 @@
[css-text-line-break-de-hyphens-normal.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[30A0 KATAKANA-HIRAGANA DOUBLE HYPHEN may NOT appear at line start if de and normal]
expected: FAIL

View File

@ -0,0 +1,5 @@
[css-text-line-break-de-hyphens-strict.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[30A0 KATAKANA-HIRAGANA DOUBLE HYPHEN may NOT appear at line start if de and strict]
expected: FAIL

View File

@ -0,0 +1,20 @@
[css-text-line-break-de-po-loose.html]
expected:
if (os == "android") and fission: [OK, TIMEOUT]
[2035 REVERSED PRIME may NOT appear at line start if de and loose]
expected: FAIL
[2103 DEGREE CELSIUS may NOT appear at line start if de and loose]
expected: FAIL
[2032 PRIME may NOT appear at line start if de and loose]
expected: FAIL
[2030 PER MILLE SIGN may NOT appear at line start if de and loose]
expected: FAIL
[2033 DOUBLE PRIME may NOT appear at line start if de and loose]
expected: FAIL
[2109 DEGREE FAHRENHEIT may NOT appear at line start if de and loose]
expected: FAIL

Some files were not shown because too many files have changed in this diff Show More