diff --git a/chrome/src/nsChromeRegistry.cpp b/chrome/src/nsChromeRegistry.cpp index 1323c08d2808..e142e5423810 100644 --- a/chrome/src/nsChromeRegistry.cpp +++ b/chrome/src/nsChromeRegistry.cpp @@ -187,7 +187,15 @@ nsChromeRegistry::nsProviderArray::GetProvider(const nsACString& aPreferred, Mat if (aPreferred.Equals(entry->provider)) return entry; - if (aType == LOCALE && !found && LanguagesMatch(aPreferred, entry->provider)) + if (aType != LOCALE) + continue; + + if (LanguagesMatch(aPreferred, entry->provider)) { + found = entry; + continue; + } + + if (!found && entry->provider.EqualsLiteral("en-US")) found = entry; } @@ -609,7 +617,7 @@ nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURI, nsIURI* *aResult) baseURI = entry->locales.GetBase(mSelectedLocale, nsProviderArray::LOCALE); } else if (provider.EqualsLiteral("skin")) { - baseURI = entry->skins.GetBase(mSelectedSkin, nsProviderArray::SKIN); + baseURI = entry->skins.GetBase(mSelectedSkin, nsProviderArray::ANY); } else { baseURI = entry->baseURI; diff --git a/chrome/src/nsChromeRegistry.h b/chrome/src/nsChromeRegistry.h index 32772b36257c..cf47ecd9b641 100644 --- a/chrome/src/nsChromeRegistry.h +++ b/chrome/src/nsChromeRegistry.h @@ -144,7 +144,7 @@ public: enum MatchType { EXACT = 0, LOCALE = 1, // "en-GB" is selected, we found "en-US" - SKIN = 2 + ANY = 2 }; ProviderEntry* GetProvider(const nsACString& aPreferred, MatchType aType);