Commit Graph

4142 Commits

Author SHA1 Message Date
Zibi Braniecki
cc3d3ab8cd Bug 1379905 - Switch mozIntl, datetimebox and DateTimeFormat to use GetRegionalPrefsLocales. r=jfkthame,smaug
MozReview-Commit-ID: IqGbT6ZUfuN

--HG--
rename : dom/tests/mochitest/chrome/test_window_getAppLocales.html => dom/tests/mochitest/chrome/test_window_getRegionalPrefsLocales.html
extra : rebase_source : 3180b337ec33bfc8959d0189c8a53ca2c3306e95
2017-07-14 16:47:23 -07:00
Christoph Kerschbaumer
a9630006b9 Bug 1382717 - Convert test test_ncr_fallback.html to comply with new data: URI inheritance model. r=smaug 2017-07-20 18:41:32 +02:00
Zibi Braniecki
64cd7643c9 Bug 1380916 - Introduce OSPreferences::GetRegionalPrefsLocales. r=jfkthame
Introduce a separate API for retrieving locale set from the host environment
used for regional preferences localization.

MozReview-Commit-ID: 3597QstZjS3

--HG--
extra : rebase_source : 2ac30ba2f2c9bd1ed308cfe7be88f6add4f0f5ae
2017-07-13 10:40:40 -07:00
Boris Zbarsky
d51238dc20 Bug 1380549. Remove unnecessary strdup in stringbundle code. r=glandium
We just have one allocator around now.
2017-07-17 23:21:31 -04:00
Nicholas Nethercote
72a757ac00 Bug 1381410 (part 5) - Reorder nsStringBundle. r=emk.
This patch moves the destructor after the constructor, puts the
NS_IMPL_ISUPPORTS line in a more sensible spot, and moves the Get*() functions
before the Format*() functions in order to match the order in
nsIStringBundle.idl.

--HG--
extra : rebase_source : 54250432bd084acd628ab1834bd344687a2f961d
2017-07-17 18:37:32 +10:00
Nicholas Nethercote
5ea6cc2798 Bug 1381410 (part 4) - Add missing monitor enter in nsStringBundle::Format*() functions. r=emk.
GetStringFromName() enters mReentrantMonitor(), and the other Get*() functions
go through GetStringFromName(). But none of the Format*() functions enter the
monitor.

This patch moves some repeated code from GetStringFromName() and
FormatStringFromName() into GetStringFromNameHelper(), including the monitor
entry. All the Get*() and Format*() functions now use
GetStringFromNameHelper(), which means they now all enter the monitor.

--HG--
extra : rebase_source : 5d4c1931fb374d7aa10d6851f5ad8c0c774ffa79
2017-07-17 18:36:16 +10:00
Nicholas Nethercote
cd092e2d5d Bug 1381410 (part 3) - Simplify nsExtensibleStringBundle::GetStringFromID(). r=emk.
Similar to the previous patch, this patch changes GetStringFromID() to call
GetStringFromName(), but this time in nsExtensibleStringBundle.

--HG--
extra : rebase_source : 38b12f5f0010396b2606969fb0c7baef96debe21
2017-07-17 18:34:31 +10:00
Nicholas Nethercote
e33bd03721 Bug 1381410 (part 2) - Remove nsStringBundle::GetStringFromIDHelper(). r=emk.
GetStringFromIDHelper() is very similar to GetSringFromNameHelper(). This patch
removes the former, and changes GetStringFromID() to call GetStringFromName(),
similar to how FormatStringFromID() calls FormatStringFromName().

--HG--
extra : rebase_source : ca1d6abffde106d5409b71c8c181fd604fc974ce
2017-07-17 18:32:57 +10:00
Nicholas Nethercote
59910cce0a Bug 1381410 (part 1) - Rename two protected methods in nsStringBundle. r=emk.
nsStringBundle has two public methods GetStringFrom{ID,Name}() and two
very similar helper methods with the same name. It's easy to get confused
between the two -- indeed, it may be the reason for the data race that this bug
is about -- so this patch renames the helper functions by adding a "Helper"
suffix.

--HG--
extra : rebase_source : 75a15e91c50c4b50b2984377980785b64fcf8852
2017-07-17 18:32:16 +10:00
Christoph Kerschbaumer
1fe2489488 Bug 1380752 - Convert tests within intl/ to comply with new data: URI inheritance model. r=smaug 2017-07-14 12:17:41 +02:00
Nicholas Nethercote
c86dc10505 Bug 1380227 - Avoid many UTF16toUTF8 and UTF8toUTF16 conversions in nsStringBundle. r=emk.
Most of the names passed to nsIStringBundle::{Get,Format}StringFromUTF8Name
have one of the two following forms:

- a 16-bit C string literal, which is then converted to an 8-bit string in
  order for the lookup to occur;

- an 8-bit C string literal converted to a 16-bit string, which is then
  converted back to an 8-bit string in order for the lookup to occur.

This patch introduces and uses alternative methods that can take an 8-bit C
string literal, which requires changing some signatures in other methods and
functions. It replaces all C++ uses of the old methods.

The patch also changes the existing {Get,Format}StringFromName() methods so
they take an AUTF8String argument for the name instead of a wstring, because
that's nicer for JS code.

Even though there is a method for C++ code and a different one for JS code,
|binaryname| is used so that the existing method names can be used for the
common case in both languages.

The change reduces the number of NS_ConvertUTF8toUTF16 and
NS_ConvertUTF16toUTF8 conversions while running Speedometer v2 from ~270,000 to
~160,000. (Most of these conversions involved the string
"deprecatedReferrerDirective" in nsCSPParser.cpp.)

--HG--
extra : rebase_source : 3bee57a501035f76a81230d95186f8c3f460ff8e
2017-07-12 15:13:37 +10:00
Tom Ritter
26b59ebfb5 Bug 1380083 - Pull in upstream ICU patch that changes '\' to '/' in #include. r=andre,m_kato
Upstream: http://bugs.icu-project.org/trac/changeset/40102

MozReview-Commit-ID: 88aECdijOxr

--HG--
extra : rebase_source : 9695367158b37dfebcd35387f9de56e3b7cc91fe
extra : histedit_source : cdeb402b6da62a5e8da595d976ba1a067fa12b25
2017-07-12 12:34:50 -05:00
Zibi Braniecki
46bd8f3dec Bug 1379420 - Introduce LocaleService::GetRegionalPrefsLocales. r=jfkthame
In scenarios where users use OS in one locale set and the App in another,
users should be able to chose which locale set to follow for regional
preferences. This method should be used over getAppLocales for all cases
where the locales are used to format regional preferences related
items like calendars, dates, units etc.

MozReview-Commit-ID: OOBYIZCKXE

--HG--
extra : rebase_source : be1b96728ff85b6c3e96a2a08db737c3e247cbbc
2017-07-08 13:54:04 -07:00
André Bargull
7be99b0beb Bug 1373763: Extend scope for local variable in uprv_convertToPosix. r=dmajor
--HG--
extra : rebase_source : 7664d67626d00c17e7f2d46277a8dd7605b52eb9
2017-06-29 10:22:07 -07:00
Wes Kocher
19d135c982 Merge m-c to autoland, a=merge
MozReview-Commit-ID: 4R4GFHPiij
2017-07-06 16:19:38 -07:00
Sylvestre Ledru
4e9cf83ee8 Bug 1378712 - Remove all trailing whitespaces r=Ehsan
MozReview-Commit-ID: Kdz2xtTF9EG

--HG--
extra : rebase_source : 7235b3802f25bab29a8c6ba40a181a722f3df0ce
2017-07-06 14:00:35 +02:00
Jonathan Kew
ae5077eec2 Bug 1378683 - Fix incorrectly-written retry loop in nsUnicodeNormalizer. r=sylvestre 2017-07-06 11:33:23 +01:00
Jonathan Kew
e0b78e9b57 Bug 1377584 - Update casing (text-transform) test data to Unicode 10.0 repertoire. r=m_kato 2017-07-04 09:19:53 +01:00
Nicholas Nethercote
3e439bb4f8 Bug 1376638 - Minimize uses of prmem.h. r=glandium.
It's silly to use prmem.h within Firefox code given that in our configuration
its functions are just wrappers for malloc() et al. (Indeed, in some places we
mix PR_Malloc() with free(), or malloc() with PR_Free().)

This patch removes all uses, except for the places where we need to use
PR_Free() to free something allocated by another NSPR function; in those cases
I've added a comment explaining which function did the allocation.

--HG--
extra : rebase_source : 0f781bca68b5bf3c4c191e09e277dfc8becffa09
2017-06-30 19:05:41 -07:00
Jonathan Kew
7be1139537 Bug 1376834 - Update data tables to Unicode 10.0 release. r=m_kato 2017-06-30 14:16:02 -07:00
André Bargull
f277dc9e4b Bug 1353650 - Part 4: Update to ICU 59. rs=Waldo
--HG--
extra : rebase_source : bb1dcedef639ae3a9ee76521d8f9212831918ce4
2017-04-19 07:00:05 -07:00
André Bargull
1165535aa2 Bug 1353650 - Part 1: Adjust custom ICU patches for ICU 59 update. r=Waldo
--HG--
extra : rebase_source : 50bc963fb87eda50da851f9d903fb71227de13bd
2017-04-19 06:54:47 -07:00
Masatoshi Kimura
b515c9c804 Bug 1373984 - Turn nsIDocument::mCharacterSet into mozilla::NotNull<const mozilla::Encoding*>. r=hsivonen
MozReview-Commit-ID: GF0YXDwfA14

--HG--
extra : rebase_source : fdae0046f882d47fb539a7f882364e5c5caafdcd
extra : source : 49249788c0dee331ac2989dc39f0505d965a7bd8
2017-06-18 20:37:50 +09:00
Sebastian Hengst
dfc1ad2562 Backed out changeset 7235d05662b0 (bug 1373984) for Android bustage. r=backout on a CLOSED TREE 2017-06-25 18:30:13 +02:00
Masatoshi Kimura
2e04751921 Bug 1373984 - Turn nsIDocument::mCharacterSet into mozilla::NotNull<const mozilla::Encoding*>. r=hsivonen
MozReview-Commit-ID: GF0YXDwfA14

--HG--
extra : rebase_source : a84ab644f52e68676b45f112ff69f868d89f6177
extra : source : 49249788c0dee331ac2989dc39f0505d965a7bd8
2017-06-18 20:37:50 +09:00
Wes Kocher
e02435a31e Backed out changeset 77af189b5c49 (bug 1373984) for build bustage in nsHtml5Parser.cpp a=backout CLOSED TREE
MozReview-Commit-ID: 6kBmU71j2To
2017-06-25 05:10:14 -07:00
Masatoshi Kimura
241039fd97 Bug 1373984 - Turn nsIDocument::mCharacterSet into mozilla::NotNull<const mozilla::Encoding*>. r=hsivonen
MozReview-Commit-ID: GF0YXDwfA14

--HG--
extra : rebase_source : 09da1685795583513bf019d61c58230c2c4d298d
extra : source : 49249788c0dee331ac2989dc39f0505d965a7bd8
2017-06-18 20:37:50 +09:00
Carsten "Tomcat" Book
5f51e5596e merge mozilla-inbound to mozilla-central a=merge 2017-06-23 11:28:19 +02:00
Nicholas Nethercote
f1364a75ea Bug 1374580 (part 3) - Remove ns{,C}Substring typedefs. r=froydnj.
All the instances are converted as follows.

- nsSubstring  --> nsAString
- nsCSubstring --> nsACString

--HG--
extra : rebase_source : cfd2238c52e3cb4d13e3bd5ddb80ba6584ab6d91
2017-06-20 19:19:52 +10:00
Nicholas Nethercote
fe9268c4cd Bug 1374580 (part 2) - Remove nsAFlat{,C}String typedefs. r=froydnj.
All the instances are converted as follows.

- nsAFlatString  --> nsString
- nsAFlatCString --> nsCString

--HG--
extra : rebase_source : b37350642c58a85a08363df2e7c610873faa6e41
2017-06-20 19:19:05 +10:00
Masatoshi Kimura
bdc7c83579 Bug 1374629 - Add mozilla::NotNull to mozilla::Encoding constant declarations. r=froydnj,hsivonen
MozReview-Commit-ID: s1sYrq6tqm

--HG--
extra : rebase_source : 0ffeab4554408fc6e28bd18478121aad73439a30
2017-06-20 22:04:18 +09:00
Chris Peterson
dfd1e13cc5 Bug 1373525 - intl/unicharutil: Move ScopedUNumberFormatTraits class out of unnamed namespace. r=emk
Move the class definition out of an unnamed namespace because it is in a header files included in multiple source files. clang treats the header file's class declaration in an unnamed namespace as distinct in each compilation unit and emits -Wunused-member-function warnings because the member function release() is used in some compilation units but not others.

intl/unicharutil/util/ICUUtils.h:25:17 [-Wunused-member-function] unused member function 'empty'
intl/unicharutil/util/ICUUtils.h:26:17 [-Wunused-member-function] unused member function 'release'

MozReview-Commit-ID: 7AgzzzRgni4

--HG--
extra : source : aeed73b6225ba4834a25de0ec9e23592de25c871
extra : intermediate-source : d0788a9eba9621e04f6be30771acac5707d4a7e1
2017-06-11 14:45:24 -07:00
Masatoshi Kimura
3231cb3535 Bug 1372886 - Remove dead parameters from nsIConverterInputStream.init(). r=hsivonen
MozReview-Commit-ID: GliLHLsUWjt

--HG--
extra : rebase_source : 50d3f4680a498125ddf600b0d64f6740b0229f80
2017-06-17 19:30:09 +09:00
Masatoshi Kimura
838ccc4108 Bug 1369025 - Remove mozilla::dom::EncodingUtils. r=hsivonen
MozReview-Commit-ID: 5O5WtxbmATQ

--HG--
rename : dom/encoding/encodingsgroups.properties => intl/locale/encodingsgroups.properties
extra : rebase_source : 13143b43ee745b618e05ed1b6991d69781c2767d
2017-06-17 11:54:40 +09:00
Henri Sivonen
d35d69cef8 Bug 1261841 part 3 - Remove uconv files. r=emk.
MozReview-Commit-ID: Hf7MGstvwKe
2017-06-13 13:23:52 +03:00
Henri Sivonen
432653453a Bug 1261841 part 2 - Use encoding_rs instead of uconv. r=emk,mystor.
MozReview-Commit-ID: 15Y5GTX98bv
2017-06-13 13:23:23 +03:00
Sylvestre Ledru
739ca8f51f Bug 1366882 - Fix a resource leak - CID 1213977 - r=froydnj
MozReview-Commit-ID: 7Af5BXxaIZl

--HG--
extra : rebase_source : 121c3d2b88d1e44d7a35058c8fe689f602cf6425
2017-05-22 23:00:10 +02:00
Xidorn Quan
eadf9e9411 Bug 1368646 - Expose nsSampleWordBreaker::GetClass as a public static function in nsIWordBreaker. r=emk
MozReview-Commit-ID: VORgEZOVl0

--HG--
extra : source : c202e189f50d3532bfae311f181a40b2bed96149
2017-06-01 17:02:54 +10:00
Xidorn Quan
ac6cc1d36a Bug 1368418 part 3 - Remove nsCategoryImp. r=emk
MozReview-Commit-ID: 5qCoeqfM2s5

--HG--
extra : rebase_source : 6dc1693ce61bea4ec35469a3388c75a9fb64e5b3
2017-05-29 16:17:39 +10:00
Xidorn Quan
143db590ff Bug 1368418 part 2 - Remove nsCaseConversionImp2. r=emk
Code search indicates that it is used neither internally nor in any
addon. It should be safe to remove.

MozReview-Commit-ID: K3dBoydIwGk

--HG--
extra : rebase_source : 984aee342b0006af94eec1cd7fce123bccea4bd7
2017-05-29 16:10:36 +10:00
Xidorn Quan
9dc47921e1 Bug 1368418 part 1 - Remove nsISemanticUnitScanner. r=emk
Code search indicates that this is not used internally, and the only
addon uses this is Breadcrumbs, which hasn't been updated since 2009,
thus it is already not compatible with current Firefox.

MozReview-Commit-ID: 1lUs7ceaaE1

--HG--
extra : rebase_source : 87060c33291ba415c6c70767c132c4a5b74d29fb
2017-05-29 16:05:29 +10:00
Makoto Kato
07093fb065 Bug 1356503 - Part 1. Replace nsWin32Locale::GetXPLocale with LCIDToLocaleName (intl part). r=gandalf
Since our platform support is Windows 7+, we can replace nsWin32Locale::GetXPLocale with LCIDToLocaleName.

LCIDToLocaleName has LOCALE_SYSTEM_DEFAULT and LOCALE_USER_DEFAULT, so we should it simply.

MozReview-Commit-ID: 7JhhXayIK7S

--HG--
extra : rebase_source : d6579e94b8471c73d03c1ac08cdb4b8ab072bed5
2017-04-27 11:23:11 +09:00
Manish Goregaokar
e104a8487b Bug 1367619 - Use RWLock when accessing font prefs service off main thread; r=heycam
MozReview-Commit-ID: Dxdq6Etbwxa

--HG--
extra : rebase_source : ec9f847c7dce6a101db6a3d157395f5b73d87ba1
2017-05-25 15:04:13 -07:00
Jonathan Kew
b1d22b8fd2 Bug 734008 - DeCOMtaminate nsILanguageAtomService, make it a non-refcounted singleton and clean up various call sites. r=m_kato 2015-04-03 21:39:23 +02:00
Manish Goregaokar
bf23cb1d19 Bug 1362599 - Guard against threadsafety issues in lang group stuff. r=heycam 2017-05-20 21:44:37 +02:00
Zibi Braniecki
060e591797 Bug 1358159 - Handle string terminator for GetLocaleInfoEx. r=jfkthame
MozReview-Commit-ID: 4Hu1N4gNobx

--HG--
extra : rebase_source : bc90fc051da8bb7bc024b3be0575c35f537046db
2017-05-10 12:42:26 -07:00
Jonathan Kew
ed530ec201 Bug 1353000 - Preparatory patch, explicitly make the Script enum a 16-bit type, so we can add a field to gfxShapedWord without making it bigger. r=jrmuizel 2017-04-12 14:55:10 +01:00
Jonathan Kew
26f06fc0de Bug 1358275 - Preliminary cleanup: refactor nsTextFragment::UpdateBidiFlag(), moving its logic into nsBidiUtils function HasRTLChars() and making that function more precise in the process. r=dholbert 2017-04-26 23:25:48 +01:00
Zibi Braniecki
7ff88a7209 Bug 1348042 - Refactor LocaleService to operate in server-client mode. r=Ehsan,qdot
LocaleService serves two main functions. It is a central place for all code in the
engine to learn about locales, but it also does the language negotiation and selection.

The former is relevant in all processes, but the latter should only be performed
by the "main" process. In case of current Desktop Firefox, the parent process
is the one performing all the language negotiation, and content processes should
operate in the "client" mode.
In Fennec, there's a Java app on top of Gecko which should work as a "server"
and then all processes, including parent process of Gecko is merely a "client" for that.

This refactor finalizes this duality making it easily configurable to define in
which mode a given LocaleService operates.

The server-client model allows all clients to stay in sync with the server,
but operate transparently for all callers just returning the right values.

In order to initialize LocaleService in the client mode in child process with the
right locales I'm adding the list of app locales to the XPCOMInitData,
and then fire LocaleService::SetAppLocales in the child process initialization.

In order to keep the list up to date, I'm adding intl:app-locales-changed to
the list of observed topics, and when triggered, I send the updated list
to the child process, which updates LocaleService::SetAppLocales with the new
list.

MozReview-Commit-ID: K9X6berF3IO

--HG--
extra : rebase_source : ca5e502d064023fddfd63fe6fe5eccefce8dee52
2017-03-26 07:09:45 +02:00
Wes Kocher
4f3c2d9829 Merge m-c to autoland, a=merge
MozReview-Commit-ID: DPzfAm14Tdx
2017-04-20 15:52:28 -07:00