Skip to content

Commit

Permalink
Remove mutation event mentions
Browse files Browse the repository at this point in the history
Mutation events are not defined in detail anywhere (see whatwg/dom#305), but the standard mentioned them a few times to explain how HTML features should interact with them. As there has been some success in removing them from some browsers (see whatwg/dom#305 (comment)), we can now remove them, aligning HTML and DOM on no longer acknowledging their existence.
  • Loading branch information
mfreed7 authored Aug 26, 2024
1 parent 8325a4d commit 9a01ce8
Showing 1 changed file with 8 additions and 68 deletions.
76 changes: 8 additions & 68 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -9130,9 +9130,7 @@ interface <dfn interface>HTMLOptionsCollection</dfn> : <span>HTMLCollection</spa
<li><p>Let <var>n</var> be <var>value</var> &minus; <var>current</var>.</p></li>

<li><p>Append <var>n</var> new <code>option</code> elements with no attributes and no child
nodes to the <code>select</code> element on which <span>this</span> is rooted. Mutation events
must be fired as if a <code>DocumentFragment</code> containing the new <code>option</code>
elements had been inserted.</p></li>
nodes to the <code>select</code> element on which <span>this</span> is rooted.</p></li>
</ol>
</li>

Expand Down Expand Up @@ -10792,14 +10790,6 @@ partial interface <dfn id="document" data-lt="">Document</dfn> {
<p class="note">This is only populated for "<code data-x="">about:</code>"-schemed
<code>Document</code>s.</p>

<p>Each <code>Document</code> has a <dfn data-x="concept-document-fire-mutation-events-flag">fire
mutation events flag</dfn>, which is a boolean, initially true.</p>

<p class="note">This is intended to suppress firing of DOM Mutation Events in cases when they
would normally fire. The specification describing mutation events is not actively maintained so
it does not look at this flag, but implementations are expected to act as though it did.
<ref>UIEVENTS</ref></p>

<p>Each <code>Document</code> has a <dfn
data-x="concept-document-bfcache-blocking-details">bfcache blocking details</dfn>, which is a
<span>set</span> of <span data-x="nrr-details-struct">not restored reason details</span>,
Expand Down Expand Up @@ -14606,13 +14596,7 @@ interface <dfn interface>DOMStringMap</dfn> {
data-x="concept-cd-data">data</span>'s <span>length</span>, 0, and <var>next</var>'s <span
data-x="concept-cd-data">data</span>.</p></li>

<li>
<p>If <var>next</var>'s parent is non-null, then <span
data-x="concept-node-remove">remove</span> <var>next</var>.</p>

<p class="note">The parent check is necessary as the previous step might have triggered mutation
events.</p>
</li>
<li><p><span data-x="concept-node-remove">Remove</span> <var>next</var>.</p></li>
</ol>

</div>
Expand Down Expand Up @@ -60670,14 +60654,6 @@ interface <dfn interface>HTMLDetailsElement</dfn> : <span>HTMLElement</span> {
attribute, or its <code data-x="attr-details-name">name</code> attribute is the empty string,
then return.</p></li>

<li><p>Let <var>document</var> be <var>element</var>'s <span>node document</span>.</p></li>

<li><p>Let <var>oldFlag</var> be the value of <var>document</var>'s <span
data-x="concept-document-fire-mutation-events-flag">fire mutation events flag</span>.</p></li>

<li><p>Set <var>document</var>'s <span data-x="concept-document-fire-mutation-events-flag">fire
mutation events flag</span> to false.</p></li>

<li><p>Let <var>groupMembers</var> be a list of elements, containing all elements in
<var>element</var>'s <span>details name group</span> except for <var>element</var>, in <span>tree
order</span>.</p></li>
Expand All @@ -60702,9 +60678,6 @@ interface <dfn interface>HTMLDetailsElement</dfn> : <span>HTMLElement</span> {
</ol>
</ol>
</li>

<li><p>Set <var>document</var>'s <span data-x="concept-document-fire-mutation-events-flag">fire
mutation events flag</span> to <var>oldFlag</var>.</p></li>
</ol>

<p>To <dfn>ensure details exclusivity by closing the given element if needed</dfn> given a
Expand All @@ -60719,14 +60692,6 @@ interface <dfn interface>HTMLDetailsElement</dfn> : <span>HTMLElement</span> {
attribute, or its <code data-x="attr-details-name">name</code> attribute is the empty string,
then return.</p></li>

<li><p>Let <var>document</var> be <var>element</var>'s <span>node document</span>.</p></li>

<li><p>Let <var>oldFlag</var> be the value of <var>document</var>'s <span
data-x="concept-document-fire-mutation-events-flag">fire mutation events flag</span>.</p></li>

<li><p>Set <var>document</var>'s <span data-x="concept-document-fire-mutation-events-flag">fire
mutation events flag</span> to false.</p></li>

<li><p>Let <var>groupMembers</var> be a list of elements, containing all elements in
<var>element</var>'s <span>details name group</span> except for <var>element</var>, in <span>tree
order</span>.</p></li>
Expand All @@ -60749,9 +60714,6 @@ interface <dfn interface>HTMLDetailsElement</dfn> : <span>HTMLElement</span> {
</li>
</ol>
</li>

<li><p>Set <var>document</var>'s <span data-x="concept-document-fire-mutation-events-flag">fire
mutation events flag</span> to <var>oldFlag</var>.</p></li>
</ol>

<p>The <dfn attribute for="HTMLDetailsElement"><code data-x="dom-details-name">name</code></dfn>
Expand Down Expand Up @@ -112497,18 +112459,9 @@ document.body.appendChild(frame)</code></pre>
<span>erase all event listeners and handlers</span> given <var>document</var>'s <span>relevant
global object</span>.</p></li>

<li>Let <var>oldFlag</var> be the value of <var>document</var>'s <span
data-x="concept-document-fire-mutation-events-flag">fire mutation events flag</span>.</li>

<li>Set <var>document</var>'s <span data-x="concept-document-fire-mutation-events-flag">fire
mutation events flag</span> to false.</li>

<li><p><span data-x="concept-node-replace-all">Replace all</span> with null within
<var>document</var>.</p></li>

<li>Set <var>document</var>'s <span data-x="concept-document-fire-mutation-events-flag">fire
mutation events flag</span> to <var>oldFlag</var>.</li>

<li>
<p>If <var>document</var> is <span>fully active</span>, then:</p>

Expand Down Expand Up @@ -127814,18 +127767,6 @@ document.body.appendChild(text);
location</var>.</p></li>
</ol>

<hr>

<p id="mutation-during-parsing">DOM mutation events must not fire for changes caused by the UA
parsing the document. This includes the parsing of any content inserted using <code
data-x="dom-document-write">document.write()</code> and <code
data-x="dom-document-writeln">document.writeln()</code> calls. <ref>UIEVENTS</ref></p>

<p>However, <span>mutation observers</span> <em>do</em> fire, as required by <cite>DOM</cite>
.</p>



<h5>Parsing elements that contain only text</h5>

<p>The <dfn>generic raw text element parsing algorithm</dfn> and the <dfn>generic RCDATA element
Expand Down Expand Up @@ -132815,13 +132756,12 @@ console.assert(container.firstChild instanceof SuperP);
proper <span data-x="element interface">element interfaces</span> are created and that <span
data-x="custom element">custom elements</span> are set up correctly.</p>

<p>DOM mutation events must not fire for the operations that the <span>XML parser</span> performs
on the <code>Document</code>'s tree, but the user agent must act as if elements and attributes
were individually appended and set respectively so as to trigger rules in this specification
regarding what happens when an element is inserted into a document or has its attributes set, and
<cite>DOM</cite>'s requirements regarding <span>mutation observers</span> mean that
mutation observers <em>are</em> fired (unlike mutation events). <ref>XML</ref> <ref>XMLNS</ref>
<ref>DOM</ref> <ref>UIEVENTS</ref></p>
<p>For the operations that the <span>XML parser</span> performs on the <code>Document</code>'s
tree, the user agent must act as if elements and attributes were individually appended and set
respectively so as to trigger rules in this specification regarding what happens when an element
is inserted into a document or has its attributes set, and <cite>DOM</cite>'s requirements
regarding <span>mutation observers</span> mean that mutation observers <em>are</em> fired.
<ref>XML</ref> <ref>XMLNS</ref> <ref>DOM</ref> <ref>UIEVENTS</ref></p>

<p>Between the time an element's start tag is parsed and the time either the element's end tag is
parsed or the parser detects a well-formedness error, the user agent must act as if the element
Expand Down

0 comments on commit 9a01ce8

Please sign in to comment.