diff --git a/split/ui-events.bs b/split/ui-events.bs index d7a4fd9..b66cde1 100644 --- a/split/ui-events.bs +++ b/split/ui-events.bs @@ -534,731 +534,6 @@ with the following supplemental additions: <tr><td class="cell-number">4</td><td></td><td><em>All other <a>default actions</a>, including the <a>activation behavior</a></em></td></tr> </table> -<h2 id="legacy-mutationevent-events">Legacy {{MutationEvent}} events</h2> - - The mutation and mutation name event modules are designed to allow - notification of any changes to the structure of a document, including - attribute, text, or name modifications. - - <p class="note"> - None of the event types associated with the {{MutationEvent}} interface are - designated as cancelable. This stems from the fact that it is very difficult - to make use of existing DOM interfaces which cause document modifications if - any change to the document might or might not take place due to cancelation - of the resulting event. Although this is still a desired capability, it was - decided that it would be better left until the addition of transactions into - the DOM. - </p> - - Many single modifications of the tree can cause multiple mutation events to - be dispatched. Rather than attempt to specify the ordering of mutation - events due to every possible modification of the tree, the ordering of these - events is left to the implementation. - - <div class="warning"> - <p> - The {{MutationEvent}} interface was introduced in DOM Level 2 Events, but - has not yet been completely and interoperably implemented across <a>user - agents</a>. In addition, there have been critiques that the interface, as - designed, introduces a performance and implementation challenge. - </p> - <p> - DOM4 [[!DOM]] provides a new mechanism using a - <code>MutationObserver</code> interface which addresses the use cases that - mutation events solve, but in a more performant manner. Thus, this - specification describes mutation events for reference and completeness of - legacy behavior, but <a>deprecates</a> the use of the {{MutationEvent}} - interface. - </p> - </div> - - <h3 id="interface-mutationevent">Interface MutationEvent</h3> - - <p class="intro-dom">Introduced in DOM Level 2, deprecated in this - specification</p> - - The <code>MutationEvent</code> interface provides specific contextual - information associated with Mutation events. - - To create an instance of the <code>MutationEvent</code> interface, use - the {{Document/createEvent()}} method call. - - <pre class="idl"> - [Exposed=Window] - interface MutationEvent : Event { - // attrChangeType - const unsigned short MODIFICATION = 1; - const unsigned short ADDITION = 2; - const unsigned short REMOVAL = 3; - - readonly attribute Node? relatedNode; - readonly attribute DOMString prevValue; - readonly attribute DOMString newValue; - readonly attribute DOMString attrName; - readonly attribute unsigned short attrChange; - - undefined initMutationEvent(DOMString typeArg, - optional boolean bubblesArg = false, - optional boolean cancelableArg = false, - optional Node? relatedNodeArg = null, - optional DOMString prevValueArg = "", - optional DOMString newValueArg = "", - optional DOMString attrNameArg = "", - optional unsigned short attrChangeArg = 0); - }; - </pre> - - <dl dfn-for="MutationEvent" data-noexport> - <dt><dfn const>MODIFICATION</dfn></dt> - <dd> - The <code>Attr</code> was modified in place. - </dd> - - <dt><dfn const>ADDITION</dfn></dt> - <dd> - The <code>Attr</code> was just added. - </dd> - - <dt><dfn const>REMOVAL</dfn></dt> - <dd> - The <code>Attr</code> was just removed. - </dd> - - <dt><dfn attribute>relatedNode</dfn></dt> - <dd> - <code>relatedNode</code> MUST be used to identify a secondary - node related to a mutation event. For example, if a mutation - event is dispatched to a node indicating that its parent has - changed, the <code>relatedNode</code> will be the changed - parent. If an event is instead dispatched to a subtree - indicating a node was changed within it, the - <code>relatedNode</code> MUST be the changed node. In the case - of the <a><code>DOMAttrModified</code></a> event, it indicates the - <code>Attr</code> node which was modified, added, or removed. - - The <a>un-initialized value</a> of this attribute MUST be - <code>null</code>. - </dd> - - <dt><dfn attribute>prevValue</dfn></dt> - <dd> - <code>prevValue</code> indicates the previous value of the - <code>Attr</code> node in <a><code>DOMAttrModified</code></a> events, and of - the <code>CharacterData</code> node in - <a><code>DOMCharacterDataModified</code></a> events. - - The <a>un-initialized value</a> of this attribute MUST be - <code>""</code> (the empty string). - </dd> - - <dt><dfn attribute>newValue</dfn></dt> - <dd> - <code>newValue</code> indicates the new value of the - <code>Attr</code> node in <a><code>DOMAttrModified</code></a> events, and of - the <code>CharacterData</code> node in - <a><code>DOMCharacterDataModified</code></a> events. - - The <a>un-initialized value</a> of this attribute MUST be - <code>""</code> (the empty string). - </dd> - - <dt><dfn attribute>attrName</dfn></dt> - <dd> - <code>attrName</code> indicates the name of the changed - <code>Attr</code> node in a <a><code>DOMAttrModified</code></a> event. - - The <a>un-initialized value</a> of this attribute MUST be - <code>""</code> (the empty string). - </dd> - - <dt><dfn attribute>attrChange</dfn></dt> - <dd> - <code>attrChange</code> indicates the type of change which - triggered the <a><code>DOMAttrModified</code></a> event. The values can be - <code>MODIFICATION</code>, <code>ADDITION</code>, or - <code>REMOVAL</code>. - - The <a>un-initialized value</a> of this attribute MUST be - <code>0</code>. - - <p class="note"> - There is no defined constant for the attrChange value of 0 (the - un-initialized value). - </p> - </dd> - - <dt><dfn method>initMutationEvent(typeArg)</dfn></dt> - <dd> - Initializes attributes of a <code>MutationEvent</code> object. - This method has the same behavior as {{Event/initEvent()}}. - - <dl class="parameters"> - <dt>DOMString typeArg</dt> - <dd> - Refer to the {{Event/initEvent()}} method for a description of this parameter. - </dd> - - <dt>boolean bubblesArg</dt> - <dd> - Refer to the {{Event/initEvent()}} method for a description of this parameter. - </dd> - - <dt>boolean cancelableArg</dt> - <dd> - Refer to the {{Event/initEvent()}} method for a description of this parameter. - </dd> - - <dt>Node? relatedNodeArg</dt> - <dd> - Specifies {{MutationEvent}}.<code>relatedNode</code>. - </dd> - - <dt>DOMString prevValueArg</dt> - <dd> - Specifies {{MutationEvent}}.<code>prevValue</code>. This value MAY be the <a>empty string</a>. - </dd> - - <dt>DOMString newValueArg</dt> - <dd> - Specifies {{MutationEvent}}.<code>newValue</code>. - This value MAY be the <a>empty string</a>. - </dd> - - <dt>DOMString attrNameArg</dt> - <dd> - Specifies {{MutationEvent}}.<code>attrName</code>. - This value MAY be the <a>empty string</a>. - </dd> - - <dt>unsigned short attrChangeArg</dt> - <dd> - Specifies {{MutationEvent}}.<code>attrChange</code>. - This value MAY be <code>0</code>. - </dd> - </dl> - </dd> - </dl> - - <h3 id="legacy-mutationevent-event-types">Legacy {{MutationEvent}} event types</h3> - - The mutation event types are listed below. - - <h4 id="event-type-DOMAttrModified"><dfn>DOMAttrModified</dfn></h4> - - <table class="event-definition"> - <tr> - <th>Type</th> - <td><strong><code>DOMAttrModified</code></strong></td> - </tr> - <tr> - <th>Interface</th> - <td>{{MutationEvent}}</td> - </tr> - <tr> - <th>Sync / Async</th> - <td>Sync</td> - </tr> - <tr> - <th>Bubbles</th> - <td>Yes</td> - </tr> - <tr> - <th>Trusted Targets</th> - <td><code>Element</code></td> - </tr> - <tr> - <th>Cancelable</th> - <td>No</td> - </tr> - <tr> - <th>Composed</th> - <td>No</td> - </tr> - <tr> - <th>Default action</th> - <td>None</td> - </tr> - <tr> - <th>Context<br/>(trusted events)</th> - <td> - <ul> - <li>{{Event}}.{{Event/target}} : - element whose attribute is being modified</li> - <li>{{MutationEvent}}.<code>attrName</code> : - the name of the changed <code>Attr</code> node</li> - <li>{{MutationEvent}}.<code>attrChange</code> : - the numerical code corresponding to the most applicable <code>attrChangeType</code></li> - <li>{{MutationEvent}}.<code>relatedNode</code> : - the <code>Attr</code> node that has been modified, added, or removed.</li> - <li>{{MutationEvent}}.<code>newValue</code> : - new value of the attribute, if the <code>Attr</code> node has been added or modified</li> - <li>{{MutationEvent}}.<code>prevValue</code> : - previous value of the attribute, if the <code>Attr</code> node has been removed or modified</li> - </ul> - </td> - </tr> - </table> - - A <a>user agent</a> MUST dispatch this event after an - <code>Attr.value</code> has been modified and after an - <code>Attr</code> node has been added to or removed from an - <code>Element</code>. The <a>event target</a> of this event MUST be - the <code>Element</code> node where the change occurred. It is - implementation dependent whether this event type occurs when the - children of the <code>Attr</code> node are changed in ways that do - not affect the value of <code>Attr.value</code>. - - <p class="warning"> - The <a><code>DOMAttrModified</code></a> event type is defined in this - specification for reference and completeness, but this specification - <a>deprecates</a> the use of this event type. - </p> - - <h4 id="event-type-DOMCharacterDataModified"><dfn>DOMCharacterDataModified</dfn></h4> - - <table class="event-definition"> - <tr> - <th>Type</th> - <td><strong><code>DOMCharacterDataModified</code></strong></td> - </tr> - <tr> - <th>Interface</th> - <td>{{MutationEvent}}</td> - </tr> - <tr> - <th>Sync / Async</th> - <td>Sync</td> - </tr> - <tr> - <th>Bubbles</th> - <td>Yes</td> - </tr> - <tr> - <th>Trusted Targets</th> - <td><code>Text</code>, <code>Comment</code>, <code>ProcessingInstruction</code></td> - </tr> - <tr> - <th>Cancelable</th> - <td>No</td> - </tr> - <tr> - <th>Composed</th> - <td>No</td> - </tr> - <tr> - <th>Default action</th> - <td>None</td> - </tr> - <tr> - <th>Context<br/>(trusted events)</th> - <td> - <ul> - <li>{{Event}}.{{Event/target}} : - object whose content is being modified</li> - <li>{{MutationEvent}}.<code>attrName</code> : - the <a>empty string</a></li> - <li>{{MutationEvent}}.<code>attrChange</code> : - <code>0</code></li> - <li>{{MutationEvent}}.<code>relatedNode</code> : - parent node of the object whose content is being modified</li> - <li>{{MutationEvent}}.<code>newValue</code> : - new value of the object</li> - <li>{{MutationEvent}}.<code>prevValue</code> : - previous value of the object</li> - </ul> - </td> - </tr> - </table> - - A <a>user agent</a> MUST dispatch this event after - <code>CharacterData.data</code> or - <code>ProcessingInstruction.data</code> have been modified, but the - node itself has not been inserted or deleted. The <a>event - target</a> of this event MUST be the <code>CharacterData</code> node - or the <code>ProcessingInstruction</code> node. - - <p class="warning"> - The <a><code>DOMCharacterDataModified</code></a> event type is defined in this - specification for reference and completeness, but this specification - <a>deprecates</a> the use of this event type. - </p> - - <h4 id="event-type-DOMNodeInserted"><dfn>DOMNodeInserted</dfn></h4> - - <table class="event-definition"> - <tr> - <th>Type</th> - <td><strong><code>DOMNodeInserted</code></strong></td> - </tr> - <tr> - <th>Interface</th> - <td>{{MutationEvent}}</td> - </tr> - <tr> - <th>Sync / Async</th> - <td>Sync</td> - </tr> - <tr> - <th>Bubbles</th> - <td>Yes</td> - </tr> - <tr> - <th>Trusted Targets</th> - <td><code>Element</code>, <code>Attr</code>, <code>Text</code>, <code>Comment</code>, <code>DocumentType</code>, - <code>ProcessingInstruction</code></td> - </tr> - <tr> - <th>Cancelable</th> - <td>No</td> - </tr> - <tr> - <th>Composed</th> - <td>No</td> - </tr> - <tr> - <th>Default action</th> - <td>None</td> - </tr> - <tr> - <th>Context<br/>(trusted events)</th> - <td> - <ul> - <li>{{Event}}.{{Event/target}} : - element which is being inserted</li> - <li>{{MutationEvent}}.<code>attrName</code> : - the <a>empty string</a></li> - <li>{{MutationEvent}}.<code>attrChange</code> : - <code>0</code></li> - <li>{{MutationEvent}}.<code>relatedNode</code> : - parent node of the node that has been inserted, or the <code>ownerElement</code> in the case of <code>Attr</code> nodes</li> - <li>{{MutationEvent}}.<code>newValue</code> : - the <a>empty string</a></li> - <li>{{MutationEvent}}.<code>prevValue</code> : - the <a>empty string</a></li> - </ul> - </td> - </tr> - </table> - - A <a>user agent</a> MUST dispatch this event type when a node other - than an <code>Attr</code> node has been added as a child of another - node. A <a>user agent</a> MAY dispatch this event when an - <code>Attr</code> node has been added to an <code>Element</code> - node (see <a href="#DOMNodeInserted-attr">note</a> below). This - event MUST be dispatched after the insertion has taken place. The - <a>event target</a> of this event MUST be the node being inserted. - - <p class="note" id="DOMNodeInserted-attr"> - For detecting attribute insertion, use the <a><code>DOMAttrModified</code></a> - event type instead. - </p> - - <p class="warning"> - The <a><code>DOMNodeInserted</code></a> event type is defined in this - specification for reference and completeness, but this specification - <a>deprecates</a> the use of this event type. - </p> - - <h4 id="event-type-DOMNodeInsertedIntoDocument"><dfn>DOMNodeInsertedIntoDocument</dfn></h4> - - <table class="event-definition"> - <tr> - <th>Type</th> - <td><strong><code>DOMNodeInsertedIntoDocument</code></strong></td> - </tr> - <tr> - <th>Interface</th> - <td>{{MutationEvent}}</td> - </tr> - <tr> - <th>Sync / Async</th> - <td>Sync</td> - </tr> - <tr> - <th>Bubbles</th> - <td>No</td> - </tr> - <tr> - <th>Trusted Targets</th> - <td><code>Element</code>, <code>Attr</code>, <code>Text</code>, <code>Comment</code>, <code>DocumentType</code>, - <code>ProcessingInstruction</code></td> - </tr> - <tr> - <th>Cancelable</th> - <td>No</td> - </tr> - <tr> - <th>Composed</th> - <td>No</td> - </tr> - <tr> - <th>Default action</th> - <td>None</td> - </tr> - <tr> - <th>Context<br/>(trusted events)</th> - <td> - <ul> - <li>{{Event}}.{{Event/target}} : - element which is being inserted</li> - <li>{{MutationEvent}}.<code>attrName</code> : - the <a>empty string</a></li> - <li>{{MutationEvent}}.<code>attrChange</code> : - <code>0</code></li> - <li>{{MutationEvent}}.<code>relatedNode</code> : - parent node of the node that has been inserted, or the <code>ownerElement</code> in the case of <code>Attr</code> nodes</li> - <li>{{MutationEvent}}.<code>newValue</code> : - the <a>empty string</a></li> - <li>{{MutationEvent}}.<code>prevValue</code> : - the <a>empty string</a></li> - </ul> - </td> - </tr> - </table> - - A <a>user agent</a> MUST dispatch this event when a node has been - inserted into a document, either through direct insertion of the - node or insertion of a subtree in which it is contained. A <a>user - agent</a> MAY treat an <code>Attr</code> node as part of an - <code>Element</code>'s subtree. This event MUST be dispatched after - the insertion has taken place. The <a>event target</a> of this event - MUST be the node being inserted. If the node is being directly - inserted, the event type <a><code>DOMNodeInserted</code></a> MUST occur before - this event type. - - <p class="warning"> - The <a><code>DOMNodeInsertedIntoDocument</code></a> event type is defined in this - specification for reference and completeness, but this specification - <a>deprecates</a> the use of this event type. - </p> - - <h4 id="event-type-DOMNodeRemoved"><dfn>DOMNodeRemoved</dfn></h4> - - <table class="event-definition"> - <tr> - <th>Type</th> - <td><strong><code>DOMNodeRemoved</code></strong></td> - </tr> - <tr> - <th>Interface</th> - <td>{{MutationEvent}}</td> - </tr> - <tr> - <th>Sync / Async</th> - <td>Sync</td> - </tr> - <tr> - <th>Bubbles</th> - <td>Yes</td> - </tr> - <tr> - <th>Trusted Targets</th> - <td><code>Element</code>, <code>Attr</code>, <code>Text</code>, <code>Comment</code>, <code>DocumentType</code>, - <code>ProcessingInstruction</code></td> - </tr> - <tr> - <th>Cancelable</th> - <td>No</td> - </tr> - <tr> - <th>Composed</th> - <td>No</td> - </tr> - <tr> - <th>Default action</th> - <td>None</td> - </tr> - <tr> - <th>Context<br/>(trusted events)</th> - <td> - <ul> - <li>{{Event}}.{{Event/target}} : - element which is being removed</li> - <li>{{MutationEvent}}.<code>attrName</code> : - the <a>empty string</a></li> - <li>{{MutationEvent}}.<code>attrChange</code> : - <code>0</code></li> - <li>{{MutationEvent}}.<code>relatedNode</code> : - the parent node of the node being removed, or the <code>ownerElement</code> in the case of <code>Attr</code> nodes</li> - <li>{{MutationEvent}}.<code>newValue</code> : - the <a>empty string</a></li> - <li>{{MutationEvent}}.<code>prevValue</code> : - the <a>empty string</a></li> - </ul> - </td> - </tr> - </table> - - A <a>user agent</a> MUST dispatch this event when a node other than - an <code>Attr</code> node is being removed from its parent node. A - <a>user agent</a> MAY dispatch this event when an <code>Attr</code> - node is being removed from its <code>ownerElement</code> (see <a - href="#DOMNodeRemoved-attr">note</a> below). This event MUST be - dispatched before the removal takes place. The <a>event target</a> - of this event MUST be the node being removed. - - <p class="note" id="DOMNodeRemoved-attr"> - For reliably detecting attribute removal, use the - <a><code>DOMAttrModified</code></a> event type instead. - </p> - - <p class="warning"> - The <a><code>DOMNodeRemoved</code></a> event type is defined in this - specification for reference and completeness, but this specification - <a>deprecates</a> the use of this event type. - </p> - - <h4 id="event-type-DOMNodeRemovedFromDocument"><dfn>DOMNodeRemovedFromDocument</dfn></h4> - - <table class="event-definition"> - <tr> - <th>Type</th> - <td><strong><code>DOMNodeRemovedFromDocument</code></strong></td> - </tr> - <tr> - <th>Interface</th> - <td>{{MutationEvent}}</td> - </tr> - <tr> - <th>Sync / Async</th> - <td>Sync</td> - </tr> - <tr> - <th>Bubbles</th> - <td>No</td> - </tr> - <tr> - <th>Trusted Targets</th> - <td><code>Element</code>, <code>Attr</code>, <code>Text</code>, <code>Comment</code>, <code>DocumentType</code>, - <code>ProcessingInstruction</code></td> - </tr> - <tr> - <th>Cancelable</th> - <td>No</td> - </tr> - <tr> - <th>Composed</th> - <td>No</td> - </tr> - <tr> - <th>Default action</th> - <td>None</td> - </tr> - <tr> - <th>Context<br/>(trusted events)</th> - <td> - <ul> - <li>{{Event}}.{{Event/target}} : - element which is being removed</li> - <li>{{MutationEvent}}.<code>attrName</code> : - the <a>empty string</a></li> - <li>{{MutationEvent}}.<code>attrChange</code> : - <code>0</code></li> - <li>{{MutationEvent}}.<code>relatedNode</code> : - the parent node of the node being removed, or the <code>ownerElement</code> in the case of <code>Attr</code> nodes</li> - <li>{{MutationEvent}}.<code>newValue</code> : - the <a>empty string</a></li> - <li>{{MutationEvent}}.<code>prevValue</code> : - the <a>empty string</a></li> - </ul> - </td> - </tr> - </table> - - A <a>user agent</a> MUST dispatch this event when a node is being - removed from a document, either through direct removal of the node - or removal of a subtree in which it is contained. A <a>user - agent</a> MAY treat an <code>Attr</code> node as part of an - <code>Element</code>'s subtree. This event MUST be dispatched before - the removal takes place. The <a>event target</a> of this event type - MUST be the node being removed. If the node is being directly - removed, the event type <a><code>DOMNodeRemoved</code></a> MUST occur before this - event type. - - <p class="note"> - For reliably detecting attribute removal, use the - <a><code>DOMAttrModified</code></a> event type instead. - </p> - - <p class="warning"> - The <a><code>DOMNodeRemovedFromDocument</code></a> event type is defined in this - specification for reference and completeness, but this specification - <a>deprecates</a> the use of this event type. - </p> - - <h4 id="event-type-DOMSubtreeModified"><dfn>DOMSubtreeModified</dfn></h4> - - <table class="event-definition"> - <tr> - <th>Type</th> - <td><strong><code>DOMSubtreeModified</code></strong></td> - </tr> - <tr> - <th>Interface</th> - <td>{{MutationEvent}}</td> - </tr> - <tr> - <th>Sync / Async</th> - <td>Sync</td> - </tr> - <tr> - <th>Bubbles</th> - <td>Yes</td> - </tr> - <tr> - <th>Trusted Targets</th> - <td><a><code>Window</code></a>, <code>Document</code>, <code>DocumentFragment</code>, <code>Element</code>, <code>Attr</code> - </td> - </tr> - <tr> - <th>Cancelable</th> - <td>No</td> - </tr> - <tr> - <th>Composed</th> - <td>No</td> - </tr> - <tr> - <th>Default action</th> - <td>None</td> - </tr> - <tr> - <th>Context<br/>(trusted events)</th> - <td> - <ul> - <li>{{Event}}.{{Event/target}} : - parent node of subtree being modified</li> - <li>{{MutationEvent}}.<code>attrName</code> : - the <a>empty string</a></li> - <li>{{MutationEvent}}.<code>attrChange</code> : - <code>0</code></li> - <li>{{MutationEvent}}.<code>relatedNode</code> : - <code>null</code></li> - <li>{{MutationEvent}}.<code>newValue</code> : - the <a>empty string</a></li> - <li>{{MutationEvent}}.<code>prevValue</code> : - the <a>empty string</a></li> - </ul> - </td> - </tr> - </table> - - This is a general event for notification of all changes to the - document. It can be used instead of the more specific mutation and - mutation name events. It MAY be dispatched after a single - modification to the document or, at the implementation's discretion, - after multiple changes have occurred. The latter case SHOULD - generally be used to accommodate multiple changes which occur either - simultaneously or in rapid succession. The target of this event MUST - be the lowest common parent of the changes which have taken place. - This event MUST be dispatched after any other events caused by the - mutation(s) have occurred. - - <p class="warning"> - The <a><code>DOMSubtreeModified</code></a> event type is defined in this - specification for reference and completeness, but this specification - <a>deprecates</a> the use of this event type. - </p> <h2 id="legacy-event-initializers">Legacy Event Initializers</h2> @@ -1276,9 +551,9 @@ with the following supplemental additions: fully initialize an event. <div class="example"> - Initializing all the attributes of a MutationEvent requires calls to two + Initializing all the attributes of a UIEvent requires calls to two initializer methods: <code>initEvent</code> and - <code>initMutationEvent</code>. + <code>initUIEvent</code>. </div> Due in part to the length of time in the development of this standard, some