Skip to content

Commit

Permalink
Update Activation and Deactivation behaviors (w3c#61)
Browse files Browse the repository at this point in the history
Currently the `activate/deactivate the EditContext` steps are empty stubs.

"Activating" an EditContext doesn't need to do anything, so remove that one.

Deactivating an EditContext should stop composition for that EditContext and fire `compositionend` if there was a composition.

Note, there's a bug where we have no other mechanism to end an EditContext's composition. [Update the EditContext](https://w3c.github.io/edit-context/#update-the-editcontext) will be updated to handle those cases in a separate PR.
  • Loading branch information
dandclark committed Sep 13, 2023
1 parent b279901 commit 44e4e96
Showing 1 changed file with 10 additions and 24 deletions.
34 changes: 10 additions & 24 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -650,12 +650,11 @@ <h3>Extensions to the HTMLElement interface</h3>
</ol>
</li>
<li>Set [=this=]'s internal [[\EditContext]] slot to be |editContext|.</li>
<li>If |oldEditContext| is not null and |oldEditContext| is the [=this=]'s
<a href="https://dom.spec.whatwg.org/#concept-node-document">node document</a>'s [=active EditContext=], then:
<ol>
<li>Run the steps to [=deactivate an EditContext=] with |oldEditContext|.</li>
<li>If |editContext| is not null, run the steps to [=activate an EditContext=] with |editContext|.</li>
</ol>
<li>
If |oldEditContext| is not null and |oldEditContext| is [=this=]'s
<a href="https://dom.spec.whatwg.org/#concept-node-document">node document</a>'s
[=active EditContext=], then run the steps to [=deactivate an EditContext=]
with |oldEditContext|.
</li>
</ol>
</div><!-- algorithm -->
Expand Down Expand Up @@ -724,7 +723,6 @@ <h4><dfn>Update the Text Edit Context</dfn></h4>
<li>If |oldActiveEditContext| is not null, then run the steps to [=deactivate an EditContext=] given |oldActiveEditContext|.</li>
<li>If |newActiveEditContext| is not null, then:
<ol>
<li>Run the steps to [=activate an EditContext=] given |newActiveEditContext|.</li>
<li>Update the [=Text Edit Context=]'s [=text state=] to match the values in |editContext|'s [=text state=].</li>
</ol>
</li>
Expand Down Expand Up @@ -805,32 +803,20 @@ <h4><dfn>Dispatch character bounds update event</dfn></h4>
</ol>
</div><!-- algorithm -->

<h4><dfn>Activate an EditContext</dfn></h4>
<div class="algorithm">
<dl>
<dt>Input</dt>
<dd>|this| an {{EditContext}}</dd>
<dt>Output</dt>
<dd>None</dd>
</dl>
<ol>
<li>
<div class="note">Add details</div>
</li>
</ol>
</div><!-- algorithm -->

<h4><dfn>Deactivate an EditContext</dfn></h4>
<div class="algorithm">
<dl>
<dt>Input</dt>
<dd>|this| an {{EditContext}}</dd>
<dd>|editContext|, an {{EditContext}}</dd>
<dt>Output</dt>
<dd>None</dd>
</dl>
<ol>
<li>Set |editContext|'s [=is composing=] to false.</li>
<li>
<div class="note">Add details</div>
[=Fire an event=] named
<a href="https://w3c.github.io/uievents/#event-type-compositionstart">compositionend</a>
at |editContext| using {{CompositionEvent}}.
</li>
</ol>
</div><!-- algorithm -->
Expand Down

0 comments on commit 44e4e96

Please sign in to comment.