mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 975744 - remove font features pref and enable features by default. r=dbaron
This commit is contained in:
parent
73a4c7f5dd
commit
d7cf8f6fad
@ -2501,11 +2501,6 @@ OldBindingConstructorEnabled(const nsGlobalNameStruct *aStruct,
|
||||
}
|
||||
}
|
||||
|
||||
// Don't expose CSSFontFeatureValuesRule unless the pref is enabled
|
||||
if (aStruct->mDOMClassInfoID == eDOMClassInfo_CSSFontFeatureValuesRule_id) {
|
||||
return nsCSSFontFeatureValuesRule::PrefEnabled();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ HTTP(..) == font-features-turkish.html font-features-noliga.html
|
||||
HTTP(..) == font-features-hlig-2.html font-features-hlig.html
|
||||
HTTP(..) == font-features-hlig-4.html font-features-hlig.html
|
||||
HTTP(..) != font-features-hlig-5.html font-features-hlig.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) == font-features-ligatures-none.html font-features-noliga.html
|
||||
HTTP(..) == font-features-ligatures-none.html font-features-noliga.html
|
||||
|
||||
# check that feature in style rule overrides @font-face
|
||||
skip-if(B2G) HTTP(..) == font-features-hlig-3.html font-features-noliga.html # bug 773482
|
||||
@ -53,35 +53,35 @@ HTTP(..) == font-features-order-2.html font-features-noliga.html
|
||||
|
||||
# check priority of feature settings vs. font-variant subproperty
|
||||
HTTP(..) == font-features-order-3.html font-features-noliga.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) == font-features-order-4.html font-features-noliga.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) == font-features-order-5.html font-features-hlig.html
|
||||
HTTP(..) == font-features-order-4.html font-features-noliga.html
|
||||
HTTP(..) == font-features-order-5.html font-features-hlig.html
|
||||
|
||||
# check priority involving feature settings and font-variant-alternates
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) == alternates-order.html alternates-order-ref.html
|
||||
HTTP(..) == alternates-order.html alternates-order-ref.html
|
||||
|
||||
# check that font-specific values line up with @font-face feature settings
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) == annotations.html annotations-ref.html
|
||||
HTTP(..) == annotations.html annotations-ref.html
|
||||
|
||||
# font-variant subproperties
|
||||
# test for specific features being on and others off, based on prop values
|
||||
# (debug problems with font-variant-debug.html which displays all props)
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) == font-variant-alternates.html font-variant-alternates-ref.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) == font-variant-caps.html font-variant-caps-ref.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) == font-variant-east-asian.html font-variant-east-asian-ref.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) == font-variant-ligatures.html font-variant-ligatures-ref.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) == font-variant-numeric.html font-variant-numeric-ref.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) == font-variant-position.html font-variant-position-ref.html
|
||||
HTTP(..) == font-variant-alternates.html font-variant-alternates-ref.html
|
||||
HTTP(..) == font-variant-caps.html font-variant-caps-ref.html
|
||||
HTTP(..) == font-variant-east-asian.html font-variant-east-asian-ref.html
|
||||
HTTP(..) == font-variant-ligatures.html font-variant-ligatures-ref.html
|
||||
HTTP(..) == font-variant-numeric.html font-variant-numeric-ref.html
|
||||
HTTP(..) == font-variant-position.html font-variant-position-ref.html
|
||||
|
||||
# font-kerning
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) != font-kerning-normal.html font-kerning-none.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) != font-kerning-auto.html font-kerning-none.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) == font-kerning-auto.html font-kerning-normal.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) == font-kerning-normal.html font-kerning-kern.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) == font-kerning-none.html font-kerning-nokern.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) == font-kerning-1.html font-kerning-none.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) == font-kerning-2.html font-kerning-normal.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) == font-kerning-3.html font-kerning-none.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) != font-kerning-table-none.html font-kerning-table-normal.html
|
||||
HTTP(..) != font-kerning-normal.html font-kerning-none.html
|
||||
HTTP(..) != font-kerning-auto.html font-kerning-none.html
|
||||
HTTP(..) == font-kerning-auto.html font-kerning-normal.html
|
||||
HTTP(..) == font-kerning-normal.html font-kerning-kern.html
|
||||
HTTP(..) == font-kerning-none.html font-kerning-nokern.html
|
||||
HTTP(..) == font-kerning-1.html font-kerning-none.html
|
||||
HTTP(..) == font-kerning-2.html font-kerning-normal.html
|
||||
HTTP(..) == font-kerning-3.html font-kerning-none.html
|
||||
HTTP(..) != font-kerning-table-none.html font-kerning-table-normal.html
|
||||
|
||||
# sanity check for kerning - with no spaces, kerning should occur
|
||||
HTTP(..) == kerning-sanity-check-kern.html kerning-sanity-check-default.html
|
||||
@ -102,24 +102,24 @@ random-if(!winWidget&&!cocoaWidget) fails-if(winWidget||cocoaWidget) random-if(/
|
||||
|
||||
# font-variant-caps fallback
|
||||
# -- sanity check - none of these should look like the default rendering
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) != caps-fallback-smallcaps1.html caps-fallback-default.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) != caps-fallback-smallcaps2.html caps-fallback-default.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) != caps-fallback-petitecaps.html caps-fallback-default.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) != caps-fallback-allsmallcaps.html caps-fallback-default.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) != caps-fallback-allpetitecaps.html caps-fallback-default.html
|
||||
HTTP(..) != caps-fallback-smallcaps1.html caps-fallback-default.html
|
||||
HTTP(..) != caps-fallback-smallcaps2.html caps-fallback-default.html
|
||||
HTTP(..) != caps-fallback-petitecaps.html caps-fallback-default.html
|
||||
HTTP(..) != caps-fallback-allsmallcaps.html caps-fallback-default.html
|
||||
HTTP(..) != caps-fallback-allpetitecaps.html caps-fallback-default.html
|
||||
# -- normal or fallback rendering
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) == caps-fallback-smallcaps1.html caps-fallback-smcp.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) == caps-fallback-smallcaps2.html caps-fallback-smcp.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) == caps-fallback-petitecaps.html caps-fallback-smcp.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) == caps-fallback-allsmallcaps.html caps-fallback-smcpc2sc.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) == caps-fallback-allpetitecaps.html caps-fallback-smcpc2sc.html
|
||||
HTTP(..) == caps-fallback-smallcaps1.html caps-fallback-smcp.html
|
||||
HTTP(..) == caps-fallback-smallcaps2.html caps-fallback-smcp.html
|
||||
HTTP(..) == caps-fallback-petitecaps.html caps-fallback-smcp.html
|
||||
HTTP(..) == caps-fallback-allsmallcaps.html caps-fallback-smcpc2sc.html
|
||||
HTTP(..) == caps-fallback-allpetitecaps.html caps-fallback-smcpc2sc.html
|
||||
|
||||
# font-variant-position fallback
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) == subsuper-fallback.html subsuper-fallback-ref.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) != subsuper-fallback.html subsuper-fallback-notref1.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) != subsuper-fallback.html subsuper-fallback-notref2.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) != subsuper-fallback.html subsuper-fallback-notref3.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) != subsuper-fallback-omega.html subsuper-fallback-omega-notref.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) == subsuper-nofallback.html subsuper-nofallback-ref1.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) == subsuper-nofallback.html subsuper-nofallback-ref2.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) != subsuper-nofallback.html subsuper-nofallback-notref.html
|
||||
HTTP(..) == subsuper-fallback.html subsuper-fallback-ref.html
|
||||
HTTP(..) != subsuper-fallback.html subsuper-fallback-notref1.html
|
||||
HTTP(..) != subsuper-fallback.html subsuper-fallback-notref2.html
|
||||
HTTP(..) != subsuper-fallback.html subsuper-fallback-notref3.html
|
||||
HTTP(..) != subsuper-fallback-omega.html subsuper-fallback-omega-notref.html
|
||||
HTTP(..) == subsuper-nofallback.html subsuper-nofallback-ref1.html
|
||||
HTTP(..) == subsuper-nofallback.html subsuper-nofallback-ref2.html
|
||||
HTTP(..) != subsuper-nofallback.html subsuper-nofallback-notref.html
|
||||
|
@ -91,5 +91,5 @@ random-if(!(cocoaWidget||winWidget)) == arial-arabic.html arial-arabic-ref.html
|
||||
|
||||
!= syntheticbold-rotated.html syntheticbold-rotated-ref.html
|
||||
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) == font-synthesis-1.html font-synthesis-1-ref.html
|
||||
pref(layout.css.font-features.enabled,true) HTTP(..) == font-synthesis-2.html font-synthesis-2-ref.html
|
||||
HTTP(..) == font-synthesis-1.html font-synthesis-1-ref.html
|
||||
HTTP(..) == font-synthesis-2.html font-synthesis-2-ref.html
|
||||
|
@ -632,12 +632,6 @@ Declaration::GetValue(nsCSSProperty aProperty, nsAString& aValue,
|
||||
const nsCSSValue *fontVariantPosition =
|
||||
data->ValueFor(eCSSProperty_font_variant_position);
|
||||
|
||||
// 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 =
|
||||
nsCSSProps::IsEnabled(eCSSProperty_font_variant_alternates);
|
||||
|
||||
if (systemFont &&
|
||||
systemFont->GetUnit() != eCSSUnit_None &&
|
||||
systemFont->GetUnit() != eCSSUnit_Null) {
|
||||
@ -650,15 +644,14 @@ Declaration::GetValue(nsCSSProperty aProperty, nsAString& aValue,
|
||||
sizeAdjust->GetUnit() != eCSSUnit_System_Font ||
|
||||
featureSettings->GetUnit() != eCSSUnit_System_Font ||
|
||||
languageOverride->GetUnit() != eCSSUnit_System_Font ||
|
||||
(fontFeaturesEnabled &&
|
||||
(fontKerning->GetUnit() != eCSSUnit_System_Font ||
|
||||
fontSynthesis->GetUnit() != eCSSUnit_System_Font ||
|
||||
fontVariantAlternates->GetUnit() != eCSSUnit_System_Font ||
|
||||
fontVariantCaps->GetUnit() != eCSSUnit_System_Font ||
|
||||
fontVariantEastAsian->GetUnit() != eCSSUnit_System_Font ||
|
||||
fontVariantLigatures->GetUnit() != eCSSUnit_System_Font ||
|
||||
fontVariantNumeric->GetUnit() != eCSSUnit_System_Font ||
|
||||
fontVariantPosition->GetUnit() != eCSSUnit_System_Font))) {
|
||||
fontKerning->GetUnit() != eCSSUnit_System_Font ||
|
||||
fontSynthesis->GetUnit() != eCSSUnit_System_Font ||
|
||||
fontVariantAlternates->GetUnit() != eCSSUnit_System_Font ||
|
||||
fontVariantCaps->GetUnit() != eCSSUnit_System_Font ||
|
||||
fontVariantEastAsian->GetUnit() != eCSSUnit_System_Font ||
|
||||
fontVariantLigatures->GetUnit() != eCSSUnit_System_Font ||
|
||||
fontVariantNumeric->GetUnit() != eCSSUnit_System_Font ||
|
||||
fontVariantPosition->GetUnit() != eCSSUnit_System_Font) {
|
||||
// This can't be represented as a shorthand.
|
||||
return;
|
||||
}
|
||||
@ -672,16 +665,15 @@ Declaration::GetValue(nsCSSProperty aProperty, nsAString& aValue,
|
||||
sizeAdjust->GetUnit() != eCSSUnit_None ||
|
||||
featureSettings->GetUnit() != eCSSUnit_Normal ||
|
||||
languageOverride->GetUnit() != eCSSUnit_Normal ||
|
||||
(fontFeaturesEnabled &&
|
||||
(fontKerning->GetIntValue() != NS_FONT_KERNING_AUTO ||
|
||||
fontSynthesis->GetUnit() != eCSSUnit_Enumerated ||
|
||||
fontSynthesis->GetIntValue() !=
|
||||
(NS_FONT_SYNTHESIS_WEIGHT | NS_FONT_SYNTHESIS_STYLE) ||
|
||||
fontVariantAlternates->GetUnit() != eCSSUnit_Normal ||
|
||||
fontVariantEastAsian->GetUnit() != eCSSUnit_Normal ||
|
||||
fontVariantLigatures->GetUnit() != eCSSUnit_Normal ||
|
||||
fontVariantNumeric->GetUnit() != eCSSUnit_Normal ||
|
||||
fontVariantPosition->GetUnit() != eCSSUnit_Normal))) {
|
||||
fontKerning->GetIntValue() != NS_FONT_KERNING_AUTO ||
|
||||
fontSynthesis->GetUnit() != eCSSUnit_Enumerated ||
|
||||
fontSynthesis->GetIntValue() !=
|
||||
(NS_FONT_SYNTHESIS_WEIGHT | NS_FONT_SYNTHESIS_STYLE) ||
|
||||
fontVariantAlternates->GetUnit() != eCSSUnit_Normal ||
|
||||
fontVariantEastAsian->GetUnit() != eCSSUnit_Normal ||
|
||||
fontVariantLigatures->GetUnit() != eCSSUnit_Normal ||
|
||||
fontVariantNumeric->GetUnit() != eCSSUnit_Normal ||
|
||||
fontVariantPosition->GetUnit() != eCSSUnit_Normal) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -9,8 +9,5 @@ CSS_FONT_DESC(font-weight, Weight)
|
||||
CSS_FONT_DESC(font-stretch, Stretch)
|
||||
CSS_FONT_DESC(src, Src)
|
||||
CSS_FONT_DESC(unicode-range, UnicodeRange)
|
||||
|
||||
/* Note: the parsing code explicitly also accepts font-feature-settings
|
||||
and font-language-override. */
|
||||
CSS_FONT_DESC(-moz-font-feature-settings, FontFeatureSettings)
|
||||
CSS_FONT_DESC(-moz-font-language-override, FontLanguageOverride)
|
||||
CSS_FONT_DESC(font-feature-settings, FontFeatureSettings)
|
||||
CSS_FONT_DESC(font-language-override, FontLanguageOverride)
|
||||
|
@ -2755,8 +2755,7 @@ CSSParserImpl::ParseAtRule(RuleAppendFunc aAppendFunc,
|
||||
parseFunc = &CSSParserImpl::ParseFontFaceRule;
|
||||
newSection = eCSSSection_General;
|
||||
|
||||
} else if (mToken.mIdent.LowerCaseEqualsLiteral("font-feature-values") &&
|
||||
nsCSSFontFeatureValuesRule::PrefEnabled()) {
|
||||
} else if (mToken.mIdent.LowerCaseEqualsLiteral("font-feature-values")) {
|
||||
parseFunc = &CSSParserImpl::ParseFontFeatureValuesRule;
|
||||
newSection = eCSSSection_General;
|
||||
|
||||
@ -11736,9 +11735,6 @@ CSSParserImpl::ParseFont()
|
||||
eCSSProperty_font_weight
|
||||
};
|
||||
|
||||
// font-variant-alternates enabled ==> layout.css.font-features.enabled is true
|
||||
bool featuresEnabled =
|
||||
nsCSSProps::IsEnabled(eCSSProperty_font_variant_alternates);
|
||||
nsCSSValue family;
|
||||
if (ParseVariant(family, VARIANT_HK, nsCSSProps::kFontKTable)) {
|
||||
if (eCSSUnit_Inherit == family.GetUnit() ||
|
||||
@ -11754,16 +11750,14 @@ CSSParserImpl::ParseFont()
|
||||
AppendValue(eCSSProperty_font_size_adjust, family);
|
||||
AppendValue(eCSSProperty_font_feature_settings, family);
|
||||
AppendValue(eCSSProperty_font_language_override, family);
|
||||
if (featuresEnabled) {
|
||||
AppendValue(eCSSProperty_font_kerning, family);
|
||||
AppendValue(eCSSProperty_font_synthesis, family);
|
||||
AppendValue(eCSSProperty_font_variant_alternates, family);
|
||||
AppendValue(eCSSProperty_font_variant_caps, family);
|
||||
AppendValue(eCSSProperty_font_variant_east_asian, family);
|
||||
AppendValue(eCSSProperty_font_variant_ligatures, family);
|
||||
AppendValue(eCSSProperty_font_variant_numeric, family);
|
||||
AppendValue(eCSSProperty_font_variant_position, family);
|
||||
}
|
||||
AppendValue(eCSSProperty_font_kerning, family);
|
||||
AppendValue(eCSSProperty_font_synthesis, family);
|
||||
AppendValue(eCSSProperty_font_variant_alternates, family);
|
||||
AppendValue(eCSSProperty_font_variant_caps, family);
|
||||
AppendValue(eCSSProperty_font_variant_east_asian, family);
|
||||
AppendValue(eCSSProperty_font_variant_ligatures, family);
|
||||
AppendValue(eCSSProperty_font_variant_numeric, family);
|
||||
AppendValue(eCSSProperty_font_variant_position, family);
|
||||
}
|
||||
else {
|
||||
AppendValue(eCSSProperty__x_system_font, family);
|
||||
@ -11777,16 +11771,14 @@ CSSParserImpl::ParseFont()
|
||||
AppendValue(eCSSProperty_font_size_adjust, systemFont);
|
||||
AppendValue(eCSSProperty_font_feature_settings, systemFont);
|
||||
AppendValue(eCSSProperty_font_language_override, systemFont);
|
||||
if (featuresEnabled) {
|
||||
AppendValue(eCSSProperty_font_kerning, systemFont);
|
||||
AppendValue(eCSSProperty_font_synthesis, systemFont);
|
||||
AppendValue(eCSSProperty_font_variant_alternates, systemFont);
|
||||
AppendValue(eCSSProperty_font_variant_caps, systemFont);
|
||||
AppendValue(eCSSProperty_font_variant_east_asian, systemFont);
|
||||
AppendValue(eCSSProperty_font_variant_ligatures, systemFont);
|
||||
AppendValue(eCSSProperty_font_variant_numeric, systemFont);
|
||||
AppendValue(eCSSProperty_font_variant_position, systemFont);
|
||||
}
|
||||
AppendValue(eCSSProperty_font_kerning, systemFont);
|
||||
AppendValue(eCSSProperty_font_synthesis, systemFont);
|
||||
AppendValue(eCSSProperty_font_variant_alternates, systemFont);
|
||||
AppendValue(eCSSProperty_font_variant_caps, systemFont);
|
||||
AppendValue(eCSSProperty_font_variant_east_asian, systemFont);
|
||||
AppendValue(eCSSProperty_font_variant_ligatures, systemFont);
|
||||
AppendValue(eCSSProperty_font_variant_numeric, systemFont);
|
||||
AppendValue(eCSSProperty_font_variant_position, systemFont);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -11860,23 +11852,21 @@ CSSParserImpl::ParseFont()
|
||||
AppendValue(eCSSProperty_font_size_adjust, nsCSSValue(eCSSUnit_None));
|
||||
AppendValue(eCSSProperty_font_feature_settings, nsCSSValue(eCSSUnit_Normal));
|
||||
AppendValue(eCSSProperty_font_language_override, nsCSSValue(eCSSUnit_Normal));
|
||||
if (featuresEnabled) {
|
||||
AppendValue(eCSSProperty_font_kerning,
|
||||
nsCSSValue(NS_FONT_KERNING_AUTO, eCSSUnit_Enumerated));
|
||||
AppendValue(eCSSProperty_font_synthesis,
|
||||
nsCSSValue(NS_FONT_SYNTHESIS_WEIGHT | NS_FONT_SYNTHESIS_STYLE,
|
||||
eCSSUnit_Enumerated));
|
||||
AppendValue(eCSSProperty_font_variant_alternates,
|
||||
nsCSSValue(eCSSUnit_Normal));
|
||||
AppendValue(eCSSProperty_font_variant_east_asian,
|
||||
nsCSSValue(eCSSUnit_Normal));
|
||||
AppendValue(eCSSProperty_font_variant_ligatures,
|
||||
nsCSSValue(eCSSUnit_Normal));
|
||||
AppendValue(eCSSProperty_font_variant_numeric,
|
||||
nsCSSValue(eCSSUnit_Normal));
|
||||
AppendValue(eCSSProperty_font_variant_position,
|
||||
nsCSSValue(eCSSUnit_Normal));
|
||||
}
|
||||
AppendValue(eCSSProperty_font_kerning,
|
||||
nsCSSValue(NS_FONT_KERNING_AUTO, eCSSUnit_Enumerated));
|
||||
AppendValue(eCSSProperty_font_synthesis,
|
||||
nsCSSValue(NS_FONT_SYNTHESIS_WEIGHT | NS_FONT_SYNTHESIS_STYLE,
|
||||
eCSSUnit_Enumerated));
|
||||
AppendValue(eCSSProperty_font_variant_alternates,
|
||||
nsCSSValue(eCSSUnit_Normal));
|
||||
AppendValue(eCSSProperty_font_variant_east_asian,
|
||||
nsCSSValue(eCSSUnit_Normal));
|
||||
AppendValue(eCSSProperty_font_variant_ligatures,
|
||||
nsCSSValue(eCSSUnit_Normal));
|
||||
AppendValue(eCSSProperty_font_variant_numeric,
|
||||
nsCSSValue(eCSSUnit_Normal));
|
||||
AppendValue(eCSSProperty_font_variant_position,
|
||||
nsCSSValue(eCSSUnit_Normal));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -119,11 +119,11 @@ CSS_PROP_ALIAS(-moz-box-sizing,
|
||||
box_sizing,
|
||||
MozBoxSizing,
|
||||
"layout.css.prefixes.box-sizing")
|
||||
CSS_PROP_ALIAS(font-feature-settings,
|
||||
CSS_PROP_ALIAS(-moz-font-feature-settings,
|
||||
font_feature_settings,
|
||||
FontFeatureSettings,
|
||||
"layout.css.font-features.enabled")
|
||||
CSS_PROP_ALIAS(font-language-override,
|
||||
MozFontFeatureSettings,
|
||||
"layout.css.prefixes.font-features")
|
||||
CSS_PROP_ALIAS(-moz-font-language-override,
|
||||
font_language_override,
|
||||
FontLanguageOverride,
|
||||
"layout.css.font-features.enabled")
|
||||
MozFontLanguageOverride,
|
||||
"layout.css.prefixes.font-features")
|
||||
|
@ -1775,9 +1775,9 @@ CSS_PROP_FONT(
|
||||
CSS_PROP_NO_OFFSET,
|
||||
eStyleAnimType_None)
|
||||
CSS_PROP_FONT(
|
||||
-moz-font-feature-settings,
|
||||
font-feature-settings,
|
||||
font_feature_settings,
|
||||
CSS_PROP_DOMPROP_PREFIXED(FontFeatureSettings),
|
||||
FontFeatureSettings,
|
||||
CSS_PROPERTY_PARSE_VALUE |
|
||||
CSS_PROPERTY_VALUE_PARSER_FUNCTION |
|
||||
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
|
||||
@ -1794,15 +1794,15 @@ CSS_PROP_FONT(
|
||||
CSS_PROPERTY_PARSE_VALUE |
|
||||
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
|
||||
CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
|
||||
"layout.css.font-features.enabled",
|
||||
"",
|
||||
VARIANT_HK,
|
||||
kFontKerningKTable,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
eStyleAnimType_None)
|
||||
CSS_PROP_FONT(
|
||||
-moz-font-language-override,
|
||||
font-language-override,
|
||||
font_language_override,
|
||||
CSS_PROP_DOMPROP_PREFIXED(FontLanguageOverride),
|
||||
FontLanguageOverride,
|
||||
CSS_PROPERTY_PARSE_VALUE |
|
||||
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
|
||||
CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
|
||||
@ -1884,7 +1884,7 @@ CSS_PROP_FONT(
|
||||
CSS_PROPERTY_VALUE_PARSER_FUNCTION |
|
||||
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
|
||||
CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
|
||||
"layout.css.font-features.enabled",
|
||||
"",
|
||||
0,
|
||||
kFontSynthesisKTable,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
@ -1903,7 +1903,7 @@ CSS_PROP_FONT(
|
||||
CSS_PROPERTY_VALUE_PARSER_FUNCTION |
|
||||
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
|
||||
CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
|
||||
"layout.css.font-features.enabled",
|
||||
"",
|
||||
0,
|
||||
kFontVariantAlternatesKTable,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
@ -1915,7 +1915,7 @@ CSS_PROP_FONT(
|
||||
CSS_PROPERTY_PARSE_VALUE |
|
||||
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
|
||||
CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
|
||||
"layout.css.font-features.enabled",
|
||||
"",
|
||||
VARIANT_HMK,
|
||||
kFontVariantCapsKTable,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
@ -1928,7 +1928,7 @@ CSS_PROP_FONT(
|
||||
CSS_PROPERTY_VALUE_PARSER_FUNCTION |
|
||||
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
|
||||
CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
|
||||
"layout.css.font-features.enabled",
|
||||
"",
|
||||
0,
|
||||
kFontVariantEastAsianKTable,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
@ -1941,7 +1941,7 @@ CSS_PROP_FONT(
|
||||
CSS_PROPERTY_VALUE_PARSER_FUNCTION |
|
||||
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
|
||||
CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
|
||||
"layout.css.font-features.enabled",
|
||||
"",
|
||||
0,
|
||||
kFontVariantLigaturesKTable,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
@ -1954,7 +1954,7 @@ CSS_PROP_FONT(
|
||||
CSS_PROPERTY_VALUE_PARSER_FUNCTION |
|
||||
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
|
||||
CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
|
||||
"layout.css.font-features.enabled",
|
||||
"",
|
||||
0,
|
||||
kFontVariantNumericKTable,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
@ -1966,7 +1966,7 @@ CSS_PROP_FONT(
|
||||
CSS_PROPERTY_PARSE_VALUE |
|
||||
CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
|
||||
CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
|
||||
"layout.css.font-features.enabled",
|
||||
"",
|
||||
VARIANT_HMK,
|
||||
kFontVariantPositionKTable,
|
||||
CSS_PROP_NO_OFFSET,
|
||||
|
@ -476,12 +476,8 @@ 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 && fontFeaturesEnabled) {
|
||||
if (which == eCSSFontDesc_UNKNOWN) {
|
||||
nsAutoString prefixedProp;
|
||||
prefixedProp.AppendLiteral("-moz-");
|
||||
prefixedProp.Append(aFontDesc);
|
||||
|
@ -338,15 +338,6 @@ public:
|
||||
|
||||
virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE;
|
||||
|
||||
static bool PrefEnabled()
|
||||
{
|
||||
// font-variant-alternates enabled ==> layout.css.font-features.enabled is true
|
||||
bool fontFeaturesEnabled =
|
||||
nsCSSProps::IsEnabled(eCSSProperty_font_variant_alternates);
|
||||
|
||||
return fontFeaturesEnabled;
|
||||
}
|
||||
|
||||
protected:
|
||||
~nsCSSFontFeatureValuesRule() {}
|
||||
|
||||
|
@ -117,7 +117,9 @@ COMPUTED_STYLE_PROP(flex_wrap, FlexWrap)
|
||||
COMPUTED_STYLE_PROP(float, Float)
|
||||
//// COMPUTED_STYLE_PROP(font, Font)
|
||||
COMPUTED_STYLE_PROP(font_family, FontFamily)
|
||||
COMPUTED_STYLE_PROP(font_feature_settings, FontFeatureSettings)
|
||||
COMPUTED_STYLE_PROP(font_kerning, FontKerning)
|
||||
COMPUTED_STYLE_PROP(font_language_override, FontLanguageOverride)
|
||||
COMPUTED_STYLE_PROP(font_size, FontSize)
|
||||
COMPUTED_STYLE_PROP(font_size_adjust, FontSizeAdjust)
|
||||
COMPUTED_STYLE_PROP(font_stretch, FontStretch)
|
||||
@ -250,8 +252,6 @@ COMPUTED_STYLE_PROP(_moz_column_rule_style, ColumnRuleStyle)
|
||||
COMPUTED_STYLE_PROP(_moz_column_rule_width, ColumnRuleWidth)
|
||||
COMPUTED_STYLE_PROP(_moz_column_width, ColumnWidth)
|
||||
COMPUTED_STYLE_PROP(float_edge, FloatEdge)
|
||||
COMPUTED_STYLE_PROP(font_feature_settings, FontFeatureSettings)
|
||||
COMPUTED_STYLE_PROP(font_language_override, FontLanguageOverride)
|
||||
COMPUTED_STYLE_PROP(force_broken_image_icon, ForceBrokenImageIcon)
|
||||
COMPUTED_STYLE_PROP(hyphens, Hyphens)
|
||||
COMPUTED_STYLE_PROP(image_region, ImageRegion)
|
||||
|
@ -2429,7 +2429,10 @@ var gCSSProperties = {
|
||||
domProp: "font",
|
||||
inherited: true,
|
||||
type: CSS_TYPE_TRUE_SHORTHAND,
|
||||
subproperties: [ "font-style", "font-variant", "font-weight", "font-size", "line-height", "font-family", "font-stretch", "font-size-adjust", "-moz-font-feature-settings", "-moz-font-language-override" ],
|
||||
subproperties: [ "font-style", "font-variant", "font-weight", "font-size", "line-height", "font-family", "font-stretch",
|
||||
"font-size-adjust", "font-feature-settings", "font-language-override",
|
||||
"font-kerning", "font-synthesis", "font-variant-alternates", "font-variant-caps", "font-variant-east-asian",
|
||||
"font-variant-ligatures", "font-variant-numeric", "font-variant-position" ],
|
||||
initial_values: [ (gInitialFontFamilyIsSansSerif ? "medium sans-serif" : "medium serif") ],
|
||||
other_values: [ "large serif", "9px fantasy", "bold italic small-caps 24px/1.4 Times New Roman, serif", "small inherit roman", "small roman inherit",
|
||||
// system fonts
|
||||
@ -2447,8 +2450,8 @@ var gCSSProperties = {
|
||||
other_values: [ (gInitialFontFamilyIsSansSerif ? "serif" : "sans-serif"), "Times New Roman, serif", "'Times New Roman', serif", "cursive", "fantasy", "\\\"Times New Roman", "\"Times New Roman\"", "Times, \\\"Times New Roman", "Times, \"Times New Roman\"", "-no-such-font-installed", "inherit roman", "roman inherit", "Times, inherit roman", "inherit roman, Times", "roman inherit, Times", "Times, roman inherit" ],
|
||||
invalid_values: [ "\"Times New\" Roman", "\"Times New Roman\n", "Times, \"Times New Roman\n" ]
|
||||
},
|
||||
"-moz-font-feature-settings": {
|
||||
domProp: "MozFontFeatureSettings",
|
||||
"font-feature-settings": {
|
||||
domProp: "fontFeatureSettings",
|
||||
inherited: true,
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "normal" ],
|
||||
@ -2466,8 +2469,16 @@ var gCSSProperties = {
|
||||
'"liga" 1 off', '"liga" on off', '"liga" , 0 "smcp"', '"liga" "smcp"'
|
||||
]
|
||||
},
|
||||
"-moz-font-language-override": {
|
||||
domProp: "MozFontLanguageOverride",
|
||||
"font-kerning": {
|
||||
domProp: "fontKerning",
|
||||
inherited: true,
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "auto" ],
|
||||
other_values: [ "normal", "none" ],
|
||||
invalid_values: [ "on" ]
|
||||
},
|
||||
"font-language-override": {
|
||||
domProp: "fontLanguageOverride",
|
||||
inherited: true,
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "normal" ],
|
||||
@ -2519,6 +2530,14 @@ var gCSSProperties = {
|
||||
other_values: [ "italic", "oblique" ],
|
||||
invalid_values: []
|
||||
},
|
||||
"font-synthesis": {
|
||||
domProp: "fontSynthesis",
|
||||
inherited: true,
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "weight style" ],
|
||||
other_values: [ "none", "weight", "style" ],
|
||||
invalid_values: [ "weight none", "style none", "none style", "weight 10px", "weight weight", "style style" ]
|
||||
},
|
||||
"font-variant": {
|
||||
domProp: "fontVariant",
|
||||
inherited: true,
|
||||
@ -2534,6 +2553,72 @@ var gCSSProperties = {
|
||||
"traditional historical-forms styleset(ok-alt-a, ok-alt-b) historical-forms",
|
||||
"historical-forms styleset(ok-alt-a, ok-alt-b) traditional styleset(potato)", "annotation(a,b,c)" ]
|
||||
},
|
||||
"font-variant-alternates": {
|
||||
domProp: "fontVariantAlternates",
|
||||
inherited: true,
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "normal" ],
|
||||
other_values: [ "historical-forms",
|
||||
"styleset(alt-a, alt-b)", "character-variant(a, b, c)", "annotation(circled)",
|
||||
"swash(squishy)", "styleset(complex\\ blob, a)", "annotation(\\62 lah)" ],
|
||||
invalid_values: [ "historical-forms normal", "historical-forms historical-forms",
|
||||
"swash", "swash(3)", "annotation(a, b)", "ornaments(a,b)",
|
||||
"styleset(1234blah)", "annotation(a), annotation(b)", "annotation(a) normal" ]
|
||||
},
|
||||
"font-variant-caps": {
|
||||
domProp: "fontVariantCaps",
|
||||
inherited: true,
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "normal" ],
|
||||
other_values: [ "small-caps", "all-small-caps", "petite-caps", "all-petite-caps", "titling-caps", "unicase" ],
|
||||
invalid_values: [ "normal small-caps", "petite-caps normal", "unicase unicase" ]
|
||||
},
|
||||
"font-variant-east-asian": {
|
||||
domProp: "fontVariantEastAsian",
|
||||
inherited: true,
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "normal" ],
|
||||
other_values: [ "jis78", "jis83", "jis90", "jis04", "simplified", "traditional", "full-width", "proportional-width", "ruby",
|
||||
"jis78 full-width", "jis78 full-width ruby", "simplified proportional-width", "ruby simplified" ],
|
||||
invalid_values: [ "jis78 normal", "jis90 jis04", "simplified traditional", "full-width proportional-width",
|
||||
"ruby simplified ruby", "jis78 ruby simplified" ]
|
||||
},
|
||||
"font-variant-ligatures": {
|
||||
domProp: "fontVariantLigatures",
|
||||
inherited: true,
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "normal" ],
|
||||
other_values: [ "none", "common-ligatures", "no-common-ligatures", "discretionary-ligatures", "no-discretionary-ligatures",
|
||||
"historical-ligatures", "no-historical-ligatures", "contextual", "no-contextual",
|
||||
"common-ligatures no-discretionary-ligatures", "contextual no-discretionary-ligatures",
|
||||
"historical-ligatures no-common-ligatures", "no-historical-ligatures discretionary-ligatures",
|
||||
"common-ligatures no-discretionary-ligatures historical-ligatures no-contextual" ],
|
||||
invalid_values: [ "common-ligatures normal", "common-ligatures no-common-ligatures", "common-ligatures common-ligatures",
|
||||
"no-historical-ligatures historical-ligatures", "no-discretionary-ligatures discretionary-ligatures",
|
||||
"no-contextual contextual", "common-ligatures no-discretionary-ligatures no-common-ligatures",
|
||||
"common-ligatures none", "no-discretionary-ligatures none", "none common-ligatures" ]
|
||||
},
|
||||
"font-variant-numeric": {
|
||||
domProp: "fontVariantNumeric",
|
||||
inherited: true,
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "normal" ],
|
||||
other_values: [ "lining-nums", "oldstyle-nums", "proportional-nums", "tabular-nums", "diagonal-fractions",
|
||||
"stacked-fractions", "slashed-zero", "ordinal", "lining-nums diagonal-fractions",
|
||||
"tabular-nums stacked-fractions", "tabular-nums slashed-zero stacked-fractions",
|
||||
"proportional-nums slashed-zero diagonal-fractions oldstyle-nums ordinal" ],
|
||||
invalid_values: [ "lining-nums normal", "lining-nums oldstyle-nums", "lining-nums normal slashed-zero ordinal",
|
||||
"proportional-nums tabular-nums", "diagonal-fractions stacked-fractions", "slashed-zero diagonal-fractions slashed-zero",
|
||||
"lining-nums slashed-zero diagonal-fractions oldstyle-nums", "diagonal-fractions diagonal-fractions" ]
|
||||
},
|
||||
"font-variant-position": {
|
||||
domProp: "fontVariantPosition",
|
||||
inherited: true,
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "normal" ],
|
||||
other_values: [ "super", "sub" ],
|
||||
invalid_values: [ "normal sub", "super sub" ]
|
||||
},
|
||||
"font-weight": {
|
||||
domProp: "fontWeight",
|
||||
inherited: true,
|
||||
@ -4341,6 +4426,37 @@ var gCSSProperties = {
|
||||
initial_values: [ "ease", "cubic-bezier(0.25, 0.1, 0.25, 1.0)" ],
|
||||
other_values: [ "linear", "ease-in", "ease-out", "ease-in-out", "linear, ease-in, cubic-bezier(0.1, 0.2, 0.8, 0.9)", "cubic-bezier(0.5, 0.5, 0.5, 0.5)", "cubic-bezier(0.25, 1.5, 0.75, -0.5)", "step-start", "step-end", "steps(1)", "steps(2, start)", "steps(386)", "steps(3, end)" ],
|
||||
invalid_values: [ "none", "auto", "cubic-bezier(0.25, 0.1, 0.25)", "cubic-bezier(0.25, 0.1, 0.25, 0.25, 1.0)", "cubic-bezier(-0.5, 0.5, 0.5, 0.5)", "cubic-bezier(1.5, 0.5, 0.5, 0.5)", "cubic-bezier(0.5, 0.5, -0.5, 0.5)", "cubic-bezier(0.5, 0.5, 1.5, 0.5)", "steps(2, step-end)", "steps(0)", "steps(-2)", "steps(0, step-end, 1)" ]
|
||||
},
|
||||
"-moz-font-feature-settings": {
|
||||
domProp: "MozFontFeatureSettings",
|
||||
inherited: true,
|
||||
type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
|
||||
alias_for: "font-feature-settings",
|
||||
subproperties: [ "font-feature-settings" ],
|
||||
initial_values: [ "normal" ],
|
||||
other_values: [
|
||||
"'liga' on", "'liga'", "\"liga\" 1", "'liga', 'clig' 1",
|
||||
"\"liga\" off", "\"liga\" 0", '"cv01" 3, "cv02" 4',
|
||||
'"cswh", "smcp" off, "salt" 4', '"cswh" 1, "smcp" off, "salt" 4',
|
||||
'"cswh" 0, \'blah\', "liga", "smcp" off, "salt" 4',
|
||||
'"liga" ,"smcp" 0 , "blah"'
|
||||
],
|
||||
invalid_values: [
|
||||
'liga', 'liga 1', 'liga normal', '"liga" normal', 'normal liga',
|
||||
'normal "liga"', 'normal, "liga"', '"liga=1"', "'foobar' on",
|
||||
'"blahblah" 0', '"liga" 3.14', '"liga" 1 3.14', '"liga" 1 normal',
|
||||
'"liga" 1 off', '"liga" on off', '"liga" , 0 "smcp"', '"liga" "smcp"'
|
||||
]
|
||||
},
|
||||
"-moz-font-language-override": {
|
||||
domProp: "MozFontLanguageOverride",
|
||||
inherited: true,
|
||||
type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
|
||||
alias_for: "font-language-override",
|
||||
subproperties: [ "font-language-override" ],
|
||||
initial_values: [ "normal" ],
|
||||
other_values: [ "'ENG'", "'TRK'", "\"TRK\"", "'N\\'Ko'" ],
|
||||
invalid_values: [ "TRK", "ja" ]
|
||||
}
|
||||
}
|
||||
|
||||
@ -4430,130 +4546,6 @@ if (SpecialPowers.getBoolPref("layout.css.vertical-text.enabled")) {
|
||||
}
|
||||
}
|
||||
|
||||
if (SpecialPowers.getBoolPref("layout.css.font-features.enabled")) {
|
||||
var fontFeatureProperties = {
|
||||
"font-kerning": {
|
||||
domProp: "fontKerning",
|
||||
inherited: true,
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "auto" ],
|
||||
other_values: [ "normal", "none" ],
|
||||
invalid_values: [ "on" ]
|
||||
},
|
||||
"font-variant-alternates": {
|
||||
domProp: "fontVariantAlternates",
|
||||
inherited: true,
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "normal" ],
|
||||
other_values: [ "historical-forms",
|
||||
"styleset(alt-a, alt-b)", "character-variant(a, b, c)", "annotation(circled)",
|
||||
"swash(squishy)", "styleset(complex\\ blob, a)", "annotation(\\62 lah)" ],
|
||||
invalid_values: [ "historical-forms normal", "historical-forms historical-forms",
|
||||
"swash", "swash(3)", "annotation(a, b)", "ornaments(a,b)",
|
||||
"styleset(1234blah)", "annotation(a), annotation(b)", "annotation(a) normal" ]
|
||||
},
|
||||
"font-variant-caps": {
|
||||
domProp: "fontVariantCaps",
|
||||
inherited: true,
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "normal" ],
|
||||
other_values: [ "small-caps", "all-small-caps", "petite-caps", "all-petite-caps", "titling-caps", "unicase" ],
|
||||
invalid_values: [ "normal small-caps", "petite-caps normal", "unicase unicase" ]
|
||||
},
|
||||
"font-variant-east-asian": {
|
||||
domProp: "fontVariantEastAsian",
|
||||
inherited: true,
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "normal" ],
|
||||
other_values: [ "jis78", "jis83", "jis90", "jis04", "simplified", "traditional", "full-width", "proportional-width", "ruby",
|
||||
"jis78 full-width", "jis78 full-width ruby", "simplified proportional-width", "ruby simplified" ],
|
||||
invalid_values: [ "jis78 normal", "jis90 jis04", "simplified traditional", "full-width proportional-width",
|
||||
"ruby simplified ruby", "jis78 ruby simplified" ]
|
||||
},
|
||||
"font-variant-ligatures": {
|
||||
domProp: "fontVariantLigatures",
|
||||
inherited: true,
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "normal" ],
|
||||
other_values: [ "none", "common-ligatures", "no-common-ligatures", "discretionary-ligatures", "no-discretionary-ligatures",
|
||||
"historical-ligatures", "no-historical-ligatures", "contextual", "no-contextual",
|
||||
"common-ligatures no-discretionary-ligatures", "contextual no-discretionary-ligatures",
|
||||
"historical-ligatures no-common-ligatures", "no-historical-ligatures discretionary-ligatures",
|
||||
"common-ligatures no-discretionary-ligatures historical-ligatures no-contextual" ],
|
||||
invalid_values: [ "common-ligatures normal", "common-ligatures no-common-ligatures", "common-ligatures common-ligatures",
|
||||
"no-historical-ligatures historical-ligatures", "no-discretionary-ligatures discretionary-ligatures",
|
||||
"no-contextual contextual", "common-ligatures no-discretionary-ligatures no-common-ligatures",
|
||||
"common-ligatures none", "no-discretionary-ligatures none", "none common-ligatures" ]
|
||||
},
|
||||
"font-variant-numeric": {
|
||||
domProp: "fontVariantNumeric",
|
||||
inherited: true,
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "normal" ],
|
||||
other_values: [ "lining-nums", "oldstyle-nums", "proportional-nums", "tabular-nums", "diagonal-fractions",
|
||||
"stacked-fractions", "slashed-zero", "ordinal", "lining-nums diagonal-fractions",
|
||||
"tabular-nums stacked-fractions", "tabular-nums slashed-zero stacked-fractions",
|
||||
"proportional-nums slashed-zero diagonal-fractions oldstyle-nums ordinal" ],
|
||||
invalid_values: [ "lining-nums normal", "lining-nums oldstyle-nums", "lining-nums normal slashed-zero ordinal",
|
||||
"proportional-nums tabular-nums", "diagonal-fractions stacked-fractions", "slashed-zero diagonal-fractions slashed-zero",
|
||||
"lining-nums slashed-zero diagonal-fractions oldstyle-nums", "diagonal-fractions diagonal-fractions" ]
|
||||
},
|
||||
"font-variant-position": {
|
||||
domProp: "fontVariantPosition",
|
||||
inherited: true,
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "normal" ],
|
||||
other_values: [ "super", "sub" ],
|
||||
invalid_values: [ "normal sub", "super sub" ]
|
||||
},
|
||||
"font-synthesis": {
|
||||
domProp: "fontSynthesis",
|
||||
inherited: true,
|
||||
type: CSS_TYPE_LONGHAND,
|
||||
initial_values: [ "weight style" ],
|
||||
other_values: [ "none", "weight", "style" ],
|
||||
invalid_values: [ "weight none", "style none", "none style", "weight 10px", "weight weight", "style style" ]
|
||||
},
|
||||
// aliases for prefixed properties
|
||||
"font-feature-settings": {
|
||||
domProp: "fontFeatureSettings",
|
||||
inherited: true,
|
||||
type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
|
||||
alias_for: "-moz-font-feature-settings",
|
||||
subproperties: [ "-moz-font-feature-settings" ],
|
||||
initial_values: [ "normal" ],
|
||||
other_values: [
|
||||
"'liga' on", "'liga'", "\"liga\" 1", "'liga', 'clig' 1",
|
||||
"\"liga\" off", "\"liga\" 0", '"cv01" 3, "cv02" 4',
|
||||
'"cswh", "smcp" off, "salt" 4', '"cswh" 1, "smcp" off, "salt" 4',
|
||||
'"cswh" 0, \'blah\', "liga", "smcp" off, "salt" 4',
|
||||
'"liga" ,"smcp" 0 , "blah"'
|
||||
],
|
||||
invalid_values: [
|
||||
'liga', 'liga 1', 'liga normal', '"liga" normal', 'normal liga',
|
||||
'normal "liga"', 'normal, "liga"', '"liga=1"', "'foobar' on",
|
||||
'"blahblah" 0', '"liga" 3.14', '"liga" 1 3.14', '"liga" 1 normal',
|
||||
'"liga" 1 off', '"liga" on off', '"liga" , 0 "smcp"', '"liga" "smcp"'
|
||||
]
|
||||
},
|
||||
"font-language-override": {
|
||||
domProp: "fontLanguageOverride",
|
||||
inherited: true,
|
||||
type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
|
||||
alias_for: "-moz-font-language-override",
|
||||
subproperties: [ "-moz-font-language-override" ],
|
||||
initial_values: [ "normal" ],
|
||||
other_values: [ "'ENG'", "'TRK'", "\"TRK\"", "'N\\'Ko'" ],
|
||||
invalid_values: [ "TRK", "ja" ]
|
||||
}
|
||||
};
|
||||
for (var prop in fontFeatureProperties) {
|
||||
gCSSProperties[prop] = fontFeatureProperties[prop];
|
||||
}
|
||||
var fontAdditions = [ "font-kerning", "font-synthesis", "font-variant-alternates", "font-variant-caps", "font-variant-east-asian", "font-variant-ligatures", "font-variant-numeric", "font-variant-position" ];
|
||||
gCSSProperties["font"].subproperties = gCSSProperties["font"].subproperties.concat(fontAdditions);
|
||||
}
|
||||
|
||||
if (SpecialPowers.getBoolPref("layout.css.masking.enabled")) {
|
||||
gCSSProperties["mask-type"] = {
|
||||
domProp: "maskType",
|
||||
|
@ -58,24 +58,18 @@ var all_but_one = {
|
||||
"font-size": "small",
|
||||
"font-size-adjust": "none", // has to be default value
|
||||
"font-stretch": "normal", // has to be default value
|
||||
"-moz-font-feature-settings": "normal", // has to be default value
|
||||
"-moz-font-language-override": "normal" // has to be default value
|
||||
"font-feature-settings": "normal", // has to be default value
|
||||
"font-language-override": "normal", // has to be default value
|
||||
"font-kerning": "auto", // has to be default value
|
||||
"font-synthesis": "weight style", // has to be default value
|
||||
"font-variant-alternates": "normal", // has to be default value
|
||||
"font-variant-caps": "normal", // has to be default value
|
||||
"font-variant-east-asian": "normal", // has to be default value
|
||||
"font-variant-ligatures": "normal", // has to be default value
|
||||
"font-variant-numeric": "normal", // has to be default value
|
||||
"font-variant-position": "normal" // has to be default value
|
||||
};
|
||||
if (SpecialPowers.getBoolPref("layout.css.font-features.enabled")) {
|
||||
var featureDefs = {
|
||||
"font-kerning": "auto", // has to be default value
|
||||
"font-synthesis": "weight style", // has to be default value
|
||||
"font-variant-alternates": "normal", // has to be default value
|
||||
"font-variant-caps": "normal", // has to be default value
|
||||
"font-variant-east-asian": "normal", // has to be default value
|
||||
"font-variant-ligatures": "normal", // has to be default value
|
||||
"font-variant-numeric": "normal", // has to be default value
|
||||
"font-variant-position": "normal" // has to be default value
|
||||
};
|
||||
for (var prop in featureDefs) {
|
||||
all_but_one[prop] = featureDefs[prop];
|
||||
}
|
||||
}
|
||||
|
||||
for (var prop in all_but_one) {
|
||||
s.setProperty(prop, all_but_one[prop], "");
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
<title>Bug 892929 test</title>
|
||||
<link rel="author" title="John Daggett" href="mailto:jdaggett@mozilla.com">
|
||||
<link rel="help" href="http://www.w3.org/TR/css-fonts-3/#om-fontfeaturevalues" />
|
||||
<meta name="assert" content="window.CSSFontFeatureValuesRule should only appear when layout.css.font-features.enabled is true" />
|
||||
<meta name="assert" content="window.CSSFontFeatureValuesRule should appear by default" />
|
||||
<script type="text/javascript" src="/resources/testharness.js"></script>
|
||||
<script type="text/javascript" src="/resources/testharnessreport.js"></script>
|
||||
<style type="text/css">
|
||||
|
@ -69,7 +69,6 @@ function step() {
|
||||
|
||||
var gProps = {
|
||||
"layout.css.vertical-text.enabled": ["text-combine-upright", "text-orientation", "writing-mode"],
|
||||
"layout.css.font-features.enabled": ["font-kerning", "font-synthesis", "font-variant-alternates", "font-variant-caps", "font-variant-east-asian", "font-variant-ligatures", "font-variant-numeric", "font-variant-position"],
|
||||
"layout.css.image-orientation.enabled": ["image-orientation"],
|
||||
"layout.css.mix-blend-mode.enabled": ["mix-blend-mode"],
|
||||
"layout.css.masking.enabled": ["mask-type"],
|
||||
|
@ -253,40 +253,40 @@
|
||||
{ rule: _("unicode-range: U+A5, U+220043"),
|
||||
d: { "unicode-range" : "U+00A5" }, noncanonical: true },
|
||||
|
||||
// -moz-font-feature-settings
|
||||
{ rule: _("-moz-font-feature-settings: normal;"),
|
||||
d: { "-moz-font-feature-settings" : "normal" } },
|
||||
{ rule: _("-moz-font-feature-settings: \"dlig\";"),
|
||||
d: { "-moz-font-feature-settings" : "\"dlig\"" } },
|
||||
{ rule: _("-moz-font-feature-settings: \"dlig\" 1;"),
|
||||
d: { "-moz-font-feature-settings" : "\"dlig\"" }, noncanonical: true },
|
||||
{ rule: _("-moz-font-feature-settings: 'dlig' 1"),
|
||||
d: { "-moz-font-feature-settings" : "\"dlig\"" }, noncanonical: true },
|
||||
// font-feature-settings
|
||||
{ rule: _("font-feature-settings: normal;"),
|
||||
d: { "font-feature-settings" : "normal" } },
|
||||
{ rule: _("font-feature-settings: \"dlig\";"),
|
||||
d: { "font-feature-settings" : "\"dlig\"" } },
|
||||
{ rule: _("font-feature-settings: \"dlig\" 1;"),
|
||||
d: { "font-feature-settings" : "\"dlig\"" }, noncanonical: true },
|
||||
{ rule: _("font-feature-settings: 'dlig' 1"),
|
||||
d: { "font-feature-settings" : "\"dlig\"" }, noncanonical: true },
|
||||
|
||||
// incorrect -moz-font-feature-settings
|
||||
{ rule: _("-moz-font-feature-settings: dlig 1"), d: {} },
|
||||
{ rule: _("-moz-font-feature-settings: none;"), d: {} },
|
||||
{ rule: _("-moz-font-feature-settings: 0;"), d: {} },
|
||||
{ rule: _("-moz-font-feature-settings: 3.14;"), d: {} },
|
||||
{ rule: _("-moz-font-feature-settings: 'blah' 3.14;"), d: {} },
|
||||
{ rule: _("-moz-font-feature-settings: 'dlig' 1 'hist' 0;"), d: {} },
|
||||
{ rule: _("-moz-font-feature-settings: 'dlig=1,hist=1'"), d: {} },
|
||||
// incorrect font-feature-settings
|
||||
{ rule: _("font-feature-settings: dlig 1"), d: {} },
|
||||
{ rule: _("font-feature-settings: none;"), d: {} },
|
||||
{ rule: _("font-feature-settings: 0;"), d: {} },
|
||||
{ rule: _("font-feature-settings: 3.14;"), d: {} },
|
||||
{ rule: _("font-feature-settings: 'blah' 3.14;"), d: {} },
|
||||
{ rule: _("font-feature-settings: 'dlig' 1 'hist' 0;"), d: {} },
|
||||
{ rule: _("font-feature-settings: 'dlig=1,hist=1'"), d: {} },
|
||||
|
||||
// -moz-font-language-override:
|
||||
{ rule: _("-moz-font-language-override: normal;"),
|
||||
d: { "-moz-font-language-override" : "normal" } },
|
||||
{ rule: _("-moz-font-language-override: \"TRK\";"),
|
||||
d: { "-moz-font-language-override" : "\"TRK\"" } },
|
||||
{ rule: _("-moz-font-language-override: 'TRK'"),
|
||||
d: { "-moz-font-language-override" : "\"TRK\"" }, noncanonical: true },
|
||||
// font-language-override:
|
||||
{ rule: _("font-language-override: normal;"),
|
||||
d: { "font-language-override" : "normal" } },
|
||||
{ rule: _("font-language-override: \"TRK\";"),
|
||||
d: { "font-language-override" : "\"TRK\"" } },
|
||||
{ rule: _("font-language-override: 'TRK'"),
|
||||
d: { "font-language-override" : "\"TRK\"" }, noncanonical: true },
|
||||
|
||||
// incorrect -moz-font-language-override
|
||||
{ rule: _("-moz-font-language-override: TRK"), d: {} },
|
||||
{ rule: _("-moz-font-language-override: none;"), d: {} },
|
||||
{ rule: _("-moz-font-language-override: 0;"), d: {} },
|
||||
{ rule: _("-moz-font-language-override: #999;"), d: {} },
|
||||
{ rule: _("-moz-font-language-override: 'TRK' 'SRB'"), d: {} },
|
||||
{ rule: _("-moz-font-language-override: 'TRK', 'SRB'"), d: {} },
|
||||
// incorrect font-language-override
|
||||
{ rule: _("font-language-override: TRK"), d: {} },
|
||||
{ rule: _("font-language-override: none;"), d: {} },
|
||||
{ rule: _("font-language-override: 0;"), d: {} },
|
||||
{ rule: _("font-language-override: #999;"), d: {} },
|
||||
{ rule: _("font-language-override: 'TRK' 'SRB'"), d: {} },
|
||||
{ rule: _("font-language-override: 'TRK', 'SRB'"), d: {} },
|
||||
];
|
||||
|
||||
var display = document.getElementById("display");
|
||||
|
@ -335,10 +335,6 @@ function testOneRule(testrule) {
|
||||
}
|
||||
|
||||
function testFontFeatureValuesRuleParsing() {
|
||||
// Gecko-specific check - if pref not set, skip these tests
|
||||
if (window.SpecialPowers && !window.SpecialPowers.getBoolPref("layout.css.font-features.enabled")) {
|
||||
return;
|
||||
}
|
||||
var i;
|
||||
for (i = 0; i < testrules.length; i++) {
|
||||
var testrule = testrules[i];
|
||||
|
@ -50,13 +50,11 @@ is(elt.style.getPropertyValue("transform"),
|
||||
"translateX(5px) translateY(10px) translateZ(2px) rotateX(30deg) rotateY(30deg) rotateZ(5deg) skewX(10deg) skewY(10deg) scaleX(2) scaleY(0.5) scaleZ(2)",
|
||||
"expected case canonicalization of transform functions");
|
||||
|
||||
if (SpecialPowers.getBoolPref("layout.css.font-features.enabled")) {
|
||||
elt.setAttribute("style",
|
||||
"font-variant-alternates: SWASH(fOo) stYLIStiC(Bar)");
|
||||
is(elt.style.getPropertyValue("font-variant-alternates"),
|
||||
"swash(fOo) stylistic(Bar)",
|
||||
"expected case canonicalization of transform functions");
|
||||
}
|
||||
elt.setAttribute("style",
|
||||
"font-variant-alternates: SWASH(fOo) stYLIStiC(Bar)");
|
||||
is(elt.style.getPropertyValue("font-variant-alternates"),
|
||||
"swash(fOo) stylistic(Bar)",
|
||||
"expected case canonicalization of transform functions");
|
||||
|
||||
elt.setAttribute("style", ""); // leave the page in a useful state
|
||||
|
||||
|
@ -48,7 +48,7 @@ is(e.style.font, "", "font getter returns nothing");
|
||||
|
||||
e.setAttribute("style", "font: inherit; font-family: Helvetica;");
|
||||
|
||||
var cssTextStr = "font-style: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit; -moz-font-feature-settings: inherit; -moz-font-language-override: inherit; font-kerning: inherit; font-synthesis: inherit; font-variant: inherit;";
|
||||
var cssTextStr = "font-style: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit; font-feature-settings: inherit; font-language-override: inherit; font-kerning: inherit; font-synthesis: inherit; font-variant: inherit;";
|
||||
|
||||
is(e.style.cssText, cssTextStr + " font-family: Helvetica;", "don't serialize system font for font:inherit");
|
||||
is(e.style.font, "", "font getter returns nothing");
|
||||
|
@ -96,10 +96,7 @@
|
||||
*|*::-moz-list-bullet, *|*::-moz-list-number {
|
||||
display: inline;
|
||||
vertical-align: baseline;
|
||||
/* TODO: Replace this with font-variant-numeric:tabular-nums once the
|
||||
font-variant-* properties are enabled for all channels (bug 975744). */
|
||||
-moz-font-feature-settings: "tnum";
|
||||
font-feature-settings: "tnum";
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
/* Links */
|
||||
|
@ -1990,25 +1990,13 @@ pref("layout.css.text-align-true-value.enabled", false);
|
||||
// Is support for the CSS4 image-orientation property enabled?
|
||||
pref("layout.css.image-orientation.enabled", true);
|
||||
|
||||
// Is support for CSS3 Fonts features enabled?
|
||||
// (includes font-variant-*, font-kerning, font-synthesis
|
||||
// and the @font-feature-values rule)
|
||||
// Note: with this enabled, font-feature-settings is aliased
|
||||
// to -moz-font-feature-settings. When unprefixing, this should
|
||||
// be reversed, -moz-font-feature-settings should alias to
|
||||
// font-feature-settings.
|
||||
#ifdef RELEASE_BUILD
|
||||
pref("layout.css.font-features.enabled", false);
|
||||
#else
|
||||
pref("layout.css.font-features.enabled", true);
|
||||
#endif
|
||||
|
||||
// Are sets of prefixed properties supported?
|
||||
pref("layout.css.prefixes.border-image", true);
|
||||
pref("layout.css.prefixes.transforms", true);
|
||||
pref("layout.css.prefixes.transitions", true);
|
||||
pref("layout.css.prefixes.animations", true);
|
||||
pref("layout.css.prefixes.box-sizing", true);
|
||||
pref("layout.css.prefixes.font-features", true);
|
||||
|
||||
// Is support for the :scope selector enabled?
|
||||
pref("layout.css.scope-pseudo.enabled", true);
|
||||
|
Loading…
Reference in New Issue
Block a user