diff --git a/gfx/src/nsFont.cpp b/gfx/src/nsFont.cpp index 71987c23e783..d8946b6f172a 100644 --- a/gfx/src/nsFont.cpp +++ b/gfx/src/nsFont.cpp @@ -423,7 +423,7 @@ void nsFont::AddFontFeaturesToStyle(gfxFontStyle *aStyle) const aStyle->featureSettings.AppendElements(fontFeatureSettings); // enable grayscale antialiasing for text - if (smoothing == NS_FONT_SMOOTHING_GRAYSCALE) { + if (smoothing == NS_FONT_SMOOTHING_ANTIALIASED) { aStyle->useGrayscaleAntialiasing = true; } } diff --git a/gfx/thebes/gfxFontConstants.h b/gfx/thebes/gfxFontConstants.h index 94a443a29db3..1988e4149bd7 100644 --- a/gfx/thebes/gfxFontConstants.h +++ b/gfx/thebes/gfxFontConstants.h @@ -31,7 +31,7 @@ #define NS_FONT_STRETCH_ULTRA_EXPANDED 4 #define NS_FONT_SMOOTHING_AUTO 0 -#define NS_FONT_SMOOTHING_GRAYSCALE 1 +#define NS_FONT_SMOOTHING_ANTIALIASED 1 #define NS_FONT_KERNING_AUTO 0 #define NS_FONT_KERNING_NONE 1 diff --git a/layout/style/nsCSSKeywordList.h b/layout/style/nsCSSKeywordList.h index ee53ad464ea9..4d97013ff0dd 100644 --- a/layout/style/nsCSSKeywordList.h +++ b/layout/style/nsCSSKeywordList.h @@ -169,6 +169,7 @@ CSS_KEY(alpha, alpha) CSS_KEY(alternate, alternate) CSS_KEY(alternate-reverse, alternate_reverse) CSS_KEY(always, always) +CSS_KEY(antialiased, antialiased) CSS_KEY(annotation, annotation) CSS_KEY(appworkspace, appworkspace) CSS_KEY(armenian, armenian) diff --git a/layout/style/nsCSSPropList.h b/layout/style/nsCSSPropList.h index d58b0deb66f5..ac32e0bbdad4 100644 --- a/layout/style/nsCSSPropList.h +++ b/layout/style/nsCSSPropList.h @@ -1761,13 +1761,13 @@ CSS_PROP_FONT( offsetof(nsStyleFont, mFont.sizeAdjust), eStyleAnimType_float) CSS_PROP_FONT( - -moz-osx-font-smoothing, - osx_font_smoothing, - CSS_PROP_DOMPROP_PREFIXED(OSXFontSmoothing), + -moz-font-smoothing, + font_smoothing, + CSS_PROP_DOMPROP_PREFIXED(FontSmoothing), CSS_PROPERTY_PARSE_VALUE | CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE | CSS_PROPERTY_APPLIES_TO_PLACEHOLDER, - "layout.css.osx-font-smoothing.enabled", + "", VARIANT_HK, kFontSmoothingKTable, CSS_PROP_NO_OFFSET, diff --git a/layout/style/nsCSSProps.cpp b/layout/style/nsCSSProps.cpp index b6ed274ba9b7..2c255ab581a6 100644 --- a/layout/style/nsCSSProps.cpp +++ b/layout/style/nsCSSProps.cpp @@ -1044,7 +1044,7 @@ const int32_t nsCSSProps::kFontSizeKTable[] = { const int32_t nsCSSProps::kFontSmoothingKTable[] = { eCSSKeyword_auto, NS_FONT_SMOOTHING_AUTO, - eCSSKeyword_grayscale, NS_FONT_SMOOTHING_GRAYSCALE, + eCSSKeyword_antialiased, NS_FONT_SMOOTHING_ANTIALIASED, eCSSKeyword_UNKNOWN,-1 }; diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp index 925e02f1faf6..d6e292d947c1 100644 --- a/layout/style/nsComputedDOMStyle.cpp +++ b/layout/style/nsComputedDOMStyle.cpp @@ -1277,7 +1277,7 @@ nsComputedDOMStyle::DoGetFontSizeAdjust() } CSSValue* -nsComputedDOMStyle::DoGetOSXFontSmoothing() +nsComputedDOMStyle::DoGetFontSmoothing() { nsROCSSPrimitiveValue* val = new nsROCSSPrimitiveValue; val->SetIdent(nsCSSProps::ValueToKeywordEnum(StyleFont()->mFont.smoothing, @@ -5142,11 +5142,11 @@ nsComputedDOMStyle::GetQueryablePropertyMap(uint32_t* aLength) COMPUTED_STYLE_MAP_ENTRY(float_edge, FloatEdge), COMPUTED_STYLE_MAP_ENTRY(font_feature_settings, FontFeatureSettings), COMPUTED_STYLE_MAP_ENTRY(font_language_override, FontLanguageOverride), + COMPUTED_STYLE_MAP_ENTRY(font_smoothing, FontSmoothing), COMPUTED_STYLE_MAP_ENTRY(force_broken_image_icon, ForceBrokenImageIcon), COMPUTED_STYLE_MAP_ENTRY(hyphens, Hyphens), COMPUTED_STYLE_MAP_ENTRY(image_region, ImageRegion), COMPUTED_STYLE_MAP_ENTRY(orient, Orient), - COMPUTED_STYLE_MAP_ENTRY(osx_font_smoothing, OSXFontSmoothing), COMPUTED_STYLE_MAP_ENTRY_LAYOUT(_moz_outline_radius_bottomLeft, OutlineRadiusBottomLeft), COMPUTED_STYLE_MAP_ENTRY_LAYOUT(_moz_outline_radius_bottomRight,OutlineRadiusBottomRight), COMPUTED_STYLE_MAP_ENTRY_LAYOUT(_moz_outline_radius_topLeft, OutlineRadiusTopLeft), diff --git a/layout/style/nsComputedDOMStyle.h b/layout/style/nsComputedDOMStyle.h index c75265eda958..b391f7162077 100644 --- a/layout/style/nsComputedDOMStyle.h +++ b/layout/style/nsComputedDOMStyle.h @@ -194,7 +194,7 @@ private: mozilla::dom::CSSValue* DoGetFontLanguageOverride(); mozilla::dom::CSSValue* DoGetFontSize(); mozilla::dom::CSSValue* DoGetFontSizeAdjust(); - mozilla::dom::CSSValue* DoGetOSXFontSmoothing(); + mozilla::dom::CSSValue* DoGetFontSmoothing(); mozilla::dom::CSSValue* DoGetFontStretch(); mozilla::dom::CSSValue* DoGetFontStyle(); mozilla::dom::CSSValue* DoGetFontSynthesis(); diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp index ffc158bc71b2..8fb15c442671 100644 --- a/layout/style/nsRuleNode.cpp +++ b/layout/style/nsRuleNode.cpp @@ -3198,7 +3198,7 @@ nsRuleNode::SetFont(nsPresContext* aPresContext, nsStyleContext* aContext, } // font-smoothing: enum, inherit, initial - SetDiscrete(*aRuleData->ValueForOSXFontSmoothing(), + SetDiscrete(*aRuleData->ValueForFontSmoothing(), aFont->mFont.smoothing, aCanStoreInRuleTree, SETDSC_ENUMERATED, aParentFont->mFont.smoothing, diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js index f317ff4d3285..e6534db4278d 100644 --- a/layout/style/test/property_database.js +++ b/layout/style/test/property_database.js @@ -2466,6 +2466,14 @@ var gCSSProperties = { other_values: [ "0.3", "0.5", "0.7" ], invalid_values: [] }, + "-moz-font-smoothing": { + domProp: "MozFontSmoothing", + inherited: true, + type: CSS_TYPE_LONGHAND, + initial_values: [ "auto" ], + other_values: [ "antialiased" ], + invalid_values: [ "none", "subpixel-antialiased" ] + }, "font-stretch": { domProp: "fontStretch", inherited: true, @@ -4608,14 +4616,3 @@ if (SpecialPowers.getBoolPref("layout.css.filters.enabled")) { ] }; } - -if (SpecialPowers.getBoolPref("layout.css.osx-font-smoothing.enabled")) { - gCSSProperties["-moz-osx-font-smoothing"] = { - domProp: "MozOSXFontSmoothing", - inherited: true, - type: CSS_TYPE_LONGHAND, - initial_values: [ "auto" ], - other_values: [ "grayscale" ], - invalid_values: [ "none", "subpixel-antialiased", "antialiased" ] - }; -} diff --git a/modules/libpref/src/init/all.js b/modules/libpref/src/init/all.js index 6a871fbac425..118278ea2e29 100644 --- a/modules/libpref/src/init/all.js +++ b/modules/libpref/src/init/all.js @@ -1812,14 +1812,6 @@ pref("layout.css.scope-pseudo.enabled", true); // Is support for CSS vertical text enabled? pref("layout.css.vertical-text.enabled", false); -// Is -moz-osx-font-smoothing enabled? -// Only supported in OSX builds -#ifdef XP_MACOSX -pref("layout.css.osx-font-smoothing.enabled", true); -#else -pref("layout.css.osx-font-smoothing.enabled", false); -#endif - // pref for which side vertical scrollbars should be on // 0 = end-side in UI direction // 1 = end-side in document/content direction