Bug 1532122 - Make word-spacing, letter-spacing, and line-height use Rust lengths. r=boris

This also adopts the resolution from [1] while at it, making letter-spacing
compute to a length, serializing 0 to normal rather than keeping normal in the
computed value, which matches every other engine.

This removes the SMIL tests for percentages from letter-spacing since
letter-spacing does in fact not support percentages, so they were passing just
by chance.

[1]: https://github.com/w3c/csswg-drafts/issues/1484

Differential Revision: https://phabricator.services.mozilla.com/D21850
This commit is contained in:
Emilio Cobos Álvarez
2019-03-04 18:19:40 +00:00
parent a7ff38a758
commit d0a4f7b2ee
22 changed files with 170 additions and 317 deletions

View File

@@ -201,12 +201,9 @@ LogicalSize nsTextControlFrame::CalcIntrinsicSize(
// Increment width with cols * letter-spacing.
{
const nsStyleCoord& lsCoord = StyleText()->mLetterSpacing;
if (eStyleUnit_Coord == lsCoord.GetUnit()) {
nscoord letterSpacing = lsCoord.GetCoordValue();
if (letterSpacing != 0) {
intrinsicSize.ISize(aWM) += cols * letterSpacing;
}
const StyleLength& letterSpacing = StyleText()->mLetterSpacing;
if (!letterSpacing.IsZero()) {
intrinsicSize.ISize(aWM) += cols * letterSpacing.ToAppUnits();
}
}