Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove mutation events from the spec #10573

Merged
merged 2 commits into from
Aug 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 8 additions & 60 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 @@ -60672,12 +60656,6 @@ interface <dfn interface>HTMLDetailsElement</dfn> : <span>HTMLElement</span> {

<li><p>Let <var>document</var> be <var>element</var>'s <span>node document</span>.</p></li>
mfreed7 marked this conversation as resolved.
Show resolved Hide resolved

<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 +60680,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 @@ -60721,12 +60696,6 @@ interface <dfn interface>HTMLDetailsElement</dfn> : <span>HTMLElement</span> {

<li><p>Let <var>document</var> be <var>element</var>'s <span>node document</span>.</p></li>
mfreed7 marked this conversation as resolved.
Show resolved Hide resolved

<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 +60718,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 +112463,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 @@ -127816,14 +127773,6 @@ document.body.appendChild(text);

<hr>
mfreed7 marked this conversation as resolved.
Show resolved Hide resolved

<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>



Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it removes too many newlines, but maybe it makes it more consistent?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's kind of why I removed those - they seemed extra. I can put them back if you tell me how many blank lines would be correct?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One day we will have automatic formatting for newlines before headings, but until we do, the document is very inconsistent, so I'm OK to merge without fixing this.

<h5>Parsing elements that contain only text</h5>
Expand Down Expand Up @@ -132815,13 +132764,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