151592
2015-11-24 13:27:05 -0800
Find a replacement for -webkit-line-box-contain in mathml.css
2016-03-14 06:06:11 -0700
1
1
1
Unclassified
WebKit
MathML
WebKit Nightly Build
All
All
NEW
P2
Normal
---
43819
131839
153991
155433
1
fred.wang
webkit-unassigned
alex
bfulgham
cfleizach
darin
jfernandez
mrobinson
oldest_to_newest
1144370
0
fred.wang
2015-11-24 13:27:05 -0800
In http://trac.webkit.org/changeset/124512, David Barton added the following CSS properties to avoid excessive line spacing in MathML expressions:
math {
-webkit-line-box-contain: glyphs replaced;
line-height: 0;
}
mtext {
line-height: 1.0;
}
(the "line-height: 0;" has been removed since then, but the one for mtext preserved)
I suspect this is no longer necessary with OpenType math fonts setting the USE_TYPO_METRICS flag now that it is supported by WebKit (bug 131839). However, it's probably good to reset some CSS spacing properties, for example an issue was reported in Wikipedia for Gecko, see https://bugzilla.mozilla.org/show_bug.cgi?id=1187673.
So I'd suggest to replace the above rules with just:
math {
line-height: normal;
word-spacing: normal;
letter-spacing: normal;
}
Related to that is the list of math fonts in the font-family rule. Apple engineer will still have to upgrade the pre-installed STIX fonts to version 2.0 when it is released before we can update the default font-family. As a comparison, the latest Gecko release use the following list of math fonts: "Latin Modern Math, XITS Math, Cambria Math, TeX Gyre Bonum Math, TeX Gyre Pagella Math, TeX Gyre Schola, TeX Gyre Termes Math, STIX Math, Asana Math, STIXGeneral, DejaVu Serif, DejaVu Sans, serif"
1144371
1
fred.wang
2015-11-24 13:32:27 -0800
(I forgot to mention that the -webkit-line-box-contain property was removed from Blink, so it's probably good to avoid relying on it anyway: https://code.google.com/p/chromium/issues/detail?id=522215)
1162353
2
fred.wang
2016-02-05 00:59:49 -0800
@Alex: I've done the proposed adjustment on your MathML branch, except that I kept "-webkit-line-box-contain: glyphs replaced;". Indeed, removing that one causes excessive ascent/descent and breaks tests. Upgrading the math test font to a version that has the USE_TYPO_METRICS flag gives a better result (see https://github.com/mrobinson/webkitgtk-test-fonts/issues/6) ; but using logical metrics still gives slightly taller ascent/descent than ink metrics [1]. So I suspect we will have to keep it for now and consider that again when the MathML layout code can really distinguish between logical/ink metrics. We will probably have to do something similar to Gecko (which does not support -webkit-line-box-contain) if we want to port the MathML code to Blink.
[1] http://www.mathml-association.org/MathMLinHTML5/S3.html#SS1.SSS1
1174428
3
fred.wang
2016-03-14 06:06:11 -0700
I moved the safe changes into bug 155433 and bug 155018. Let's keep this bug for the -webkit-line-box-contain rule only.