Skip to content

Commit

Permalink
Replace attachedElements() issue with note on lifetime (#65)
Browse files Browse the repository at this point in the history
At TPAC the Editing WG [resolved](#59 (comment)) that `attachedElements()` should continue returning elements that are not connected.

So, delete the Issue in the spec about this and add a note that EditContext will keep its associated element alive.

Closes #59.
  • Loading branch information
dandclark committed Sep 18, 2023
1 parent 9b47961 commit d2c0066
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ <h4>Association and activation</h4>
the {{EditContext}} to the element's {{HTMLElement/editContext}} property.
An {{HTMLElement}} can be <a data-lt="associated element">associated</a> with at most one {{EditContext}}.
</p>
<p class="note">
An {{EditContext}} keeps its [=associated element=] alive, so developers
should be aware that assigning an {{EditContext}} to an element's
{{HTMLElement/editContext}} property will prevent the element from being garbage
collected until the property is cleared or the {{EditContext}} is garbage collected.
</p>
</p>
<p>
If an {{EditContext}}'s <a>associated element</a>'s parent is not
<a href="https://w3c.github.io/editing/docs/execCommand/#editable">editable</a>,
Expand Down Expand Up @@ -1073,9 +1080,6 @@ <h3 id="editcontext-interface">EditContext Interface</h3>
<p class="note">
This method returns a list instead of a single element for forward compatibility if {{EditContext}} is ever granted the ability to have multiple <a>associated elements</a>.
</p>
<p class="issue">
Should attachedElements() return elements that are removed from the tree? If yes, the EditContext will keep removed elements alive. If not, we probably shouldn't allow a disconnected element to <a data-lt="associated element">associate</a> with EditContext, otherwise, it would be confusing/unintuitive that we allow it but attachedElements returns empty.
</p>

<dt>ontextupdate</dt>
<dd><p>The event handler for {{TextUpdateEvent}}.</p></dd>
Expand Down

0 comments on commit d2c0066

Please sign in to comment.