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
This commit is contained in:
Emilio Cobos Álvarez 2018-02-01 02:47:36 +01:00
parent 3ecd324bdc
commit f85c8218d8

View File

@ -380,15 +380,11 @@ nsStyleUtil::AppendFontFeatureSettings(const nsTArray<gfxFontFeature>& aFeatures
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
}
}