[Webkit-unassigned] [Bug 41535] "vertical-align: middle; " not working on a MathML element

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Sep 6 11:46:04 PDT 2010


--- Comment #8 from mitz at webkit.org  2010-09-06 11:46:04 PST ---
(In reply to comment #6)
> I'll correct the style.
> The cast is here, because xHeight is a float and Core Graphics seems to return a value just above zero but not zero for Apple Symbols fonts that have no "x" glyph. Thus the test if (!m_xHeight) is always false.

I am slightly confused here. CGFontGetXHeight() returns an integer. Is the integer returned for Apple Symbols not zero? Or are you saying that the result of static_cast<float>(0) / m_unitsPerEm is not zero? That is odd. By casting to int and comparing to zero you are treating all values smaller than 1 as zero.

> I thought that m_ascent was a float. It is indeed an int.
> I don't know which possibility is the best:
> - 0.66 * fAscent;
> - static_cast<float>(2 * m_ascent / 3);
> The first one is probably better from a precision point of view, but does it matter in practice?
> The second one should be faster.
> After testing with the test case, the precision changes nothing. So the second possibility is probably better.

I still don’t understand the choice of either constant here. This is what <http://www.w3.org/TR/2009/CR-CSS2-20090908/syndata.html#length-units> says:

In the cases where it is impossible or impractical to determine the x-height, a value of 0.5em should be used.

> The change is only needed for the mac port, as it is here to fix the Apple Symbols font problem.

The change is not font-specific, and there may be other fonts, which may be used on other platforms, that have a zero x-height. How do other platforms deal with it?

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list