Skip to content

Commit 1b12ed5

Browse files
authored
Add differences for composition events and canvas element (#116)
- Clarify that composition events are not fired on the editing host (they're fired on the EditContext instead). - Clarify that when the editing host is a `<canvas>`, the UA can't handle selection/caret navigation/spelling and grammar checking. <!-- Please fill in the sections below when making normative changes. Feel free to remove the sections when only making non-normative changes. --> This is not really a normative change of behavior, but rather clarifying behavior that the spec left unclear. Closes #72 Closes #86. * [x] For browsers that are shipping the feature, implementation bugs are filed for the proposed changes (link to bug, or write "Not Implementing"): * [x] WebKit (WebKit/standards-positions#243) * [x] Chromium (https://issues.chromium.org/issues/40642681) * [x] Gecko (mozilla/standards-positions#199)
1 parent 3dedc6e commit 1b12ed5

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

index.html

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,8 @@ <h4 id="edit-context-differences">Differences for an EditContext editing host</h
234234
Each child node of the <a>EditContext editing host</a> becomes <a href="https://w3c.github.io/editing/docs/execCommand/#editable">editable</a>,
235235
unless that node has a [^html-global/contenteditable^] attribute set to "<code>false</code>".
236236
</li>
237-
<li>The user agent handles focus and caret navigation for any editable element in the <a>EditContext editing host</a>.</li>
237+
<li>The user agent handles focus and caret navigation for any editable element in the <a>EditContext editing host</a> (except when the
238+
[=associated element=] is a [=canvas=]; see below in this section).</li>
238239
<li>
239240
The <a>EditContext editing host</a> receives key events and the <a href="https://www.w3.org/TR/uievents/#event-type-beforeinput">beforeinput</a>
240241
event as specified in [[uievents]].
@@ -257,6 +258,28 @@ <h4 id="edit-context-differences">Differences for an EditContext editing host</h
257258
against the <a>EditContext editing host</a> as a direct result of user action
258259
event as specified in [[uievents]].
259260
</li>
261+
<li>
262+
When the {{Document}} being edited has an [=active EditContext=], the user agent must not fire
263+
<a href="https://www.w3.org/TR/uievents/#events-compositionevents">composition events</a> against the
264+
<a>EditContext editing host</a> as a direct result of user action. Instead they will be fired against the {{EditContext}} as part
265+
of [=update the EditContext|updating the EditContext=] or [=deactivate an EditContext|deactivating the EditContext=].
266+
</li>
267+
<li>
268+
<p>
269+
When the [=active EditContext=]'s [=associated element=] is a [=canvas=], there are further differences:
270+
</p>
271+
<ul>
272+
<li>
273+
The user agent is unable to handle caret navigation and selection since it doesn't have information
274+
about how text is laid out in the [=canvas=], so the author has to implement caret navigation and selection.
275+
</li>
276+
<li>
277+
The user agent is unable to present inline spelling and grammar suggestions since it doesn't have information
278+
about how the text is laid out in the [=canvas=], so if the author wants to support spelling and grammar suggestions,
279+
they have to implement that themselves.
280+
</li>
281+
</ul>
282+
</li>
260283
</ul>
261284
</div>
262285

0 commit comments

Comments
 (0)