# HG changeset patch # User Emilio Cobos Alvarez # Date 1517449656 -3600 # Node ID 946b943acc043b4e652cb88ea7bfb0eeffd4e588 # Parent 00237aaca9ae199be85ad48e15d3239df465d10d Bug 1434724: Fix computed value serialization of font-feature-settings. r=dholbert This should make us agree with other browsers re the serialization of `"vert" 0`, and with servo after https://github.com/servo/servo/pull/19918 Left try running, may need some test adjustments that I'll send for review if they're non-trivial. Differential Revision: https://phabricator.services.mozilla.com/D539 MozReview-Commit-ID: LgIPfn4lfrF diff --git a/layout/style/nsStyleUtil.cpp b/layout/style/nsStyleUtil.cpp --- a/layout/style/nsStyleUtil.cpp +++ b/layout/style/nsStyleUtil.cpp @@ -375,25 +375,21 @@ nsStyleUtil::AppendFontFeatureSettings(c const gfxFontFeature& feat = aFeatures[i]; if (i != 0) { aResult.AppendLiteral(", "); } AppendFontTagAsString(feat.mTag, aResult); - // output value, if necessary - if (feat.mValue == 0) { - // 0 ==> off - aResult.AppendLiteral(" off"); - } else if (feat.mValue > 1) { + // omit value if it's 1, implied by default + if (feat.mValue != 1) { aResult.Append(' '); aResult.AppendInt(feat.mValue); } - // else, omit value if 1, implied by default } } /* static */ void nsStyleUtil::AppendFontFeatureSettings(const nsCSSValue& aSrc, nsAString& aResult) { nsCSSUnit unit = aSrc.GetUnit();