Permalink
Browse files

Revert "Add advances to TextMetrics and change baselines API"

This reverts commit 7711a1f. As
discussed in #3995, these changes were made prematurely without
appropriate implementer sign-off. Since then, a plethora of issues
around the changes here have been opened up (e.g. #3994, #4023, #4026,
#4030, #4033, #4034). We revert these changes until a more complete and
agreed-upon specification can replace them.

Closes #3995.
  • Loading branch information...
domenic committed Sep 17, 2018
1 parent 6867dfa commit 31c0db30a74534f56359e4187d32e824f7d5d9f6
Showing with 25 additions and 38 deletions.
  1. +25 −38 source
View
63 source
@@ -60056,18 +60056,10 @@ interface <dfn>CanvasPattern</dfn> {
void <span data-x="dom-canvaspattern-setTransform">setTransform</span>(optional <span>DOMMatrix2DInit</span> transform);
};
[Exposed=(Window,Worker)]
dictionary <dfn>Baselines</dfn> {
double <span data-x="dom-Baselines-alphabetic">alphabetic</span>;
double <span data-x="dom-Baselines-hanging">hanging</span>;
double <span data-x="dom-Baselines-ideographic">ideographic</span>;
};
[Exposed=(Window,Worker)]
interface <dfn>TextMetrics</dfn> {
// x-direction
readonly attribute double <span data-x="dom-textmetrics-width">width</span>; // advance width
readonly attribute FrozenArray&lt;double> <span data-x="dom-textmetrics-advances">advances</span>;
readonly attribute double <span data-x="dom-textmetrics-actualBoundingBoxLeft">actualBoundingBoxLeft</span>;
readonly attribute double <span data-x="dom-textmetrics-actualBoundingBoxRight">actualBoundingBoxRight</span>;
@@ -60078,7 +60070,9 @@ interface <dfn>TextMetrics</dfn> {
readonly attribute double <span data-x="dom-textmetrics-actualBoundingBoxDescent">actualBoundingBoxDescent</span>;
readonly attribute double <span data-x="dom-textmetrics-emHeightAscent">emHeightAscent</span>;
readonly attribute double <span data-x="dom-textmetrics-emHeightDescent">emHeightDescent</span>;
<span>Baselines</span> <span data-x="dom-textmetrics-getBaselines">getBaselines</span>();
readonly attribute double <span data-x="dom-textmetrics-hangingBaseline">hangingBaseline</span>;
readonly attribute double <span data-x="dom-textmetrics-alphabeticBaseline">alphabeticBaseline</span>;
readonly attribute double <span data-x="dom-textmetrics-ideographicBaseline">ideographicBaseline</span>;
};
[<span data-x="dom-imagedata">Constructor</span>(unsigned long sw, unsigned long sh),
@@ -63001,7 +62995,6 @@ try {
</dd>
<dt><var>metrics</var> . <code subdfn data-x="dom-textmetrics-width">width</code></dt>
<dt><var>metrics</var> . <code subdfn data-x="dom-textmetrics-advances">advances</code></dt>
<dt><var>metrics</var> . <code subdfn data-x="dom-textmetrics-actualBoundingBoxLeft">actualBoundingBoxLeft</code></dt>
<dt><var>metrics</var> . <code subdfn data-x="dom-textmetrics-actualBoundingBoxRight">actualBoundingBoxRight</code></dt>
<dt><var>metrics</var> . <code subdfn data-x="dom-textmetrics-fontBoundingBoxAscent">fontBoundingBoxAscent</code></dt>
@@ -63010,7 +63003,9 @@ try {
<dt><var>metrics</var> . <code subdfn data-x="dom-textmetrics-actualBoundingBoxDescent">actualBoundingBoxDescent</code></dt>
<dt><var>metrics</var> . <code subdfn data-x="dom-textmetrics-emHeightAscent">emHeightAscent</code></dt>
<dt><var>metrics</var> . <code subdfn data-x="dom-textmetrics-emHeightDescent">emHeightDescent</code></dt>
<dt><var>metrics</var> . <code subdfn data-x="dom-textmetrics-getBaselines">getBaselines</code>()</dt>
<dt><var>metrics</var> . <code subdfn data-x="dom-textmetrics-hangingBaseline">hangingBaseline</code></dt>
<dt><var>metrics</var> . <code subdfn data-x="dom-textmetrics-alphabeticBaseline">alphabeticBaseline</code></dt>
<dt><var>metrics</var> . <code subdfn data-x="dom-textmetrics-ideographicBaseline">ideographicBaseline</code></dt>
<dd>
@@ -63211,13 +63206,6 @@ v6DVT (also check for '- -' bits in the part above) -->
<dd><p>The width of that <span>inline box</span>, in <span data-x="'px'">CSS pixels</span>. (The
text's advance width.)</p></dd>
<dt><dfn><code data-x="dom-textmetrics-advances">advances</code></dfn> attribute</dt>
<dd><p>Returns a frozen array containing advances for each character in the measured text. Each
advance is measured as the distance from the beginning of the string (starting at 0) up to the
left side of the character. The same frozen array object must be returned every time this
attribute's getter is invoked.</p></dd>
<dt><dfn><code data-x="dom-textmetrics-actualBoundingBoxLeft">actualBoundingBoxLeft</code></dfn> attribute</dt>
<dd>
@@ -63315,31 +63303,30 @@ v6DVT (also check for '- -' bits in the part above) -->
indicating that the given baseline is above the bottom of that em square. (Zero if the given baseline
is the bottom of that em square.)</p></dd>
<dt><dfn><code data-x="dom-textmetrics-getBaselines">getBaselines()</code></dfn> method</dt>
<dt><dfn><code data-x="dom-textmetrics-hangingBaseline">hangingBaseline</code></dfn> attribute</dt>
<dd>
<p>Returns a <code>Baselines</code> dictionary containing available baselines:
<dd><p>The distance from the horizontal line indicated by the <code
data-x="dom-context-2d-textBaseline">textBaseline</code> attribute to the hanging baseline of the
<span>line box</span>, in <span data-x="'px'">CSS pixels</span>; positive numbers indicating that
the given baseline is below the hanging baseline. (Zero if the given baseline is the hanging
baseline.)</p></dd>
<ul>
<li><p>If the alphabetic baseline is available for this text, the <dfn><code
data-x="dom-Baselines-alphabetic">alphabetic</code></dfn> dictionary member must be set to that
baseline value.</p></li>
<dt><dfn><code data-x="dom-textmetrics-alphabeticBaseline">alphabeticBaseline</code></dfn> attribute</dt>
<li><p>If the hanging baseline is available for this text, the <dfn><code
data-x="dom-Baselines-hanging">hanging</code></dfn> dictionary member must be set to that
baseline value.</p></li>
<dd><p>The distance from the horizontal line indicated by the <code
data-x="dom-context-2d-textBaseline">textBaseline</code> attribute to the alphabetic baseline of
the <span>line box</span>, in <span data-x="'px'">CSS pixels</span>; positive numbers indicating
that the given baseline is below the alphabetic baseline. (Zero if the given baseline is the
alphabetic baseline.)</p></dd>
<li><p>If the ideographic baseline is available for this text, the <dfn><code
data-x="dom-Baselines-ideographic">ideographic</code></dfn> dictionary member must be set to
that baseline value.</p></li>
</ul>
<dt><dfn><code data-x="dom-textmetrics-ideographicBaseline">ideographicBaseline</code></dfn> attribute</dt>
<dd><p>The distance from the horizontal line indicated by the <code
data-x="dom-context-2d-textBaseline">textBaseline</code> attribute to the ideographic baseline of
the <span>line box</span>, in <span data-x="'px'">CSS pixels</span>; positive numbers indicating
that the given baseline is below the ideographic baseline. (Zero if the given baseline is the
ideographic baseline.)</p></dd>
<p>In all cases, the baslines values are represented as distance from the horizontal line
indicated by the <code data-x="dom-context-2d-textBaseline">textBaseline</code> attribute to
their respective baseline of the <span>line box</span>, in <span
data-x="'px'">CSS pixels</span>, with positive numbers indicating that the given baseline is
below the current <code data-x="dom-context-2d-textBaseline">textBaseline</code>.</p>
</dd>
</dl>
<p class="note">Glyphs rendered using <code data-x="dom-context-2d-fillText">fillText()</code> and

0 comments on commit 31c0db3

Please sign in to comment.