Skip to content

Commit

Permalink
allow spell checkers to operate on more than just single text nodes b…
Browse files Browse the repository at this point in the history
…y means of the 'replaceContent' intent, closes #50 #36
  • Loading branch information
johanneswilm committed Aug 2, 2015
1 parent 495c984 commit 7698c9f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
9 changes: 5 additions & 4 deletions contentEditableTyping.html
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ <h3 id="caret_movement">Caret movement</h3>
<h2 id="text_node_editing">Text Node Editing</h2>

<p>When the user indicates that new content should be added to the
<a>CE Typing Node</a> in which the caret is currently place, no
<a>CE Typing Node</a> in which the caret is currently placed, no
content is actually added, but a `beforeInput` event is triggered
with `inputType` set to `insertCharacter`.</p>

Expand Down Expand Up @@ -248,12 +248,13 @@ <h3 id="add_with_composition">Adding characters by means of
</section>

<section>
<h3 id="replacing_text">Replacing text</h3>
<h3 id="replacing_text">Replacing text/content</h3>

<p>When the user indicates the wish to replace part of the
contents of a <a>CE Typing Node</a> by means of a
contents of a <a>CE Typing Container</a>, by means of a
browser-builtin spell checker or alike, a `beforeInput` input
with `inputType` set to `replaceText` is triggered.</p>
with `inputType` set to `replaceText` or `replaceContent` is
triggered.</p>
</section>
</section>

Expand Down
29 changes: 25 additions & 4 deletions input-events.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ <h4>Interface InputEvent</h4>

<dd>
<p><code>inputType</code> holds the type of input. Allowed
values include insertCharacter, replaceText, insertNewline,
values include insertCharacter, replaceText, replaceContent,
insertNewline,
deleteContentForward, deleteContentBackward, deleteContent,
undo, redo, caretUp, caretDown, caretRight, caretLeft,
caretPageUp, caretPageDown, caretStartLine, caretEndLine,
Expand All @@ -110,9 +111,10 @@ <h4>Interface InputEvent</h4>
</ol>
</li>

<li>If the user is replacing plain text using a
keyboard, IME, speech, or similar method, the inputType
MUST be <b>replaceText</b>.
<li>If the user indicates replacement of plain text
with different plain text using a keyboard, IME, speech,
or similar method, the inputType MUST be
<b>replaceText</b>.

<ol>
<li>Set the value of data to be the plain text
Expand All @@ -124,6 +126,25 @@ <h4>Interface InputEvent</h4>
</ol>
</li>

<li>If the user indicates replacement of existing
content that is more than just part of a text node OR
the user indicates replacement of plain text with new
content that consists of content that is more than just
text, structure of using a keyboard, IME, speech, or
similar method, the inputType MUST be
<b>replaceContent</b>.

<ol>
<li>Set the value of data to be a document
fragment containing the new content that is to
be inserted.</li>

<li>Set the value of targetRange to a new range
that covers the content that is to be
replaced.</li>
</ol>
</li>

<li>If the user is inserting a newline using a
keyboard, IME, speech, or similar method, the inputType
MUST be <b>insertNewline</b>
Expand Down

0 comments on commit 7698c9f

Please sign in to comment.