зеркало из https://github.com/mozilla/gecko-dev.git
Bug 904263 - check pref settings more efficiently. r=dbaron
This commit is contained in:
Родитель
f26020beac
Коммит
7b4b662576
|
@ -568,8 +568,9 @@ Declaration::GetValue(nsCSSProperty aProperty, nsAString& aValue) const
|
|||
|
||||
// if font features are not enabled, pointers for fontVariant
|
||||
// values above may be null since the shorthand check ignores them
|
||||
// font-variant-alternates enabled ==> layout.css.font-features.enabled is true
|
||||
bool fontFeaturesEnabled =
|
||||
mozilla::Preferences::GetBool("layout.css.font-features.enabled");
|
||||
nsCSSProps::IsEnabled(eCSSProperty_font_variant_alternates);
|
||||
|
||||
if (systemFont &&
|
||||
systemFont->GetUnit() != eCSSUnit_None &&
|
||||
|
|
|
@ -8515,8 +8515,9 @@ CSSParserImpl::ParseFont()
|
|||
eCSSProperty_font_weight
|
||||
};
|
||||
|
||||
// font-variant-alternates enabled ==> layout.css.font-features.enabled is true
|
||||
bool featuresEnabled =
|
||||
mozilla::Preferences::GetBool("layout.css.font-features.enabled");
|
||||
nsCSSProps::IsEnabled(eCSSProperty_font_variant_alternates);
|
||||
nsCSSValue family;
|
||||
if (ParseVariant(family, VARIANT_HK, nsCSSProps::kFontKTable)) {
|
||||
if (ExpectEndProperty()) {
|
||||
|
|
|
@ -412,9 +412,12 @@ nsCSSProps::LookupFontDesc(const nsAString& aFontDesc)
|
|||
NS_ABORT_IF_FALSE(gFontDescTable, "no lookup table, needs addref");
|
||||
nsCSSFontDesc which = nsCSSFontDesc(gFontDescTable->Lookup(aFontDesc));
|
||||
|
||||
// font-variant-alternates enabled ==> layout.css.font-features.enabled is true
|
||||
bool fontFeaturesEnabled =
|
||||
nsCSSProps::IsEnabled(eCSSProperty_font_variant_alternates);
|
||||
|
||||
// check for unprefixed font-feature-settings/font-language-override
|
||||
if (which == eCSSFontDesc_UNKNOWN &&
|
||||
mozilla::Preferences::GetBool("layout.css.font-features.enabled")) {
|
||||
if (which == eCSSFontDesc_UNKNOWN && fontFeaturesEnabled) {
|
||||
nsAutoString prefixedProp;
|
||||
prefixedProp.AppendLiteral("-moz-");
|
||||
prefixedProp.Append(aFontDesc);
|
||||
|
|
|
@ -335,7 +335,11 @@ public:
|
|||
|
||||
static bool PrefEnabled()
|
||||
{
|
||||
return mozilla::Preferences::GetBool("layout.css.font-features.enabled");
|
||||
// font-variant-alternates enabled ==> layout.css.font-features.enabled is true
|
||||
bool fontFeaturesEnabled =
|
||||
nsCSSProps::IsEnabled(eCSSProperty_font_variant_alternates);
|
||||
|
||||
return fontFeaturesEnabled;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
|
Загрузка…
Ссылка в новой задаче