Skip to content

Commit

Permalink
Merge pull request #148 from w3c/146/grapheme-cluster
Browse files Browse the repository at this point in the history
make code point replacement normative, based on resolution on #146
  • Loading branch information
johanneswilm committed Dec 14, 2023
2 parents ddcc21a + 05269ac commit dfaf728
Showing 1 changed file with 12 additions and 26 deletions.
38 changes: 12 additions & 26 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1282,30 +1282,6 @@ <h5>
more complex elements or merge paragraphs if the caret is at the
end of a text node.
</div>
<div class="note" data-link-for="InputEvent">
<p>
<i>This note is not normative.</i>
</p>In some scripts on some platforms, backward deletion within a
text node with a collapsed selection will delete a single <a href=
"https://infra.spec.whatwg.org/#code-points">code point</a>
[[INFRA]] rather than an entire [=grapheme cluster=]. The <a>getTargetRanges()</a> method can be
used to find out how many <a href=
"https://infra.spec.whatwg.org/#code-points">code points</a>
[[INFRA]] the browser will remove by default if deleting within a
text node.
</div>
<div class="note" data-link-for="InputEvent">
<p>
<i>This note is not normative.</i>
</p>In some scripts on some platforms, forward deletion within a
text node with a collapsed selection will delete an entire [=grapheme cluster=] rather than a single <a href=
"https://infra.spec.whatwg.org/#code-points">code point</a>
[[INFRA]]. The <a>getTargetRanges()</a> method can be used to find
out how many <a href=
"https://infra.spec.whatwg.org/#code-points">code points</a>
[[INFRA]] the browser will remove by default if deleting within a
text node.
</div>
<p>
<dfn><code>data</code></dfn> holds information plaintext data
related to what is to be added to the document.
Expand Down Expand Up @@ -1522,9 +1498,19 @@ <h5>
</table>
<p>
<dfn data-dfn-for="InputEvent" data-lt="targetRange">getTargetRanges()</dfn> returns an
arrays <a>StaticRanges</a> that will be affected by the event if it
is not cancelled.
arrays <a>StaticRanges</a> representing the text that the event will modify if it is not canceled.
The returned <a>StaticRanges</a> MUST cover only the <a href=“https://infra.spec.whatwg.org/#code-points”>code points</a>
[[INFRA]] that the browser would normally replace, even if they are only part of a [=grapheme cluster=].
</p>
<div class="note" data-link-for="InputEvent">
<p>
<i>This note is not normative.</i>
</p>
Depending on the script and the platform, deleting backward or forward in a text node with a collapsed selection may affect
a single <a href= “https://infra.spec.whatwg.org/#code-points”>code point</a> [[INFRA]] or a whole [=grapheme cluster=].
For example, deleting backward in a text node containing “café” may remove either the acute accent or the entire “é” character,
depending on the script and the platform.
</div>
</section><!-- interface-InputEvent-Attributes -->
<section id="interface-InputEvent-Methods" data-dfn-for="InputEvent">
<h5>
Expand Down

0 comments on commit dfaf728

Please sign in to comment.