[w3c/editing] The timing of "deactivate an EditContext" when `HTMLElement.editContext` is replaced with another one or `null` (Issue #451)

https://w3c.github.io/edit-context/#extensions-to-the-htmlelement-interface

In the list:
> 4. If oldEditContext is not null, then:
> 4.1 [Assert](https://infra.spec.whatwg.org/#assert): oldEditContext's [associated element](https://w3c.github.io/edit-context/#dfn-associated-element) is equal to [this](https://webidl.spec.whatwg.org/#this).
> 4.2 Set oldEditContext's [associated element](https://w3c.github.io/edit-context/#dfn-associated-element) to null.
> 5. Set [this](https://webidl.spec.whatwg.org/#this)'s internal [[EditContext]] slot to be editContext.
> 6. If oldEditContext is not null and oldEditContext is [this](https://webidl.spec.whatwg.org/#this)'s [node document](https://dom.spec.whatwg.org/#concept-node-document)'s [active EditContext](https://w3c.github.io/edit-context/#dfn-active-editcontext), then run the steps to [deactivate an EditContext](https://w3c.github.io/edit-context/#dfn-deactivate-an-editcontext) with oldEditContext.

I think that the Step.6 should be between Step 4.1 and 4.2 because it's odd and may be error prune if it happens **after** disassociated from an element.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/editing/issues/451
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/editing/issues/451@github.com>

Received on Friday, 13 October 2023 06:07:05 UTC