Add support for the 'cap' font-relative unit

This is a backport of https://phabricator.services.mozilla.com/D133101,
by Jonathan Kew.

Note that Servo isn't using font metrics yet, so the unit still won't
really work.
This commit is contained in:
Oriol Brufau 2023-05-10 02:26:00 +02:00
parent 61f872e7da
commit 6785c57c78
5 changed files with 68 additions and 8 deletions

View file

@ -168,6 +168,7 @@ impl generic::CalcNodeLeaf for Leaf {
FontRelativeLength::Ch(..) => SortKey::Ch,
FontRelativeLength::Em(..) => SortKey::Em,
FontRelativeLength::Ex(..) => SortKey::Ex,
FontRelativeLength::Cap(..) => SortKey::Cap,
FontRelativeLength::Rem(..) => SortKey::Rem,
},
NoCalcLength::ViewportPercentage(ref vp) => match *vp {