TeX and CSS treat line heights in fundamentally different ways. In
TeX, every character is treated as a box of its precise height and
depth; the line height (\baselineskip) applies after characters have
been assembled into lines. In CSS, in contrast, every character
creates a "line box" corresponding to the accompanying font. When
characters of different fonts and sizes are placed into the same
span, the resulting line box contains the line boxes of all children.
This is unfortunate because, for example, we want `\frac{1}{2}` to
behave in vertical spacing contexts like it is exactly as tall and
deep as the visible fraction (which is the TeX behavior). Given CSS
constraints, though, in most contexts the fraction has extra vertical
space: the line boxes for the numerator and denominator create
padding. For small boxes, this isn't so bad. To really see the
problem put a tall rule in the denominator of a fraction, or check
out the VerticalSpacing screenshotter test, which has way more space
than it should.
Solving this problem in CSS is difficult. There is no easy way to get
rid of the extra line boxes.
But there is *a* way, namely tables. A table-cell with vertical-align
top, bottom, or middle is ignored for the purposes of line height
calculation.
So in this commit, makeVList puts its contents into a
vertical-align:bottom table-cell (to clear unwanted line boxes), with
an extra row used to represent depth.
Many Chrome screenshotter tests change. This is because Chrome rounds
table dimensions to integral numbers of pixels, while it uses
sub-pixel positioning for non-table displayed tabs. That makes many
vlists a fraction of a pixel wider than they used to be.
* Em and mu sizes are relative to current font's quad metric,
which might not be "1em" in CSS terms.
* We don't need the `emPerEx` metric, because we want to convert
TeX `ex` to CSS `em`, not TeX `ex` to TeX `em`. The `xHeight`
metric does that already: it is relative to font size.
* Mu sizes scale with the style, em and ex do not (empirically
checked; agrees with rule 2 of TeXbook Appendix G).
This corrects a bug in b866cd5224 (in which em scaled),
and a bug in previous versions (in which mu did not scale).
* Correct rule sizes. Previous comment---"the sizes of rules are
absolute"---was misleading. Rule sizes are NOT absolute---in
\large size, a rule denominated in 'em' is larger. But the 'em'
unit is not sensitive to styles. So now a 1em rule will be the
same size in super/subscript, as it should be, but an 18mu rule
will change size in super/subscript, as it should.
Note a TODO.