diff options
author | Paul Rouget <me@paulrouget.com> | 2019-09-21 09:36:53 +0200 |
---|---|---|
committer | Paul Rouget <me@paulrouget.com> | 2019-09-25 13:34:48 +0200 |
commit | 3695fb1eb4182b47b80ed31983a5651c8148aef6 (patch) | |
tree | ef4008570660f03dca85510eea70a1d8f1decef9 /components/script/dom/webidls/TextMetrics.webidl | |
parent | 748fa72320dcf73964ccf79d8d84e80c6031df37 (diff) | |
download | servo-3695fb1eb4182b47b80ed31983a5651c8148aef6.tar.gz servo-3695fb1eb4182b47b80ed31983a5651c8148aef6.zip |
Temporary implementation of Canvas.MeasureText
Diffstat (limited to 'components/script/dom/webidls/TextMetrics.webidl')
-rw-r--r-- | components/script/dom/webidls/TextMetrics.webidl | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/components/script/dom/webidls/TextMetrics.webidl b/components/script/dom/webidls/TextMetrics.webidl new file mode 100644 index 00000000000..f3d90450824 --- /dev/null +++ b/components/script/dom/webidls/TextMetrics.webidl @@ -0,0 +1,23 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +// https://html.spec.whatwg.org/multipage/#textmetrics +[Exposed=(PaintWorklet, Window, Worker), Pref="dom.canvas-text.enabled"] +interface TextMetrics { + // x-direction + readonly attribute double width; // advance width + readonly attribute double actualBoundingBoxLeft; + readonly attribute double actualBoundingBoxRight; + + // y-direction + readonly attribute double fontBoundingBoxAscent; + readonly attribute double fontBoundingBoxDescent; + readonly attribute double actualBoundingBoxAscent; + readonly attribute double actualBoundingBoxDescent; + readonly attribute double emHeightAscent; + readonly attribute double emHeightDescent; + readonly attribute double hangingBaseline; + readonly attribute double alphabeticBaseline; + readonly attribute double ideographicBaseline; +}; |