From 9a01ce8f3da491b2318f496126497eb0d9861c90 Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Sun, 25 Aug 2024 20:00:22 -0700 Subject: [PATCH] Remove mutation event mentions Mutation events are not defined in detail anywhere (see https://github.com/whatwg/dom/issues/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 https://github.com/whatwg/dom/issues/305#issuecomment-2302407051), we can now remove them, aligning HTML and DOM on no longer acknowledging their existence. --- source | 76 +++++++--------------------------------------------------- 1 file changed, 8 insertions(+), 68 deletions(-) diff --git a/source b/source index f0bea4e43eb..6cce41c8b7f 100644 --- a/source +++ b/source @@ -9130,9 +9130,7 @@ interface HTMLOptionsCollection : HTMLCollection

Let n be valuecurrent.

  • Append n new option elements with no attributes and no child - nodes to the select element on which this is rooted. Mutation events - must be fired as if a DocumentFragment containing the new option - elements had been inserted.

  • + nodes to the select element on which this is rooted.

    @@ -10792,14 +10790,6 @@ partial interface Document {

    This is only populated for "about:"-schemed Documents.

    -

    Each Document has a fire - mutation events flag, which is a boolean, initially true.

    - -

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

    -

    Each Document has a bfcache blocking details, which is a set of not restored reason details, @@ -14606,13 +14596,7 @@ interface DOMStringMap { data-x="concept-cd-data">data's length, 0, and next's data.

    -
  • -

    If next's parent is non-null, then remove next.

    - -

    The parent check is necessary as the previous step might have triggered mutation - events.

    -
  • +
  • Remove next.

  • @@ -60670,14 +60654,6 @@ interface HTMLDetailsElement : HTMLElement { attribute, or its name attribute is the empty string, then return.

    -
  • Let document be element's node document.

  • - -
  • Let oldFlag be the value of document's fire mutation events flag.

  • - -
  • Set document's fire - mutation events flag to false.

  • -
  • Let groupMembers be a list of elements, containing all elements in element's details name group except for element, in tree order.

  • @@ -60702,9 +60678,6 @@ interface HTMLDetailsElement : HTMLElement { - -
  • Set document's fire - mutation events flag to oldFlag.

  • To ensure details exclusivity by closing the given element if needed given a @@ -60719,14 +60692,6 @@ interface HTMLDetailsElement : HTMLElement { attribute, or its name attribute is the empty string, then return.

    -
  • Let document be element's node document.

  • - -
  • Let oldFlag be the value of document's fire mutation events flag.

  • - -
  • Set document's fire - mutation events flag to false.

  • -
  • Let groupMembers be a list of elements, containing all elements in element's details name group except for element, in tree order.

  • @@ -60749,9 +60714,6 @@ interface HTMLDetailsElement : HTMLElement { - -
  • Set document's fire - mutation events flag to oldFlag.

  • The name @@ -112497,18 +112459,9 @@ document.body.appendChild(frame) erase all event listeners and handlers given document's relevant global object.

    -
  • Let oldFlag be the value of document's fire mutation events flag.
  • - -
  • Set document's fire - mutation events flag to false.
  • -
  • Replace all with null within document.

  • -
  • Set document's fire - mutation events flag to oldFlag.
  • -
  • If document is fully active, then:

    @@ -127814,18 +127767,6 @@ document.body.appendChild(text); location.

  • -
    - -

    DOM mutation events must not fire for changes caused by the UA - parsing the document. This includes the parsing of any content inserted using document.write() and document.writeln() calls. UIEVENTS

    - -

    However, mutation observers do fire, as required by DOM - .

    - - -
    Parsing elements that contain only text

    The generic raw text element parsing algorithm and the generic RCDATA element @@ -132815,13 +132756,12 @@ console.assert(container.firstChild instanceof SuperP); proper element interfaces are created and that custom elements are set up correctly.

    -

    DOM mutation events must not fire for the operations that the XML parser performs - on the Document'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 - DOM's requirements regarding mutation observers mean that - mutation observers are fired (unlike mutation events). XML XMLNS - DOM UIEVENTS

    +

    For the operations that the XML parser performs on the Document'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 DOM's requirements + regarding mutation observers mean that mutation observers are fired. + XML XMLNS DOM UIEVENTS

    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