Граф коммитов

1069 Коммитов

Автор SHA1 Сообщение Дата
Nicholas Nethercote d225f7151b Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro.
(Path is actually r=froydnj.)

Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.

MozReview-Commit-ID: 91U22X2NydP

--HG--
rename : xpcom/ds/nsIAtom.h => xpcom/ds/nsAtom.h
extra : rebase_source : ac3e904a21b8b48e74534fff964f1623ee937c67
2017-10-03 09:05:19 +11:00
Wes Kocher 61c098eae7 Merge inbound to m-c a=merge CLOSED TREE
MozReview-Commit-ID: 3pMHYV9oXLm

--HG--
rename : dom/base/nsReferencedElement.cpp => dom/base/IDTracker.cpp
rename : dom/base/nsReferencedElement.h => dom/base/IDTracker.h
2017-09-27 16:51:49 -07:00
Chris Peterson c4dff4f83d Bug 1402666 - Part 3: Replace Replace(NS_LITERAL_STRING("")) with ReplaceLiteral(u""). r=erahm
MozReview-Commit-ID: Ji6UdG32RF4

--HG--
extra : rebase_source : 1565a1e99f40785dad0d0d7652e42222dcdf8881
extra : source : c57e906ba75fda4745134ef8307589e28f4c8d70
2017-09-15 19:32:55 -07:00
Chris Peterson 14c40f3dac Bug 1402666 - Part 1: Replace Replace("") with ReplaceLiteral(""). r=erahm
MozReview-Commit-ID: s2hrTSkBiJ

--HG--
extra : rebase_source : d3b3551ed7ed1d5c8f70fc98d72510a13868ada1
extra : source : 1c45e10702e7884cd536a25b1d39c3de90fd2914
2017-09-15 19:22:58 -07:00
Nicholas Nethercote dfd3b7e7aa Bug 1400459 (part 2) - Devirtualize nsIAtom. r=heycam.
This patch merges nsAtom into nsIAtom. For the moment, both names can be used
interchangeably due to a typedef. The patch also devirtualizes nsIAtom, by
making it not inherit from nsISupports, removing NS_DECL_NSIATOM, and dropping
the use of NS_IMETHOD_. It also removes nsIAtom's IIDs.

These changes trigger knock-on changes throughout the codebase, changing the
types of lots of things as follows.

- nsCOMPtr<nsIAtom> --> RefPtr<nsIAtom>

- nsCOMArray<nsIAtom> --> nsTArray<RefPtr<nsIAtom>>
  - Count() --> Length()
  - ObjectAt() --> ElementAt()
  - AppendObject() --> AppendElement()
  - RemoveObjectAt() --> RemoveElementAt()

- ns*Hashtable<nsISupportsHashKey, ...> -->
  ns*Hashtable<nsRefPtrHashKey<nsIAtom>, ...>

- nsInterfaceHashtable<T, nsIAtom> --> nsRefPtrHashtable<T, nsIAtom>
  - This requires adding a Get() method to nsRefPtrHashtable that it lacks but
    nsInterfaceHashtable has.

- nsCOMPtr<nsIMutableArray> --> nsTArray<RefPtr<nsIAtom>>
  - nsArrayBase::Create() --> nsTArray()
  - GetLength() --> Length()
  - do_QueryElementAt() --> operator[]

The patch also has some changes to Rust code that manipulates nsIAtom.

MozReview-Commit-ID: DykOl8aEnUJ

--HG--
extra : rebase_source : 254404e318e94b4c93ec8d4081ff0f0fda8aa7d1
2017-09-26 08:33:21 +10:00
Chris Peterson 47e9fa9ec2 Bug 870698 - Part 5: Replace Assign(NS_LITERAL_CSTRING("")) with AssignLiteral(""). r=erahm
The NS_LITERAL_CSTRING macro creates a temporary nsLiteralCString to encapsulate the string literal and its length, but AssignLiteral() can determine the string literal's length at compile-time without nsLiteralCString.

MozReview-Commit-ID: KXJM13VRTB7

--HG--
extra : rebase_source : 3e50b1b3f23248d668d15310554559c39ff792f7
extra : source : 74f5e05877d50a79ec1e5330c227d2ce576a2d90
2017-09-06 01:35:56 -07:00
Chris Peterson a0c8081df4 Bug 870698 - Part 4: Replace Equals("") with EqualsLiteral(""). r=erahm
MozReview-Commit-ID: G1GhyvD29WK

--HG--
extra : rebase_source : 115842c37a40041bdca7b4e1ff0a5680b02ced15
extra : source : 90bfff9c01d80086cdc17637f310e898fea295ea
2017-09-06 01:13:45 -07:00
Chris Peterson 9f4c1f5278 Bug 870698 - Part 1: Replace Assign("") with AssignLiteral(""). r=erahm
MozReview-Commit-ID: A0u9PP49OW3

--HG--
extra : rebase_source : 7d5286959f510eb4b7df1b7e32d5b9b58719c48b
extra : intermediate-source : f552b4a78236c42bc09030b3eb008725a3edb9c8
extra : source : 26ac4a1014f6661a70e3bf9f552407e12c2c3981
2017-09-03 22:12:56 -07:00
Jonathan Kew 87bb287cf3 Bug 1391213 - Make localeService.defaultLocale return the locale of the app package rather than a hard-coded en-US value. r=emk 2017-09-23 12:46:28 +01:00
Zibi Braniecki c3a695eb34 Bug 1402234 - Remove the ENABLE_INTL_API=no code from intl/locale. r=jfkthame
MozReview-Commit-ID: IDgkmSb0bmV

--HG--
extra : rebase_source : 186958994646cbd71f6320a8c384c61f620ee784
2017-09-22 08:33:07 +02:00
Mantaroh Yoshinaga 6e075293a5 Bug 1362817 - Drop the DateTimeFormat::FormatTime(). r=m_kato
MozReview-Commit-ID: JuNaLYhWCHI

--HG--
extra : rebase_source : 9bc5379b6ebffdbeb60b24ec57ade115c4f40682
2017-09-19 18:35:51 +09:00
Zibi Braniecki cc30b8a270 Bug 1400006 - Extend language negotiation in LocaleService to support looking for the best likelySubtag for the locale with region stripped. r=Pike
Add additional logic to our language negotation to do apply likelySubtags when a direct match is not available.

Currently, if the user specifies the locale with region, and we do not have a direct for that region, we pick all locales for the same language and other regions in no order.

The example of where it returns suboptimal results:

1) Requested locale "en-CA"
2) Available locales ["en-ZA", "en-GB", "en-US"]
3) Negotiated locales ["en-ZA", "en-GB", "en-US"]

This would not happen, if the user requested a generic "de", "en" etc.:

1) Requested locale "en"
2) Available locales ["en-ZA", "en-GB", "en-US"]
3) Negotiated locales ["en-US", "en-ZA", "en-GB"]

because after not finding a direct match, we would use likelySubtags to extend "en" to "en-Latn-US" and then find the priority match in "en-US".

This patch extends this logic to "en-US" or "de-LU" by adding a step which strips the region tag and then applies likelySubtag on the result.

This means that in absence of direct match the following fallbacks would happen:

"de-LU" -> "de-DE"
"es-CL" -> "es-ES"
"en-CA" -> "en-US"

This does not affect languages that use multiple scripts, so ar, sr and zh are not affected.

MozReview-Commit-ID: BR1WrgXSf6a

--HG--
extra : rebase_source : abc205c4f993680ab0cd0c8b8c016543d5462d01
2017-09-14 15:21:33 -07:00
Sebastian Hengst 261dd76eb6 merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: ACCqbunIDpp
2017-09-09 11:44:38 +02:00
Kris Maglione 93fb7fb9ac Bug 1398357: Part 1 - Fix removal of LocaleService preference observers. r=gandalf
By the time the LocaleService destructor is called, by definition sInstance
has been cleared and its preference observers have been removed, since both
are strong references. In practice, this doesn't seem to cause trouble, but it
does lead to worrying warnings at shutdown in debug builds, which are annoying
red herrings when debugging other issues.

MozReview-Commit-ID: IalOigr2GWN

--HG--
extra : rebase_source : f86a8e81b91c639dedaca85e5bc3b53d54e01645
extra : histedit_source : 643b76de0d29ca4890ac4dd4175259989a63688e
2017-09-08 17:51:43 -07:00
Zibi Braniecki 02a6797952 Bug 1397925 - Refresh OSPreferences mSystemLocales when intl.locale.os changes. r=rnewman
MozReview-Commit-ID: oJdWUXwhZw

--HG--
extra : rebase_source : f66fe06990d4d55d39e9a7924c2d6039aa3c6772
2017-09-07 14:53:36 -07:00
Makoto Kato 2a3c054c7b Bug 1394661 - Use user locale instead of system locale for font fallback. r=gandalf
Until Firefox 54, font fallback uses user locale.  Example, OS is Windows 10 JA with JA UI, Firefox uses JA font for fallback even if Firefox is US version.

But since we changed some locale code on Firefox 55 development cycle, there were some regressions such as bug 1346674.  So we changed fallback locale to system locale (instead of Firefox UX locale) for font selection by bug 1348259.

It isn't good for old compatibility, so we should use user locale for font fallback like Firefox 54.  Now we can get user locale by OSPreferences::GetRegionalPrefsLocales, use it for font fallback


MozReview-Commit-ID: 7qwDDeU1ZPt

--HG--
extra : rebase_source : 3a307dd239bea516e117961a944b714bc43a993c
2017-08-30 17:33:12 +09:00
Emilio Cobos Álvarez ff0fdb1a67 Bug 1394311: Use lowercase consistently for looking up the language group. r=manishearth
This should be the only callee affected, given
gfxPlatformFontList::GetFontPrefLangFor already uses case-insensitive string
comparison.

This makes it also consistent with the rest of the functions in the file, which
lowercase their inputs as well.

MozReview-Commit-ID: 4fNUBdpayHL

--HG--
extra : rebase_source : d669f5da2a1ed06f6348fc6b86eb379b514ddcf3
2017-08-28 09:06:11 +02:00
Makoto Kato dd679562b1 Bug 1391628 - Use fallback locale on nsICollation if locale is invalid. r=emk
Original issue is that Microsoft Dynamics CRM uses invalid lang attribute in <xsl:sort>.

<xsl:sort order="descending"
          select="@displayname[$sortColumnName='displayname'] |
                  @name[$sortColumnName='name'] |
                  exslt:node-set($FriendlyTypeNames)/types/type[@xmlName=current()/@datatype and $sortColumnName='datatype']"
          lang="$languageName"/>

Our XSLT implementation detects "$languageName" as locale name, then use it to nsICollation.

Until Gecko 54 for Windows, even if using invalid locale name for nsICollation, it uses platform locale as fallback.  But from 55, we use same implementation as macOS's to use ICU.  So this issue occurs.  ICU implementation doesn't use fallback locale if it is invalid.

We should use fallback locale if locale is invalid.  Most code for fallback locale such as FallbackEncoding uses application locale, so use it.

MozReview-Commit-ID: EKYkZG7Hnz0

--HG--
extra : rebase_source : fec89c67317d7df041f3b237122fb7e20e32fe1b
2017-08-24 23:13:42 +09:00
Masatoshi Kimura 94ba908683 Bug 1313625 - Remove nsIScriptableDateFormat. r=jfkthame
MozReview-Commit-ID: C9Ek1aQRD2

--HG--
extra : rebase_source : 793cd9be63d652adc00897e071cd5fecde75d293
extra : source : 95baddd007c7c039ebf224c9eea49d50dba212cd
2017-08-03 16:46:55 +09:00
Zibi Braniecki 086f522fa7 Bug 1356263 - Remove nsLocaleService, nsILocaleService and ns*Locale APIs. r=m_kato
MozReview-Commit-ID: D3N2Lztz5cE

--HG--
extra : rebase_source : c524148b047379ac625eb309e2e7e311c77569ef
2017-08-03 02:33:51 -07:00
Nicholas Nethercote 72c884bf74 Bug 1384835 (part 3, attempt 2) - Remove the Preferences::Get*CString() variants that return nsAdoptingCString. r=froydnj.
--HG--
extra : rebase_source : d317b25be2ec21d1a60d25da3689e46cdce0b649
2017-07-31 14:28:48 +10:00
Nicholas Nethercote 581214bd8b Bug 1384835 (part 1, attempt 2) - Use nsA[C]String references instead of pointers for outparams of Get*String() pref functions. r=froydnj.
--HG--
extra : rebase_source : fe566945a55c281d8290634a5b55bed19415c839
2017-07-31 10:52:51 +10:00
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
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
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
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
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
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
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
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 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
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
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
Dan Banner a7f5988aec bug 1351657 - Stop shipping langGroups.properties as it is unused. r=florian
MozReview-Commit-ID: L601YNiOVBc

--HG--
extra : rebase_source : c1bf3647c41d2eee3738175d266ca52f80c14d74
2017-04-20 13:34:52 +01:00
Zibi Braniecki a1a4f0b7c9 Bug 1346616 - Migrate callsites that are retrieving requested locale from pref, to use LocaleService::GetRequestedLocales. r=jfkthame,Pike
I'm adding a helper function mozILocaleService::GetRequestedLocale to simplify
most of the callsites that are looking for the first of the requested locales.

In most cases, I'm just matching the behavior of the code with reusing
LocaleService API instead of direct manipulation on the prefs.
That includes how I handle error case scenarios.

In case of sdk/l10n/locale.js I am reusing LocaleService heuristics over
the custom one from the file since the ones in LocaleService are just
more correct and unified accross the whole platform.

In case of FallbackEncoding I have to turn it into a nsIObserver to listen
to intl:requested-locales-changed.

MozReview-Commit-ID: 7rOr2CovLK

--HG--
extra : rebase_source : 883a91b249b6953b7872bfb9a8851e8be7257c7b
2017-03-11 18:43:11 -08:00
Sebastian Hengst 7b30105d39 Backed out changeset 60d72c2dd49d (bug 1346616) for eslint failure in DirectoryLinksProvider.jsm. r=backout on a CLOSED TREE 2017-04-18 00:48:16 +02:00
Zibi Braniecki cce53c69bc Bug 1346616 - Migrate callsites that are retrieving requested locale from pref, to use LocaleService::GetRequestedLocales. r=jfkthame,Pike
I'm adding a helper function mozILocaleService::GetRequestedLocale to simplify
most of the callsites that are looking for the first of the requested locales.

In most cases, I'm just matching the behavior of the code with reusing
LocaleService API instead of direct manipulation on the prefs.
That includes how I handle error case scenarios.

In case of sdk/l10n/locale.js I am reusing LocaleService heuristics over
the custom one from the file since the ones in LocaleService are just
more correct and unified accross the whole platform.

In case of FallbackEncoding I have to turn it into a nsIObserver to listen
to intl:requested-locales-changed.

MozReview-Commit-ID: 7rOr2CovLK

--HG--
extra : rebase_source : 2f166cf1746f389a035f7cf557edcadeacb10fa0
2017-03-11 18:43:11 -08:00
Zibi Braniecki efe35ec119 Bug 1356718 - Query gtk settings schemas to avoid crashing when schema is missing. r=jfkthame
MozReview-Commit-ID: 2rqO4XpLbfO

--HG--
extra : rebase_source : a6f20cefa04c37bf73574f9065a63e375891bd03
2017-04-16 00:13:07 -07:00
Florian Queze 37ff4fc7cc Bug 1356569 - Remove addObserver's last parameter when it is false, r=jaws. 2017-04-14 21:51:38 +02:00
Sebastian Hengst a07223d699 Backed out changeset 322fde2d53bf (bug 1356569) so bug 1355161 can be backed out. r=backout 2017-04-14 23:39:22 +02:00
Florian Queze 95d4d20c17 Bug 1356569 - Remove addObserver's last parameter when it is false, r=jaws. 2017-04-14 21:51:38 +02:00
Jorg K 1a3b715cfd Bug 1355465 - Enhance TestDateTimeFormat.cpp with non-en-US locale. r=emk
--HG--
extra : rebase_source : 5022b135df56ccea709f1c10be6fd0f54cea9a55
2017-04-11 11:07:00 -04:00