Bug 857142 - implement -moz-font-smoothing. r=dbaron
authorJohn Daggett <jdaggett@mozilla.com>
Tue, 30 Jul 2013 05:00:41 +0900
changeset 152717 9395e867ca3bedf118aced309f469ec080fba765
parent 152716 c60ebc542475f74a139031c157436ac3c92d440c
child 152718 e2340b350694c234c4943ce59cf6b57d0b7d954d
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs857142
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 857142 - implement -moz-font-smoothing. r=dbaron
gfx/src/nsFont.cpp
gfx/src/nsFont.h
gfx/thebes/gfxFont.cpp
gfx/thebes/gfxFont.h
gfx/thebes/gfxFontConstants.h
gfx/thebes/gfxMacFont.cpp
layout/style/nsCSSKeywordList.h
layout/style/nsCSSPropList.h
layout/style/nsCSSProps.cpp
layout/style/nsCSSProps.h
layout/style/nsComputedDOMStyle.cpp
layout/style/nsComputedDOMStyle.h
layout/style/nsRuleNode.cpp
layout/style/nsStyleStruct.cpp
layout/style/test/property_database.js
--- a/gfx/src/nsFont.cpp
+++ b/gfx/src/nsFont.cpp
@@ -17,16 +17,17 @@ nsFont::nsFont(const char* aName, uint8_
                "Must only pass ASCII names here");
   name.AssignASCII(aName);
   style = aStyle;
   systemFont = false;
   variant = aVariant;
   weight = aWeight;
   stretch = aStretch;
   decorations = aDecoration;
+  smoothing = NS_FONT_SMOOTHING_AUTO;
   size = aSize;
   sizeAdjust = 0.0;
   kerning = NS_FONT_KERNING_AUTO;
   synthesis = NS_FONT_SYNTHESIS_WEIGHT | NS_FONT_SYNTHESIS_STYLE;
 
   variantAlternates = 0;
   variantCaps = NS_FONT_VARIANT_CAPS_NORMAL;
   variantEastAsian = 0;
@@ -41,16 +42,17 @@ nsFont::nsFont(const nsSubstring& aName,
   : name(aName)
 {
   style = aStyle;
   systemFont = false;
   variant = aVariant;
   weight = aWeight;
   stretch = aStretch;
   decorations = aDecoration;
+  smoothing = NS_FONT_SMOOTHING_AUTO;
   size = aSize;
   sizeAdjust = 0.0;
   kerning = NS_FONT_KERNING_AUTO;
   synthesis = NS_FONT_SYNTHESIS_WEIGHT | NS_FONT_SYNTHESIS_STYLE;
 
   variantAlternates = 0;
   variantCaps = NS_FONT_VARIANT_CAPS_NORMAL;
   variantEastAsian = 0;
@@ -63,16 +65,17 @@ nsFont::nsFont(const nsFont& aOther)
   : name(aOther.name)
 {
   style = aOther.style;
   systemFont = aOther.systemFont;
   variant = aOther.variant;
   weight = aOther.weight;
   stretch = aOther.stretch;
   decorations = aOther.decorations;
+  smoothing = aOther.smoothing;
   size = aOther.size;
   sizeAdjust = aOther.sizeAdjust;
   kerning = aOther.kerning;
   synthesis = aOther.synthesis;
   fontFeatureSettings = aOther.fontFeatureSettings;
   languageOverride = aOther.languageOverride;
   variantAlternates = aOther.variantAlternates;
   variantCaps = aOther.variantCaps;
@@ -117,31 +120,33 @@ bool nsFont::BaseEquals(const nsFont& aO
   }
   return false;
 }
 
 bool nsFont::Equals(const nsFont& aOther) const
 {
   if (BaseEquals(aOther) &&
       (variant == aOther.variant) &&
-      (decorations == aOther.decorations)) {
+      (decorations == aOther.decorations) &&
+      (smoothing == aOther.smoothing)) {
     return true;
   }
   return false;
 }
 
 nsFont& nsFont::operator=(const nsFont& aOther)
 {
   name = aOther.name;
   style = aOther.style;
   systemFont = aOther.systemFont;
   variant = aOther.variant;
   weight = aOther.weight;
   stretch = aOther.stretch;
   decorations = aOther.decorations;
+  smoothing = aOther.smoothing;
   size = aOther.size;
   sizeAdjust = aOther.sizeAdjust;
   kerning = aOther.kerning;
   synthesis = aOther.synthesis;
   fontFeatureSettings = aOther.fontFeatureSettings;
   languageOverride = aOther.languageOverride;
   variantAlternates = aOther.variantAlternates;
   variantCaps = aOther.variantCaps;
@@ -411,16 +416,21 @@ void nsFont::AddFontFeaturesToStyle(gfxF
       break;
 
     default:
       break;
   }
 
   // add in features from font-feature-settings
   aStyle->featureSettings.AppendElements(fontFeatureSettings);
+
+  // enable grayscale antialiasing for text
+  if (smoothing == NS_FONT_SMOOTHING_ANTIALIASED) {
+    aStyle->useGrayscaleAntialiasing = true;
+  }
 }
 
 static bool FontEnumCallback(const nsString& aFamily, bool aGeneric, void *aData)
 {
   *((nsString*)aData) = aFamily;
   return false;
 }
 
--- a/gfx/src/nsFont.h
+++ b/gfx/src/nsFont.h
@@ -66,16 +66,19 @@ struct NS_GFX nsFont {
 
   // -- bitmask for both enumerated and functional propvals
   uint16_t variantAlternates;
 
   // The decorations on the font (underline, overline,
   // line-through). The decorations can be binary or'd together.
   uint8_t decorations;
 
+  // Smoothing - controls subpixel-antialiasing (currently OSX only)
+  uint8_t smoothing;
+
   // The weight of the font; see gfxFontConstants.h.
   uint16_t weight;
 
   // The stretch of the font (the sum of various NS_FONT_STRETCH_*
   // constants; see gfxFontConstants.h).
   int16_t stretch;
 
   // The logical size of the font, in nscoord units
--- a/gfx/thebes/gfxFont.cpp
+++ b/gfx/thebes/gfxFont.cpp
@@ -5007,32 +5007,32 @@ gfxFontStyle::ParseFontLanguageOverride(
   return result;
 }
 
 gfxFontStyle::gfxFontStyle() :
     language(nsGkAtoms::x_western),
     size(DEFAULT_PIXEL_FONT_SIZE), sizeAdjust(0.0f),
     languageOverride(NO_FONT_LANGUAGE_OVERRIDE),
     weight(NS_FONT_WEIGHT_NORMAL), stretch(NS_FONT_STRETCH_NORMAL),
-    systemFont(true), printerFont(false), 
+    systemFont(true), printerFont(false), useGrayscaleAntialiasing(false),
     style(NS_FONT_STYLE_NORMAL)
 {
 }
 
 gfxFontStyle::gfxFontStyle(uint8_t aStyle, uint16_t aWeight, int16_t aStretch,
                            gfxFloat aSize, nsIAtom *aLanguage,
                            float aSizeAdjust, bool aSystemFont,
                            bool aPrinterFont,
                            const nsString& aLanguageOverride):
     language(aLanguage),
     size(aSize), sizeAdjust(aSizeAdjust),
     languageOverride(ParseFontLanguageOverride(aLanguageOverride)),
     weight(aWeight), stretch(aStretch),
     systemFont(aSystemFont), printerFont(aPrinterFont),
-    style(aStyle)
+    useGrayscaleAntialiasing(false), style(aStyle)
 {
     MOZ_ASSERT(!mozilla::IsNaN(size));
     MOZ_ASSERT(!mozilla::IsNaN(sizeAdjust));
 
     if (weight > 900)
         weight = 900;
     if (weight < 100)
         weight = 100;
@@ -5053,16 +5053,17 @@ gfxFontStyle::gfxFontStyle(uint8_t aStyl
 
 gfxFontStyle::gfxFontStyle(const gfxFontStyle& aStyle) :
     language(aStyle.language),
     featureValueLookup(aStyle.featureValueLookup),
     size(aStyle.size), sizeAdjust(aStyle.sizeAdjust),
     languageOverride(aStyle.languageOverride),
     weight(aStyle.weight), stretch(aStyle.stretch),
     systemFont(aStyle.systemFont), printerFont(aStyle.printerFont),
+    useGrayscaleAntialiasing(aStyle.useGrayscaleAntialiasing),
     style(aStyle.style)
 {
     featureSettings.AppendElements(aStyle.featureSettings);
     alternateValues.AppendElements(aStyle.alternateValues);
 }
 
 int8_t
 gfxFontStyle::ComputeWeight() const
--- a/gfx/thebes/gfxFont.h
+++ b/gfx/thebes/gfxFont.h
@@ -122,16 +122,19 @@ struct gfxFontStyle {
     // Say that this font is a system font and therefore does not
     // require certain fixup that we do for fonts from untrusted
     // sources.
     bool systemFont : 1;
 
     // Say that this font is used for print or print preview.
     bool printerFont : 1;
 
+    // Used to imitate -webkit-font-smoothing: antialiased
+    bool useGrayscaleAntialiasing : 1;
+
     // The style of font (normal, italic, oblique)
     uint8_t style : 2;
 
     // Return the final adjusted font size for the given aspect ratio.
     // Not meant to be called when sizeAdjust = 0.
     gfxFloat GetAdjustedSize(gfxFloat aspect) const {
         NS_ASSERTION(sizeAdjust != 0.0, "Not meant to be called when sizeAdjust = 0");
         gfxFloat adjustedSize = std::max(NS_round(size*(sizeAdjust/aspect)), 1.0);
@@ -148,16 +151,17 @@ struct gfxFontStyle {
 
     bool Equals(const gfxFontStyle& other) const {
         return
             (*reinterpret_cast<const uint64_t*>(&size) ==
              *reinterpret_cast<const uint64_t*>(&other.size)) &&
             (style == other.style) &&
             (systemFont == other.systemFont) &&
             (printerFont == other.printerFont) &&
+            (useGrayscaleAntialiasing == other.useGrayscaleAntialiasing) &&
             (weight == other.weight) &&
             (stretch == other.stretch) &&
             (language == other.language) &&
             (*reinterpret_cast<const uint32_t*>(&sizeAdjust) ==
              *reinterpret_cast<const uint32_t*>(&other.sizeAdjust)) &&
             (featureSettings == other.featureSettings) &&
             (languageOverride == other.languageOverride) &&
             (alternateValues == other.alternateValues) &&
--- a/gfx/thebes/gfxFontConstants.h
+++ b/gfx/thebes/gfxFontConstants.h
@@ -25,16 +25,19 @@
 #define NS_FONT_STRETCH_CONDENSED       (-2)
 #define NS_FONT_STRETCH_SEMI_CONDENSED  (-1)
 #define NS_FONT_STRETCH_NORMAL          0
 #define NS_FONT_STRETCH_SEMI_EXPANDED   1
 #define NS_FONT_STRETCH_EXPANDED        2
 #define NS_FONT_STRETCH_EXTRA_EXPANDED  3
 #define NS_FONT_STRETCH_ULTRA_EXPANDED  4
 
+#define NS_FONT_SMOOTHING_AUTO          0
+#define NS_FONT_SMOOTHING_ANTIALIASED   1
+
 #define NS_FONT_KERNING_AUTO                        0
 #define NS_FONT_KERNING_NONE                        1
 #define NS_FONT_KERNING_NORMAL                      2
 
 #define NS_FONT_SYNTHESIS_WEIGHT                    0x1
 #define NS_FONT_SYNTHESIS_STYLE                     0x2
 
 enum {
--- a/gfx/thebes/gfxMacFont.cpp
+++ b/gfx/thebes/gfxMacFont.cpp
@@ -79,16 +79,18 @@ gfxMacFont::gfxMacFont(MacOSFontEntry *a
     }
 
     cairo_font_options_t *fontOptions = cairo_font_options_create();
 
     // turn off font anti-aliasing based on user pref setting
     if (mAdjustedSize <=
         (gfxFloat)gfxPlatformMac::GetPlatform()->GetAntiAliasingThreshold()) {
         cairo_font_options_set_antialias(fontOptions, CAIRO_ANTIALIAS_NONE);
+    } else if (mStyle.useGrayscaleAntialiasing) {
+        cairo_font_options_set_antialias(fontOptions, CAIRO_ANTIALIAS_GRAY);
     }
 
     mScaledFont = cairo_scaled_font_create(mFontFace, &sizeMatrix, &ctm,
                                            fontOptions);
     cairo_font_options_destroy(fontOptions);
 
     cairoerr = cairo_scaled_font_status(mScaledFont);
     if (cairoerr != CAIRO_STATUS_SUCCESS) {
--- a/layout/style/nsCSSKeywordList.h
+++ b/layout/style/nsCSSKeywordList.h
@@ -164,16 +164,17 @@ CSS_KEY(alias, alias)
 CSS_KEY(all, all)
 CSS_KEY(all-petite-caps, all_petite_caps)
 CSS_KEY(all-scroll, all_scroll)
 CSS_KEY(all-small-caps, all_small_caps)
 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)
 CSS_KEY(auto, auto)
 CSS_KEY(avoid, avoid)
 CSS_KEY(background, background)
 CSS_KEY(backwards, backwards)
 CSS_KEY(balance, balance)
--- a/layout/style/nsCSSPropList.h
+++ b/layout/style/nsCSSPropList.h
@@ -1756,16 +1756,28 @@ CSS_PROP_FONT(
         CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
         CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
     "",
     VARIANT_HON | VARIANT_SYSFONT,
     nullptr,
     offsetof(nsStyleFont, mFont.sizeAdjust),
     eStyleAnimType_float)
 CSS_PROP_FONT(
+    -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,
+    "",
+    VARIANT_HK,
+    kFontSmoothingKTable,
+    CSS_PROP_NO_OFFSET,
+    eStyleAnimType_None)
+CSS_PROP_FONT(
     font-stretch,
     font_stretch,
     FontStretch,
     CSS_PROPERTY_PARSE_VALUE |
         CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
         CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
     "",
     VARIANT_HK | VARIANT_SYSFONT,
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -1037,16 +1037,22 @@ const int32_t nsCSSProps::kFontSizeKTabl
   eCSSKeyword_large, NS_STYLE_FONT_SIZE_LARGE,
   eCSSKeyword_x_large, NS_STYLE_FONT_SIZE_XLARGE,
   eCSSKeyword_xx_large, NS_STYLE_FONT_SIZE_XXLARGE,
   eCSSKeyword_larger, NS_STYLE_FONT_SIZE_LARGER,
   eCSSKeyword_smaller, NS_STYLE_FONT_SIZE_SMALLER,
   eCSSKeyword_UNKNOWN,-1
 };
 
+const int32_t nsCSSProps::kFontSmoothingKTable[] = {
+  eCSSKeyword_auto, NS_FONT_SMOOTHING_AUTO,
+  eCSSKeyword_antialiased, NS_FONT_SMOOTHING_ANTIALIASED,
+  eCSSKeyword_UNKNOWN,-1
+};
+
 const int32_t nsCSSProps::kFontStretchKTable[] = {
   eCSSKeyword_ultra_condensed, NS_STYLE_FONT_STRETCH_ULTRA_CONDENSED,
   eCSSKeyword_extra_condensed, NS_STYLE_FONT_STRETCH_EXTRA_CONDENSED,
   eCSSKeyword_condensed, NS_STYLE_FONT_STRETCH_CONDENSED,
   eCSSKeyword_semi_condensed, NS_STYLE_FONT_STRETCH_SEMI_CONDENSED,
   eCSSKeyword_normal, NS_STYLE_FONT_STRETCH_NORMAL,
   eCSSKeyword_semi_expanded, NS_STYLE_FONT_STRETCH_SEMI_EXPANDED,
   eCSSKeyword_expanded, NS_STYLE_FONT_STRETCH_EXPANDED,
--- a/layout/style/nsCSSProps.h
+++ b/layout/style/nsCSSProps.h
@@ -476,16 +476,17 @@ public:
   static const int32_t kAlignSelfKTable[];
   static const int32_t kFlexDirectionKTable[];
   static const int32_t kJustifyContentKTable[];
   static const int32_t kFloatKTable[];
   static const int32_t kFloatEdgeKTable[];
   static const int32_t kFontKTable[];
   static const int32_t kFontKerningKTable[];
   static const int32_t kFontSizeKTable[];
+  static const int32_t kFontSmoothingKTable[];
   static const int32_t kFontStretchKTable[];
   static const int32_t kFontStyleKTable[];
   static const int32_t kFontSynthesisKTable[];
   static const int32_t kFontVariantKTable[];
   static const int32_t kFontVariantAlternatesKTable[];
   static const int32_t kFontVariantAlternatesFuncsKTable[];
   static const int32_t kFontVariantCapsKTable[];
   static const int32_t kFontVariantEastAsianKTable[];
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -1272,16 +1272,25 @@ nsComputedDOMStyle::DoGetFontSizeAdjust(
   } else {
     val->SetIdent(eCSSKeyword_none);
   }
 
   return val;
 }
 
 CSSValue*
+nsComputedDOMStyle::DoGetFontSmoothing()
+{
+  nsROCSSPrimitiveValue* val = new nsROCSSPrimitiveValue;
+  val->SetIdent(nsCSSProps::ValueToKeywordEnum(StyleFont()->mFont.smoothing,
+                                               nsCSSProps::kFontSmoothingKTable));
+  return val;
+}
+
+CSSValue*
 nsComputedDOMStyle::DoGetFontStretch()
 {
   nsROCSSPrimitiveValue* val = new nsROCSSPrimitiveValue;
 
   val->SetIdent(nsCSSProps::ValueToKeywordEnum(StyleFont()->mFont.stretch,
                                                nsCSSProps::kFontStretchKTable));
 
   return val;
@@ -5128,16 +5137,17 @@ nsComputedDOMStyle::GetQueryableProperty
     //// COMPUTED_STYLE_MAP_ENTRY(_moz_column_rule,         ColumnRule),
     COMPUTED_STYLE_MAP_ENTRY(_moz_column_rule_color,        ColumnRuleColor),
     COMPUTED_STYLE_MAP_ENTRY(_moz_column_rule_style,        ColumnRuleStyle),
     COMPUTED_STYLE_MAP_ENTRY(_moz_column_rule_width,        ColumnRuleWidth),
     COMPUTED_STYLE_MAP_ENTRY(_moz_column_width,             ColumnWidth),
     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_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),
     COMPUTED_STYLE_MAP_ENTRY_LAYOUT(_moz_outline_radius_topRight,   OutlineRadiusTopRight),
--- a/layout/style/nsComputedDOMStyle.h
+++ b/layout/style/nsComputedDOMStyle.h
@@ -189,16 +189,17 @@ private:
   /* Font properties */
   mozilla::dom::CSSValue* DoGetColor();
   mozilla::dom::CSSValue* DoGetFontFamily();
   mozilla::dom::CSSValue* DoGetFontFeatureSettings();
   mozilla::dom::CSSValue* DoGetFontKerning();
   mozilla::dom::CSSValue* DoGetFontLanguageOverride();
   mozilla::dom::CSSValue* DoGetFontSize();
   mozilla::dom::CSSValue* DoGetFontSizeAdjust();
+  mozilla::dom::CSSValue* DoGetFontSmoothing();
   mozilla::dom::CSSValue* DoGetFontStretch();
   mozilla::dom::CSSValue* DoGetFontStyle();
   mozilla::dom::CSSValue* DoGetFontSynthesis();
   mozilla::dom::CSSValue* DoGetFontVariant();
   mozilla::dom::CSSValue* DoGetFontVariantAlternates();
   mozilla::dom::CSSValue* DoGetFontVariantCaps();
   mozilla::dom::CSSValue* DoGetFontVariantEastAsian();
   mozilla::dom::CSSValue* DoGetFontVariantLigatures();
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -3192,16 +3192,24 @@ nsRuleNode::SetFont(nsPresContext* aPres
   // When we're in the loop in SetGenericFont, we must ensure that we
   // always keep aFont->mFlags set to the correct generic.  But we have
   // to be careful not to touch it when we're called directly from
   // ComputeFontData, because we could have a start struct.
   if (aGenericFontID != kGenericFont_NONE) {
     aFont->mGenericID = aGenericFontID;
   }
 
+  // font-smoothing: enum, inherit, initial
+  SetDiscrete(*aRuleData->ValueForFontSmoothing(),
+              aFont->mFont.smoothing, aCanStoreInRuleTree,
+              SETDSC_ENUMERATED,
+              aParentFont->mFont.smoothing,
+              defaultVariableFont->smoothing,
+              0, 0, 0, 0);
+
   // font-style: enum, inherit, initial, -moz-system-font
   SetDiscrete(*aRuleData->ValueForFontStyle(),
               aFont->mFont.style, aCanStoreInRuleTree,
               SETDSC_ENUMERATED | SETDSC_SYSTEM_FONT,
               aParentFont->mFont.style,
               defaultVariableFont->style,
               0, 0, 0, systemFont.style);
 
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -210,16 +210,17 @@ nsStyleFont::UnZoomText(nsPresContext *a
 nsChangeHint nsStyleFont::CalcFontDifference(const nsFont& aFont1, const nsFont& aFont2)
 {
   if ((aFont1.size == aFont2.size) && 
       (aFont1.sizeAdjust == aFont2.sizeAdjust) && 
       (aFont1.style == aFont2.style) &&
       (aFont1.variant == aFont2.variant) &&
       (aFont1.weight == aFont2.weight) &&
       (aFont1.stretch == aFont2.stretch) &&
+      (aFont1.smoothing == aFont2.smoothing) &&
       (aFont1.name == aFont2.name) &&
       (aFont1.kerning == aFont2.kerning) &&
       (aFont1.synthesis == aFont2.synthesis) &&
       (aFont1.variantAlternates == aFont2.variantAlternates) &&
       (aFont1.alternateValues == aFont2.alternateValues) &&
       (aFont1.featureValueLookup == aFont2.featureValueLookup) &&
       (aFont1.variantCaps == aFont2.variantCaps) &&
       (aFont1.variantEastAsian == aFont2.variantEastAsian) &&
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -2461,16 +2461,24 @@ var gCSSProperties = {
 	"font-size-adjust": {
 		domProp: "fontSizeAdjust",
 		inherited: true,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "none" ],
 		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,
 		type: CSS_TYPE_LONGHAND,
 		initial_values: [ "normal" ],
 		other_values: [ "ultra-condensed", "extra-condensed", "condensed", "semi-condensed", "semi-expanded", "expanded", "extra-expanded", "ultra-expanded" ],
 		invalid_values: [ "narrower", "wider" ]
 	},