Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1046,6 +1046,9 @@ <h3 id="editcontext-interface">EditContext Interface</h3>
sequence&lt;HTMLElement&gt; attachedElements();

readonly attribute DOMString text;
readonly attribute unsigned long textLength;
DOMString getText(unsigned long rangeStart, unsigned long rangeEnd);

readonly attribute unsigned long selectionStart;
readonly attribute unsigned long selectionEnd;
readonly attribute unsigned long characterBoundsRangeStart;
Expand Down Expand Up @@ -1073,6 +1076,38 @@ <h3 id="editcontext-interface">EditContext Interface</h3>
<dt>characterBoundsRangeStart</dt>
<dd>The {{EditContext/characterBoundsRangeStart}} getter steps are to return [=this=]'s [=codepoint rects start index=].</dd>

<dt>textLength</dt>
<dd>The {{EditContext/textLength}} getter steps are to return [=this=]'s [=text=]'s length.</dd>

<dt>getText() method</dt>
<dd>
<p>
The method must follow these steps:
</p>
<div class="algorithm">
<dl>
<dt>Input</dt>
<dd>|rangeStart|, an unsigned long</dd>
<dd>|rangeEnd|, an unsigned long</dd>
<dt>Output</dt>
<dd>A {{DOMString}}</dd>
</dl>
<ol>
<li>
If |rangeStart| is greater than the length of [=text=],
set |rangeStart| to the length of [=text=].
</li>
<li>
If |rangeEnd| is greater than the length of [=text=],
set |rangeEnd| to the length of [=text=].
</li>
<li>
Return the substring of [=text=] in the range of |rangeStart| and |rangeEnd|.
<div class="note">It's permissible that |rangeStart| > |rangeEnd|. The substring between the indices should be retrieved in the same way as if |rangeStart| and |rangeEnd| were swapped.</div>
</li>
</ol>
</dd>

<dt>updateText() method</dt>
<dd>
<p>
Expand Down
Loading