Skip to content

Commit 01d8a77

Browse files
authored
Remove codepoint locations struct (#84)
The "codepoint locations" struct is defined but not really referenced throughout the rest of the spec. Its intention was to allow for multiple ranges of cached codepoint rects, but the getters and setters for character bounds spec assume that only one such range exists. Since it doesn't seem that support for multiple ranges ended up being needed, remove the "codepoint locations" concept so that the setters/getters are consistent with the actual shape of EditContext's data structures.
1 parent 22a1807 commit 01d8a77

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

index.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ <h4>EditContext state</h4>
115115
<li><dfn>text formats</dfn> which is an array of [=text format=]. The array is initially empty.</li>
116116
<li><dfn>control bounds</dfn> is a rectangle describing the area of the screen in which [=text=] is displayed. It is in the [=client coordinate=] system and the initial x, y, width, and height all 0.</li>
117117
<li><dfn>selection bounds</dfn> is the rectangle describing the position of selection. It is in the [=client coordinate=] system and the initial x, y, width, and height are all 0.</li>
118-
<li><dfn>codepoint locations</dfn> which is an array of [=codepoint location=]. The array is initially empty.</li>
118+
<li><dfn>codepoint rects start index</dfn> which is an offset into [=text=] that respresents the position before the first codepoint whose location is reported by the first member of [=codepoint rects=] array.</li>
119+
<li><dfn>codepoint rects</dfn> is an array of {{DOMRect}} defining the bounding box of each codepoint. The array is initially empty.</li>
119120
</ul>
120121
<p><dfn>text format</dfn> is a struct that indicates decorative properties that should be applied to the ranges of [=text=]. The struct contains:</p>
121122
<ul>
@@ -124,16 +125,15 @@ <h4>EditContext state</h4>
124125
<li><dfn>underline style</dfn>, a {{UnderlineStyle}} which is the preferred underline style of the decorated [=text=] range.</li>
125126
<li><dfn>underline thickness</dfn>, a {{UnderlineThickness}} which is the preferred underline thickness of the decorated [=text=] range.</li>
126127
</ul>
127-
<p><dfn>codepoint location</dfn> is a struct that captures the location (in [=client coordinate=]s) of codepoints from [=text=]. Each struct represents a contigious run of codepoints starting at an offset within [=text=] indicated by [=start index=]. The struct contains:</p>
128-
<ul>
129-
<li><dfn>start index</dfn> which is an offset into [=text=] that respresents the position before the first codepoint whose location is reported by the first member of [=codepoint rects=] array.</li>
130-
<li><dfn>codepoint rects</dfn> is an array of {{DOMRect}} defining the bounding box of each codepoint.</li>
131-
</ul>
132128
<p class="note">
133-
[=Codepoint locations=] provides the means for the user agent to query multiple ranges of [=text=] for positioning information.
134-
Different platforms may require different positions to be cached to fulfill queries from the [=Text Input Service=] and this API shape allows for that flexibility.
135-
It would be good if the API could be simplified to require just the positions of the actively composed text along with the [=selection bounds=] and [=control bounds=].
136-
Exploration is needed to see if that is possible.
129+
[=Codepoint rects=] provides the means for the user agent to query a range of
130+
[=text=] for positioning information. The [=Text Input Service=] will use this
131+
information, in tandem with the [=control bounds=] and [=selection bounds=], to
132+
support the Text Input Method in properly displaying its user interface. For example,
133+
the info can be used to position an IME window adjacent to text being composed.
134+
Different platforms may require different positions to be cached to fulfill queries
135+
from the [=Text Input Service=]. The user agent will indicate which positions are
136+
required by firing {{CharacterBoundsUpdateEvent}}.
137137
</p>
138138
<h4>Association and activation</h4>
139139
<p>
@@ -986,7 +986,7 @@ <h3 id="editcontext-interface">EditContext Interface</h3>
986986
<dd>The {{EditContext/characterBounds}} getter steps are to return [=this=]'s [=codepoint rects=].</dd>
987987

988988
<dt>characterBoundsRangeStart</dt>
989-
<dd>The {{EditContext/characterBoundsRangeStart}} getter steps are to return [=this=]'s [=start index=].</dd>
989+
<dd>The {{EditContext/characterBoundsRangeStart}} getter steps are to return [=this=]'s [=codepoint rects start index=].</dd>
990990

991991
<dt>updateText() method</dt>
992992
<dd>
@@ -1091,7 +1091,7 @@ <h3 id="editcontext-interface">EditContext Interface</h3>
10911091
</dl>
10921092
<ol>
10931093
<li>
1094-
set [=start index=] to |rangeStart|.
1094+
set [=codepoint rects start index=] to |rangeStart|.
10951095
</li>
10961096
<li>
10971097
set [=codepoint rects=] to |characterBounds|.

0 commit comments

Comments
 (0)