Skip to content

Commit d98f84e

Browse files
authored
Updates deactivate timing for old EditContext (#117)
Move the "deactivate an EditContext" step earlier in the `HTMLElement.editContext` replacement algorithm so deactivation steps (e.g., compositionend) run while the EditContext is still associated with its element Closes #75 For normative changes, the following tasks have been completed: * [x] [Editing WG resolution](#75 (comment)) on the proposed changes, with at least two implementers participating and not objecting: * [x] WebKit * [x] Chromium * [x] Gecko * [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 1b12ed5 commit d98f84e

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

index.html

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -696,23 +696,27 @@ <h3>Extensions to the HTMLElement interface</h3>
696696
<ol>
697697
<li>If |editContext|'s <a>associated element</a> is equal to [=this=], then terminate these steps.</li>
698698
<li>If |editContext|'s <a>associated element</a> is not null, then [=exception/throw=] a {{"NotSupportedError"}} {{DOMException}}.</li>
699-
<li>Set |editContext|'s <a>associated element</a> to [=this=].</li>
700699
</ol>
701700
</li>
702701
<li>Let |oldEditContext| be the value of [=this=]'s internal [[\EditContext]] slot.</li>
703-
<li>If |oldEditContext| is not null, then:
704-
<ol>
705-
<li>[=Assert=]: |oldEditContext|'s <a>associated element</a> is equal to [=this=].</li>
706-
<li>Set |oldEditContext|'s <a>associated element</a> to null.</li>
707-
</ol>
708-
</li>
709-
<li>Set [=this=]'s internal [[\EditContext]] slot to be |editContext|.</li>
710702
<li>
711703
If |oldEditContext| is not null and |oldEditContext| is [=this=]'s
712704
<a href="https://dom.spec.whatwg.org/#concept-node-document">node document</a>'s
713-
[=active EditContext=], then run the steps to [=deactivate an EditContext=]
714-
with |oldEditContext|.
705+
[=active EditContext=], then:
706+
<ol>
707+
<li>Run the steps to [=deactivate an EditContext=] with |oldEditContext|.</li>
708+
<li>
709+
If |oldEditContext|'s <a>associated element</a> is not equal to [=this=], then terminate these steps.
710+
</li>
711+
<li>
712+
If |editContext| is not null, |editContext|'s <a>associated element</a> is not null and |editContext|'s
713+
<a>associated element</a> is not equal to [=this=], then [=exception/throw=] a {{"NotSupportedError"}} {{DOMException}}.
714+
</li>
715+
</ol>
715716
</li>
717+
<li>If |oldEditContext| is not null, set |oldEditContext|'s <a>associated element</a> to null.</li>
718+
<li>If |editContext| is not null, then set |editContext|'s <a>associated element</a> to [=this=].
719+
<li>Set [=this=]'s internal [[\EditContext]] slot to be |editContext|.</li>
716720
</ol>
717721
</div><!-- algorithm -->
718722
</dd>

0 commit comments

Comments
 (0)