Intent to ship: Canvas2D TextMetrics.emHeight* attributes

25 views
Skip to first unread message

Jonathan Kew

unread,
Aug 1, 2023, 7:18:47 AM8/1/23
to dev-pl...@mozilla.org
As of Firefox 118, I intend to turn the emHeight attributes[*] of the
Canvas2D TextMetrics interface on by default.

This was developed behind the dom.textMetrics.emHeight.enabled preference.

Status in other browsers is:
Chrome - not yet shipping in Release, but present in Canary
Safari - shipping (though results are not reliable; fails WPT tests)

Bug to turn on by default:
https://bugzilla.mozilla.org/show_bug.cgi?id=1841692

Standard: https://html.spec.whatwg.org/multipage/canvas.html#textmetrics

These attributes were originally implemented behind a pref in bug
1102584, but were not immediately shipped due to concerns over the
interoperability of the resulting values.

In bug 1841692, I'm fixing an error in our implementation and updating
tests to be more robust, so that we can ship this. (With this fix, our
results appear to be consistent with Chrome's.)

JK

[*] This covers two individual TextMetrics attributes:
emHeightAscent
emHeightDescent

Reply all
Reply to author
Forward
0 new messages