diff --git a/README.md b/README.md index caa297f87..a6c9fd64b 100644 --- a/README.md +++ b/README.md @@ -18,11 +18,71 @@ started, leave a comment on the issue or ask around [on IRC](https://wiki.whatwg ### Pull requests -See the [whatwg/html README](https://github.com/whatwg/html/blob/master/README.md) for the general -guidelines. Note that `source` is `dom.bs` and "Acknowledgements" is "Acknowledgments" here (I -know). Also, the DOM Standard uses [bikeshed](https://github.com/tabatkins/bikeshed) to generate -`dom.html`. (Do not worry if using that tool is too complicated, your pull request does not need to -contain the generated HTML.) +In short, change `dom.bs` and submit your patch, with a +[good commit message](https://github.com/erlang/otp/wiki/Writing-good-commit-messages). Consider +reading through the [WHATWG FAQ](https://wiki.whatwg.org/wiki/FAQ) if you are new here. + +Please add your name to the Acknowledgments section in your first pull request, even for trivial +fixes. The names are sorted lexicographically. + +To generate `dom.html`, [bikeshed](https://github.com/tabatkins/bikeshed) can be used. (Do not worry +if using that tool is too complicated, your pull request does not need to contain the generated HTML +to be accepted.) + +#### Formatting + +Use a column width of 100 characters. + +Do not use newlines inside "inline" elements, even if that means exceeding the column width +requirement. +```html +<p>The +<dfn method for=DOMTokenList lt=remove(tokens)|remove()><code>remove(<var>tokens</var>…)</code></dfn> +method, when invoked, must run these steps: +``` +is okay and + ```html +<p>The <dfn method for=DOMTokenList +lt=remove(tokens)|remove()><code>remove(<var>tokens</var>…)</code></dfn> method, when +invoked, must run these steps: +``` +is not. + +Using newlines between "inline" element tag names and their content is also forbidden. (This +actually alters the content, by adding spaces.) That is +```html +<a>token</a> +``` +is fine and +```html +<a>token +</a> +``` +is not. + +An `<li>` element always has a `<p>` element inside it, unless it's a child of `<ul class=brief>`. + +If a "block" element contains a single "block" element, do not put it on a newline. + +Do not indent for anything except a new "block" element. For instance +```html + <li><p>For each <var>token</var> in <var>tokens</var>, in given order, that is not in + <a>tokens</a>, append <var>token</var> to <a>tokens</a>. +``` +is not indented, but +```html +<ol> + <li> + <p>For each <var>token</var> in <var>tokens</var>, run these substeps: + + <ol> + <li><p>If <var>token</var> is the empty string, <a>throw</a> a {{SyntaxError}} exception. +``` +is. + +End tags may be included (if done consistently) and attributes may be quoted (using double quotes), +though the prevelant theme is to omit end tags and not quote attributes (unless they contain a +space). ### Tests diff --git a/dom.bs b/dom.bs index aca5d6b6b..cf7692b48 100644 --- a/dom.bs +++ b/dom.bs @@ -9,6 +9,7 @@ No Editor: true !Participate: <a href=https://wiki.whatwg.org/wiki/IRC>IRC: #whatwg on Freenode</a> !Commits: <a href=https://github.com/whatwg/dom/commits>GitHub whatwg/dom/commits</a> !Commits: <a href=https://twitter.com/thedomstandard>@thedomstandard</a> +!Translation (non-normative): <span title=Japanese><a href=https://triple-underscore.github.io/DOM4-ja.html lang=ja hreflang=ja rel=alternate>日本語</a></span> Logo: https://resources.whatwg.org/logo-dom.svg Abstract: DOM defines a platform-neutral model for events and node trees. Ignored Terms: EmptyString, Array, Document @@ -49,19 +50,6 @@ urlPrefix: https://heycam.github.io/webidl/ text: supported property indices text: supported property names text: code unit - type: exception - text: HierarchyRequestError - text: IndexSizeError - text: InUseAttributeError - text: InvalidCharacterError - text: InvalidNodeTypeError - text: InvalidStateError - text: NamespaceError - text: NotFoundError - text: NotSupportedError - text: SyntaxError - text: WrongDocumentError - text: DOMException; urlPrefix: #dfn- type: interface; text: DOMTimeStamp; urlPrefix: #common- urlPrefix: https://html.spec.whatwg.org/multipage/ @@ -96,22 +84,8 @@ urlPrefix: https://slightlyoff.github.io/ServiceWorker/spec/service_worker/# text: service worker text: script resource text: has ever been evaluated flag -urlPrefix: https://rawgit.com/w3c/webcomponents/15a203c8393aef0df7223ab1d43406aa11a7e71e/spec/custom/index.html# - type: selector; url: dfn-defined; text: :defined - type: dfn; urlPrefix: dfn- - text: look up a custom element definition; url: look-up-custom-element-definition - text: type extension - text: name; url: element-definition-name; for: custom element definition - text: local name; url: element-definition-local-name; for: custom element definition - text: constructor; url: element-definition-constructor; for: custom element definition - text: upgrade an element; url: upgrade-a-custom-element - text: enqueue a custom element upgrade reaction; url: enqueue-upgrade - text: enqueue a custom element callback reaction; url: enqueue-lifecycle-callback - text: valid custom element name - text: try to upgrade an element; url: try-upgrade urlPrefix: https://tc39.github.io/ecma262/#; spec: ECMASCRIPT text: Construct; url: sec-construct; type: abstract-op - text: TypeError; url: sec-native-error-types-used-in-this-standard-typeerror; type: exception </pre> <pre class='link-defaults'> @@ -234,7 +208,7 @@ A <dfn export id=concept-tree>tree</dfn> is a finite hierarchical tree structure traversal of a <a>tree</a>. <!-- https://en.wikipedia.org/wiki/Depth-first_search --> -An object that <dfn export for=tree id=concept-tree-participate lt="participate">participates</dfn> in +An object that <dfn export for=tree id=concept-tree-participate lt="participate|participate in a tree|participates in a tree">participates</dfn> in a <a>tree</a> has a <dfn export for=tree id=concept-tree-parent>parent</dfn>, which is either another object or null, and an ordered list of zero or more @@ -443,6 +417,9 @@ added. The <dfn export>HTML namespace</dfn> is <code>http://www.w3.org/1999/xhtml</code>. +The <dfn export>SVG namespace</dfn> is +<code>http://www.w3.org/2000/svg</code>. + The <dfn export>XML namespace</dfn> is <code>http://www.w3.org/XML/1998/namespace</code>. @@ -452,13 +429,11 @@ The <dfn export>XMLNS namespace</dfn> is To <dfn export>validate</dfn> a <var>qualifiedName</var>, run these steps: <ol> - <li>If <var>qualifiedName</var> does not match the - <code><a type>Name</a></code> production, <a>throw</a> - an {{InvalidCharacterError}} exception. + <li><p>If <var>qualifiedName</var> does not match the <code><a type>Name</a></code> production, + then <a>throw</a> an {{InvalidCharacterError}}. - <li>If <var>qualifiedName</var> does not match the - <code><a type>QName</a></code> production, - <a>throw</a> a {{NamespaceError}} exception. + <li><p>If <var>qualifiedName</var> does not match the <code><a type>QName</a></code> production, + then <a>throw</a> a {{NamespaceError}}. </ol> To <dfn export>validate and extract</dfn> a <var>namespace</var> and <var>qualifiedName</var>, @@ -477,21 +452,19 @@ run these steps: string on it and set <var>prefix</var> to the part before and <var>localName</var> to the part after. - <li>If <var>prefix</var> is non-null and <var>namespace</var> is null, - <a>throw</a> a {{NamespaceError}} exception. + <li>If <var>prefix</var> is non-null and <var>namespace</var> is null, then <a>throw</a> a + {{NamespaceError}}. - <li>If <var>prefix</var> is "<code>xml</code>" and <var>namespace</var> is - not the <a>XML namespace</a>, <a>throw</a> a - {{NamespaceError}} exception. + <li>If <var>prefix</var> is "<code>xml</code>" and <var>namespace</var> is not the + <a>XML namespace</a>, then <a>throw</a> a {{NamespaceError}}. <li>If either <var>qualifiedName</var> or <var>prefix</var> is "<code>xmlns</code>" and <var>namespace</var> is not the - <a>XMLNS namespace</a>, <a>throw</a> a - {{NamespaceError}} exception. + <a>XMLNS namespace</a>, then <a>throw</a> a + {{NamespaceError}}. - <li>If <var>namespace</var> is the <a>XMLNS namespace</a> and neither - <var>qualifiedName</var> nor <var>prefix</var> is "<code>xmlns</code>", - <a>throw</a> a {{NamespaceError}} exception. + <li>If <var>namespace</var> is the <a>XMLNS namespace</a> and neither <var>qualifiedName</var> + nor <var>prefix</var> is "<code>xmlns</code>", then <a>throw</a> a {{NamespaceError}}. <li>Return <var>namespace</var>, <var>prefix</var>, and <var>localName</var>. </ol> @@ -722,7 +695,7 @@ inherits from the {{Event}} interface. <dt><code><var>event</var> . <a method for=Event lt="preventDefault()">preventDefault</a>()</code> <dd>If invoked when the {{Event/cancelable}} attribute value is true, and while executing a - listener for the <var>event</var> with {{EventListenerOptions/passive}} set to false, signals to + listener for the <var>event</var> with {{AddEventListenerOptions/passive}} set to false, signals to the operation that caused <var>event</var> to be <a>dispatched</a> that it needs to be canceled. <dt><code><var>event</var> . {{Event/defaultPrevented}}</code> @@ -832,6 +805,9 @@ initialized to the number of milliseconds that have passed since 00:00:00 UTC on 1 January 1970, ignoring leap seconds. <!-- leap seconds are ignored by JavaScript too --> +<p class=XXX>This is highly likely to change and already does not reflect implementations well. +Please see <a href=https://github.com/whatwg/dom/issues/23>dom #23</a> for more details. + <hr> To <dfn export for=Event id=concept-event-initialize>initialize</dfn> an @@ -966,7 +942,7 @@ for historical reasons. <pre class=idl> [Exposed=(Window,Worker)] interface EventTarget { - void addEventListener(DOMString type, EventListener? callback, optional (EventListenerOptions or boolean) options); + void addEventListener(DOMString type, EventListener? callback, optional (AddEventListenerOptions or boolean) options); void removeEventListener(DOMString type, EventListener? callback, optional (EventListenerOptions or boolean) options); boolean dispatchEvent(Event event); }; @@ -976,8 +952,12 @@ callback interface EventListener { }; dictionary EventListenerOptions { - boolean capture; - boolean passive; + boolean capture = false; +}; + +dictionary AddEventListenerOptions : EventListenerOptions { + boolean passive = false; + boolean once = false; }; </pre> @@ -996,6 +976,7 @@ when something has occurred. <li><b>callback</b> (an {{EventListener}}) <li><b>capture</b> (a boolean, initially false) <li><b>passive</b> (a boolean, initially false) + <li><b>once</b> (a boolean, initially false) <li><b>removed</b> (a boolean for bookkeeping purposes, initially false) </ul> @@ -1007,7 +988,7 @@ which takes an <a>event</a> <var>event</var>, and returns an {{EventTarget}} obj specified otherwise it returns null. <p class="note no-backref"><a>Nodes</a> and <a>documents</a> override the -<span>get the parent</span> algorithm. +<a>get the parent</a> algorithm. <dl class=domintro> <dt><code><var>target</var> . <a method lt="addEventListener()">addEventListener</a>(<var>type</var>, <var>callback</var> [, <var>options</var>])</code> @@ -1031,9 +1012,12 @@ specified otherwise it returns null. <b>callback</b> will not cancel the event by invoking {{preventDefault()}}. This is used to enable performance optimizations described in [[#observing-event-listeners]]. + When set to true, <var>options</var>'s <code>once</code> member indicates that the <b>callback</b> + will only be invoked once after which the event listener will be removed. + The <a>event listener</a> is appended to <var>target</var>'s list of <a>event listeners</a> and is - not appended if it is a duplicate, i.e., having the same <b>type</b>, <b>callback</b>, - <b>capture</b> and <b>passive</b> values. + not appended if it is a duplicate, i.e., having the same <b>type</b>, <b>callback</b>, and + <b>capture</b> values. <dt><code><var>target</var> . <a method lt="removeEventListener()">removeEventListener</a>(<var>type</var>, <var>callback</var> [, <var>options</var>])</code> <dd>Remove the <a>event listener</a> @@ -1048,20 +1032,33 @@ specified otherwise it returns null. {{Event/preventDefault()}} method was not invoked, and false otherwise. </dl> -<p>To <dfn export for=Event id=concept-flatten-options>flatten</dfn> <var>options</var> run these steps: +<p>To <dfn export for=Event id=concept-flatten-options>flatten</dfn> <var>options</var>, run these +steps: <ol> - <li><p>Let <var>capture</var> and <var>passive</var> be false. + <li><p>Let <var>capture</var> be false. <li><p>If <var>options</var> is a boolean, set <var>capture</var> to <var>options</var>. - <li><p>If <var>options</var> is a dictionary and <code>{{EventListenerOptions/capture}}</code> is - present in <var>options</var> with value true, then set <var>capture</var> to true. + <li><p>If <var>options</var> is a dictionary, then set <var>capture</var> to <var>options</var>'s + <code>{{EventListenerOptions/capture}}</code>. + + <li><p>Return <var>capture</var>. +</ol> + +<p>To <dfn export for=Event>flatten more</dfn><!-- sorry --> <var>options</var>, run these +steps: + +<ol> + <li><p>Let <var>capture</var> be the result of <a>flattening</a> <var>options</var>. - <li><p>If <var>options</var> is a dictionary and <code>{{EventListenerOptions/passive}}</code> is - present in <var>options</var> with value true, then set <var>passive</var> to true. + <li><p>Let <var>once</var> and <var>passive</var> be false. - <li><p>Return <var>capture</var> and <var>passive</var>. + <li><p>If <var>options</var> is a dictionary, then set <var>passive</var> to <var>options</var>'s + <code>{{AddEventListenerOptions/passive}}</code> and <var>once</var> to <var>options</var>'s + <code>{{AddEventListenerOptions/once}}</code>. + + <li><p>Return <var>capture</var>, <var>passive</var>, and <var>once</var>. </ol> <p>The @@ -1080,14 +1077,14 @@ method, when invoked, must run these steps: <li><p>If <var>callback</var> is null, terminate these steps. - <li><p>Let <var>capture</var> and <var>passive</var> be the result of <a>flattening</a> - <var>options</var>. + <li><p>Let <var>capture</var>, <var>passive</var>, and <var>once</var> be the result of + <a lt="flatten more">flattening more</a> <var>options</var>. - <li><p>Append an <a>event listener</a> to the associated list of <a>event listeners</a> with - <b>type</b> set to <var>type</var>, <b>callback</b> set to <var>callback</var>, <b>capture</b> - set to <var>capture</var>, and <b>passive</b> set to <var>passive</var> unless there already is an - <a>event listener</a> in that list with the same <b>type</b>, <b>callback</b>, <b>capture</b>, and - <b>passive</b>. + <li><p>If <a>context object</a>'s associated list of <a>event listener</a> does not contain an + <a>event listener</a> whose <b>type</b> is <var>type</var>, <b>callback</b> is <var>callback</var>, + and <b>capture</b> is <var>capture</var>, then append a new <a>event listener</a> to it, whose + <b>type</b> is <var>type</var>, <b>callback</b> is <var>callback</var>, <b>capture</b> is + <var>capture</var>, <b>passive</b> is <var>passive</var>, and <b>once</b> is <var>once</var>. </ol> <p>The @@ -1099,13 +1096,12 @@ method, when invoked, must, run these steps its associated <a>service worker</a>'s <a>script resource</a>'s <a>has ever been evaluated flag</a> is set, <a>throw</a> a <code>TypeError</code>. [[!SERVICE-WORKERS]] - <li><p>Let <var>capture</var> and <var>passive</var> be the result of <a>flattening</a> - <var>options</var>. + <li><p>Let <var>capture</var> be the result of <a>flattening</a> <var>options</var>. <li><p>If there is an <a>event listener</a> in the associated list of <a>event listeners</a> whose - <b>type</b> is <var>type</var>, <b>callback</b> is <var>callback</var>, <b>capture</b> is - <var>capture</var>, and <b>passive</b> is <var>passive</var> then set that <a>event listener</a>'s - <b>removed</b> to true and remove it from the associated list of <a>event listeners</a>. + <b>type</b> is <var>type</var>, <b>callback</b> is <var>callback</var>, and <b>capture</b> is + <var>capture</var>, then set that <a>event listener</a>'s <b>removed</b> to true and remove it from + the associated list of <a>event listeners</a>. </ol> <p>The <dfn method for=EventTarget><code>dispatchEvent(<var>event</var>)</code></dfn> method, when @@ -1113,7 +1109,7 @@ invoked, must run these steps: <ol> <li><p>If <var>event</var>'s <a>dispatch flag</a> is set, or if its <a>initialized flag</a> is not - set, <a>throw</a> an {{InvalidStateError}} exception. + set, then <a>throw</a> an {{InvalidStateError}}. <li><p>Initialize <var>event</var>'s {{Event/isTrusted}} attribute to false. @@ -1132,12 +1128,12 @@ requires observing <a>event listeners</a>. This can make the presence of listene that even empty listeners can have a dramatic performance impact on the behavior of the application. For example, touch and wheel events which can be used to block asynchronous scrolling. In some cases this problem can be mitigated by specifying the event to be {{Event/cancelable}} only when there is -at least one non-{{EventListenerOptions/passive}} listener. For example, -non-{{EventListenerOptions/passive}} {{TouchEvent}} listeners must block scrolling, but if all -listeners are {{EventListenerOptions/passive}} then scrolling can be allowed to start +at least one non-{{AddEventListenerOptions/passive}} listener. For example, +non-{{AddEventListenerOptions/passive}} {{TouchEvent}} listeners must block scrolling, but if all +listeners are {{AddEventListenerOptions/passive}} then scrolling can be allowed to start <a>in parallel</a> by making the {{TouchEvent}} uncancelable (so that calls to {{Event/preventDefault()}} are ignored). So code dispatching an event is able to observe the absence -of non-{{EventListenerOptions/passive}} listeners, and use that to clear the {{Event/cancelable}} +of non-{{AddEventListenerOptions/passive}} listeners, and use that to clear the {{Event/cancelable}} property of the event being dispatched. <p>Ideally, any new event APIs are defined such that they do not need this property (use @@ -1163,14 +1159,12 @@ for discussion). <li><p>Initialize <var>event</var>'s {{Event/eventPhase}} attribute to {{Event/CAPTURING_PHASE}}. - <li><p>For each <var>object</var> in <var>eventPath</var>, in reverse order, if <var>event</var>'s - <a>stop propagation flag</a> is unset and <var>object</var> is not <var>target</var>, <a>invoke</a> - <var>object</var> with <var>event</var>. + <li><p>For each <var>object</var> in <var>eventPath</var>, in reverse order, if <var>object</var> + is not <var>target</var>, <a>invoke</a> <var>object</var> with <var>event</var>. <li><p>Initialize <var>event</var>'s {{Event/eventPhase}} attribute to {{Event/AT_TARGET}}. - <li><p>If <var>event</var>'s <a>stop propagation flag</a> is unset, <a>invoke</a> <var>target</var> - with <var>event</var>. + <li><p><a>Invoke</a> <var>target</var> with <var>event</var>. <li> <p>If <var>event</var>'s {{Event/bubbles}} attribute value is true, run these substeps: @@ -1178,9 +1172,8 @@ for discussion). <ol> <li><p>Initialize <var>event</var>'s {{Event/eventPhase}} attribute to {{Event/BUBBLING_PHASE}}. - <li><p>For each <var>object</var> in <var>eventPath</var>, if <var>event</var>'s - <a>stop propagation flag</a> is unset and <var>object</var> is not <var>target</var>, - <a>invoke</a> <var>object</var> with <var>event</var>. + <li><p>For each <var>object</var> in <var>eventPath</var>, if <var>object</var> is not + <var>target</var>, <a>invoke</a> <var>object</var> with <var>event</var>. </ol> <li><p>Unset <var>event</var>'s <a>dispatch flag</a>. @@ -1196,6 +1189,8 @@ for discussion). <var>object</var> with <var>event</var>, run these steps: <ol> + <li><p>If <var>event</var>'s <a>stop propagation flag</a> is set, then terminate these steps. + <li><p>Let <var>listeners</var> be the empty list. <li> @@ -1267,10 +1262,14 @@ an <var>object</var> with <var>event</var>, run these steps: <li><p>Call <var>listener</var>'s <b>callback</b>'s {{EventListener/handleEvent()}}, with <var>event</var> as argument and <var>event</var>'s {{Event/currentTarget}} attribute value as - <a>callback this value</a>. If this throws any exception, <a>report the exception</a>. + <a>callback this value</a>. If this throws an exception, <a>report the exception</a>. <li><p>Unset <var>event</var>'s <a>in passive listener flag</a>. + <li><p>If <var>listener</var>'s <b>once</b> is true, then set <var>listener</var>'s + <b>removed</b> to true and remove it from <var>object</var>'s associated list of + <a>event listeners</a>. + <li><p>If <var>event</var>'s <a>stop immediate propagation flag</a> is set, return <var>found</var>. </ol> @@ -1480,33 +1479,84 @@ itself.</p> <p>A <a>shadow tree</a> contains zero or more <a for=/>elements</a> that are <dfn export id=concept-slot lt=slot>slots</dfn>.</p> -<p class="note">A <a>slot</a> can only be created through HTML's <code>slot</code> element.</p> -<!-- XXX HTML slot: use <{slot}> --> +<p class="note">A <a>slot</a> can only be created through HTML's <{slot}> element.</p> <p>A <a>slot</a> has an associated <dfn export for=slot>name</dfn> (a string). Unless stated otherwise it is the empty string.</p> +<p>Use these <a>attribute change steps</a> to update a <a>slot</a>'s <a for=slot>name</a>: + +<ol> + <li> + <p>If <var>element</var> is a <a>slot</a>, <var>localName</var> is <code>name</code>, and + <var>namespace</var> is null, then: + + <ol> + <li><p>If <var>value</var> is <var>oldValue</var>, then return. + + <li><p>If <var>value</var> is null and <var>oldValue</var> is the empty string, then return. + + <li><p>If <var>value</var> is the empty string and <var>oldValue</var> is null, then return. + + <li><p>If <var>value</var> is null or the empty string, then set <var>element</var>'s + <a for=slot>name</a> to the empty string. + + <li><p>Otherwise, set <var>element</var>'s <a for=slot>name</a> to <var>value</var>. + + <li><p>Run <a>assign slotables for a tree</a> with <var>element</var>'s <a>tree</a>. + </ol> +</ol> + <p class="note">The first <a>slot</a> in a <a>shadow tree</a>, in <a>tree order</a>, whose <a for=slot>name</a> is the empty string, is sometimes known as the "default slot".</p> +<p>A <a>slot</a> has an associated <dfn export for=slot>assigned nodes</dfn> (a list of +<a>slotables</a>). Unless stated otherwise it is empty.</p> + <h5 id=light-tree-slotables>Slotables</h5> <p>{{Element}} and {{Text}} <a>nodes</a> are <dfn export id=concept-slotable lt=slotable>slotables</dfn>.</p> -<p>A <a>slotable</a> has a <dfn for=slotable>get name</dfn> algorithm, which runs these steps:</p> +<p class="note">A <a>slot</a> can be a <a>slotable</a>. + +<p>A <a>slotable</a> has an associated <dfn export for=slotable>name</dfn> (a string). Unless stated +otherwise it is the empty string.</p> + +<p>Use these <a>attribute change steps</a> to update a <a>slotable</a>'s <a for=slotable>name</a>: <ol> - <li><p>If <a>context object</a> is a {{Text}} <a>node</a>, then return the empty string.</p></li> + <li> + <p>If <var>localName</var> is <code>slot</code> and <var>namespace</var> is null, then: + + <ol> + <li><p>If <var>value</var> is <var>oldValue</var>, then return. + + <li><p>If <var>value</var> is null and <var>oldValue</var> is the empty string, then return. + + <li><p>If <var>value</var> is the empty string and <var>oldValue</var> is null, then return. + + <li><p>If <var>value</var> is null or the empty string, then set <var>element</var>'s + <a for=slotable>name</a> to the empty string. - <li><p>Return the result of running <a>get an attribute value</a> given <a>context object</a> and - "<code>slot</code>".</p></li> + <li><p>Otherwise, set <var>element</var>'s <a for=slotable>name</a> to <var>value</var>. + + <li><p>If <var>element</var> is <a for=slotable>assigned</a>, then run <a>assign slotables</a> + for <var>element</var>'s <a for=slotable>assigned slot</a>. + + <li><p>Run <a>assign a slot</a> for <var>element</var>. + </ol> </ol> +<p>A <a>slotable</a> has an associated <dfn export for=slotable>assigned slot</dfn> (null or a +<a>slot</a>). Unless stated otherwise it is null. A <a>slotable</a> is +<dfn export for=slotable>assigned</dfn> if its <a>assigned slot</a> is non-null.</p> + <h5 id=finding-slots-and-slotables>Finding slots and slotables</h5> -<p>To <dfn>find a slot</dfn> for a given <a>slotable</a> <var>slotable</var> and an optional -<i>open flag</i> (unset unless stated otherwise), run these steps:</p> +<p>To <dfn export lt="find a slot|finding a slot">find a slot</dfn> for a given <a>slotable</a> +<var>slotable</var> and an optional <i>open flag</i> (unset unless stated otherwise), run these +steps:</p> <ol> <li><p>If <var>slotable</var>'s <a>parent</a> is null, then return null.</p></li> @@ -1519,14 +1569,12 @@ otherwise it is the empty string.</p> <li><p>If the <i>open flag</i> is set and <var>shadow</var>'s <a for=ShadowRoot>mode</a> is <em>not</em> "<code>open</code>", then return null.</p></li> - <li><p>Let <var>name</var> be the result of running <var>slotable</var>'s - <a for=slotable>get name</a>.</p></li> - <li><p>Return the first <a>slot</a> in <var>shadow</var>'s <a>tree</a> whose <a for=slot>name</a> - is <var>name</var>, if any, and null otherwise.</p></li> + is <var>slotable</var>'s <a for=slotable>name</a>, if any, and null otherwise.</p></li> </ol> -<p>To <dfn>find slotables</dfn> for a given <a>slot</a> <var>slot</var>, run these steps:</p> +<p>To <dfn export lt="find slotables|finding slotables">find slotables</dfn> for a given <a>slot</a> +<var>slot</var>, run these steps:</p> <ol> <li><p>Let <var>result</var> be an empty list.</p></li> @@ -1542,7 +1590,7 @@ otherwise it is the empty string.</p> <a>tree order</a>, run these substeps:</p> <ol> - <li><p>Let <var>foundSlot</var> be the result of running <a>find a slot</a> given + <li><p>Let <var>foundSlot</var> be the result of <a>finding a slot</a> given <var>slotable</var>.</p></li> <li><p>If <var>foundSlot</var> is <var>slot</var>, then append <var>slotable</var> to @@ -1553,13 +1601,14 @@ otherwise it is the empty string.</p> <li><p>Return <var>result</var>.</p></li> </ol> -<p>To <dfn>find distributed slotables</dfn> for a given <a>slot</a> <var>slot</var>, run these -steps:</p> +<p>To +<dfn export lt="find flattened slotables|finding flattened slotables">find flattened slotables</dfn> +for a given <a>slot</a> <var>slot</var>, run these steps:</p> <ol> <li><p>Let <var>result</var> be an empty list.</p></li> - <li><p>Let <var>slotables</var> be the result of running <a>find slotables</a> given + <li><p>Let <var>slotables</var> be the result of <a>finding slotables</a> given <var>slot</var>.</p></li> <li><p>If <var>slotables</var> is the empty list, then append each <a>slotable</a> @@ -1573,8 +1622,8 @@ steps:</p> <p>If <var>node</var> is a <a>slot</a>, run these subsubsteps:</p> <ol> - <li><p>Let <var>temporaryResult</var> be the result of running - <a>find distributed slotables</a> given <var>node</var>.</p></li> + <li><p>Let <var>temporaryResult</var> be the result of <a>finding flattened slotables</a> given + <var>node</var>.</p></li> <li><p>Append each <a>slotable</a> in <var>temporaryResult</var>, in order, to <var>result</var>.</p></li> @@ -1587,6 +1636,67 @@ steps:</p> <li><p>Return <var>result</var>.</p></li> </ol> +<h5 id=assigning-slotables-and-slots>Assigning slotables and slots</h5> + +<p>To <dfn noexport>assign slotables</dfn>, for a <a>slot</a> <var>slot</var> with an optional +<var>suppress signaling flag</var> (unset unless stated otherwise), run these steps: + +<ol> + <li><p>Let <var>slotables</var> be the result of <a>finding slotables</a> for <var>slot</var>. + + <li><p>If <var>suppress signaling flag</var> is unset, and <var>slotables</var> and + <var>slot</var>'s <a>assigned nodes</a> are not identical, then run <a>signal a slot change</a> for + <var>slot</var>. + + <li><p>Set <var>slot</var>'s <a>assigned nodes</a> to <var>slotables</var>. + + <li><p>For each <var>slotable</var> in <var>slotables</var>, set <var>slotable</var>'s + <a>assigned slot</a> to <var>slot</var>. +</ol> + +<p>To <dfn noexport>assign slotables for a tree</dfn>, given a <a>tree</a> <var>tree</var> and an +optional set of <a>slots</a> <var>noSignalSlots</var> (empty unless stated otherwise), run these +steps for each <a>slot</a> <var>slot</var> in <var>tree</var>, in <a>tree order</a>: + +<ol> + <li><p>Let <var>suppress signaling flag</var> be set, if <var>slot</var> is in + <var>noSignalSlots</var>, and unset otherwise.</p></li> + + <li><p>Run <a>assign slotables</a> for <var>slot</var> with <var>suppress signaling flag</var>. +</ol> + +<p>To <dfn noexport>assign a slot</dfn>, given a <a>slotable</a> <var>slotable</var>, run these +steps: + +<ol> + <li><p>Let <var>slot</var> be the result of <a>finding a slot</a> with <var>slotable</var>. + + <li><p>If <var>slot</var> is non-null, then run <a>assign slotables</a> for <var>slot</var>. +</ol> + +<h5 id=signaling-slot-change>Signaling slot change</h5> + +<p>Each <a>unit of related similar-origin browsing contexts</a> has a +<dfn export>signal slot list</dfn> (a list of <a>slots</a>). Unless stated otherwise it is empty. +[[!HTML]] + +<p>To <dfn noexport>signal a slot change</dfn>, for a <a>slot</a> <var>slot</var>, run these steps: + +<ol> + <li><p>If <var>slot</var> is not in <a>unit of related similar-origin browsing contexts</a>' + <a>signal slot list</a>, append <var>slot</var> to + <a>unit of related similar-origin browsing contexts</a>' <a>signal slot list</a>. + + <li><p>If <var>slot</var> is <a for=slotable>assigned</a>, then run <a>signal a slot change</a> for + <var>slot</var>'s <a>assigned slot</a>. + + <li><p>Otherwise, if <var>slot</var>'s <a>parent</a> is a <a>slot</a> and <var>slot</var>'s + <a>parent</a>'s <a>assigned nodes</a> is the empty list, then run <a>signal a slot change</a> for + <var>slot</var>'s <a>parent</a>. + + <li><p><a>Queue a mutation observer compound microtask</a>. +</ol> + <h4 id=mutation-algorithms>Mutation algorithms</h4> @@ -1606,10 +1716,8 @@ of a <var>node</var> into a <var>parent</var> before a of <var>parent</var>, <a>throw</a> a {{HierarchyRequestError}}. - <li>If <var>child</var> is not null and its - <a>parent</a> is not - <var>parent</var>, <a>throw</a> a - {{NotFoundError}} exception. + <li>If <var>child</var> is not null and its <a>parent</a> is not <var>parent</var>, then + <a>throw</a> a {{NotFoundError}}. <li>If <var>node</var> is not a {{DocumentFragment}}, {{DocumentType}}, @@ -1756,6 +1864,15 @@ into a <var>parent</var> before a <var>child</var>, with an optional <li><p>Insert <var>node</var> into <var>parent</var> before <var>child</var> or at the end of <var>parent</var> if <var>child</var> is null. + <li><p>If <var>parent</var> is a <a for=Element>shadow host</a> and <var>node</var> is a + <a>slotable</a>, then <a>assign a slot</a> for <var>node</var>. + + <li><p>If <var>parent</var> is a <a>slot</a> whose <a>assigned nodes</a> is the empty list, then + run <a>signal a slot change</a> for <var>parent</var>. + + <li><p>Run <a>assign slotables for a tree</a> with <var>node</var>'s <a>tree</a> and a set + containing each <a>inclusive descendant</a> of <var>node</var> that is a <a>slot</a>. + <li> <p>For each <a>shadow-including inclusive descendant</a> <var>inclusiveDescendant</var> of <var>node</var>, in <a>shadow-including tree order</a>, run these subsubsteps: @@ -1819,10 +1936,8 @@ steps: of <var>parent</var>, <a>throw</a> a {{HierarchyRequestError}}. - <li>If <var>child</var>'s - <a>parent</a> is not - <var>parent</var>, <a>throw</a> a - {{NotFoundError}} exception. + <li>If <var>child</var>'s <a>parent</a> is not <var>parent</var>, then <a>throw</a> a + {{NotFoundError}}. <li>If <var>node</var> is not a {{DocumentFragment}}, {{DocumentType}}, @@ -1962,10 +2077,8 @@ To <dfn export for=Node id=concept-node-pre-remove>pre-remove</dfn> a <var>child</var> from a <var>parent</var>, run these steps: <ol> - <li>If <var>child</var>'s - <a>parent</a> is not - <var>parent</var>, <a>throw</a> a - {{NotFoundError}} exception. + <li>If <var>child</var>'s <a>parent</a> is not <var>parent</var>, then <a>throw</a> a + {{NotFoundError}}. <li><a>Remove</a> <var>child</var> from <var>parent</var>. @@ -2027,6 +2140,21 @@ steps: <li>Remove <var>node</var> from its <var>parent</var>. + <li><p>If <var>node</var> is <a for=slotable>assigned</a>, then run <a>assign slotables</a> for + <var>node</var>'s <a>assigned slot</a>. + + <li><p>If <var>parent</var> is a <a>slot</a> whose <a>assigned nodes</a> is the empty list, then + run <a>signal a slot change</a> for <var>parent</var>. + + <li><p>If <var>node</var> has an <a>inclusive descendant</a> that is a <a>slot</a>, then: + + <ol> + <li><p>Run <a>assign slotables for a tree</a> with <var>parent</var>'s <a>tree</a>. + + <li><p>Run <a>assign slotables for a tree</a> with <var>node</var>'s <a>tree</a> and a set + containing each <a>inclusive descendant</a> of <var>node</var> that is a <a>slot</a>. + </ol> + <li><p>Run the <a>removing steps</a> with <var>node</var> and <var>parent</var>. <li> @@ -2069,9 +2197,8 @@ steps: <h4 id=interface-nonelementparentnode>Mixin {{NonElementParentNode}}</h4> -<p class="note no-backref">The {{NonElementParentNode/getElementById()}} method is not on -<a for="/">elements</a> for compatibility with older versions of jQuery. If a time comes where that -version of jQuery has disappeared, we might be able to support it. +<p class="note no-backref">Web compatibility prevents the {{NonElementParentNode/getElementById()}} +method from being exposed on <a for="/">elements</a> (and therefore on {{ParentNode}}). <pre class=idl> [NoInterfaceObject, @@ -2113,22 +2240,21 @@ standards that want to define APIs shared between <a for=/>documents</a> and <h4 id=interface-parentnode>Mixin {{ParentNode}}</h4> -To -<dfn export lt="converting nodes into a node">convert <var>nodes</var> into a node</dfn>, -run these steps: +To <dfn export lt="converting nodes into a node">convert nodes into a node</dfn>, given +<var>nodes</var> and <var>document</var>, run these steps: <ol> <li><p>Let <var>node</var> be null. - <li><p>Replace each string in <var>nodes</var> with a {{Text}} <a>node</a> whose - <a>data</a> is the string. + <li><p>Replace each string in <var>nodes</var> with a new {{Text}} <a>node</a> whose <a>data</a> is + the string and <a>node document</a> is <var>document</var>. <li><p>If <var>nodes</var> contains one <a>node</a>, set <var>node</var> to that <a>node</a>. - <li><p>Otherwise, set <var>node</var> to a new {{DocumentFragment}}, and then - <a>append</a> each <a>node</a> in <var>nodes</var>, if any, to it. Rethrow any - exceptions. + <li><p>Otherwise, set <var>node</var> to a new {{DocumentFragment}} whose <a>node document</a> is + <var>document</var>, and then <a>append</a> each <a>node</a> in <var>nodes</var>, if any, to it. + Rethrow any exceptions. <li><p>Return <var>node</var>. </ol> @@ -2142,8 +2268,8 @@ interface ParentNode { readonly attribute Element? lastElementChild; readonly attribute unsigned long childElementCount; - [Unscopable] void prepend((Node or DOMString)... nodes); - [Unscopable] void append((Node or DOMString)... nodes); + [CEReactions, Unscopable] void prepend((Node or DOMString)... nodes); + [CEReactions, Unscopable] void append((Node or DOMString)... nodes); Element? querySelector(DOMString selectors); [NewObject] NodeList querySelectorAll(DOMString selectors); @@ -2244,10 +2370,11 @@ The method must run these steps: <ol> - <li>Let <var>node</var> be the result of <a>converting <var>nodes</var> into a node</a>. + <li><p>Let <var>node</var> be the result of <a>converting nodes into a node</a> given + <var>nodes</var> and <a>context object</a>'s <a>node document</a>. Rethrow any exceptions. - <li><a>Pre-insert</a> <var>node</var> into the <a>context object</a> - before the <a>context object</a>'s <a>first child</a>. + <li><p><a>Pre-insert</a> <var>node</var> into <a>context object</a> before the + <a>context object</a>'s <a>first child</a>. Rethrow any exceptions. </ol> The @@ -2255,10 +2382,10 @@ The method must run these steps: <ol> - <li>Let <var>node</var> be the result of <a>converting <var>nodes</var> into a node</a>. + <li><p>Let <var>node</var> be the result of <a>converting nodes into a node</a> given + <var>nodes</var> and <a>context object</a>'s <a>node document</a>. Rethrow any exceptions. - <li><a>Append</a> - <var>node</var> to the <a>context object</a>. + <li><p><a>Append</a> <var>node</var> to <a>context object</a>. Rethrow any exceptions. </ol> <!--The <dfn method for=ParentNode><code>query(<var>relativeSelectors</var>)</code></dfn> @@ -2284,9 +2411,9 @@ running <a>scope-match a selectors string</a> <var>selectors</var> against the <h4 id=interface-nondocumenttypechildnode>Mixin {{NonDocumentTypeChildNode}}</h4> -<p class="note no-backref">The {{previousElementSibling}} and {{nextElementSibling}} attributes have -been removed from {{DocumentType}} nodes for compatibility reasons. If these additions are deemed -compatible enough in the future, they could be reinstated. +<p class="note no-backref">Web compatibility prevents the {{previousElementSibling}} and +{{nextElementSibling}} attributes from being exposed on <a for=/>doctypes</a> (and therefore on +{{ChildNode}}). <pre class=idl> [NoInterfaceObject, @@ -2328,10 +2455,10 @@ and null otherwise. [NoInterfaceObject, Exposed=Window] interface ChildNode { - [Unscopable] void before((Node or DOMString)... nodes); - [Unscopable] void after((Node or DOMString)... nodes); - [Unscopable] void replaceWith((Node or DOMString)... nodes); - [Unscopable] void remove(); + [CEReactions, Unscopable] void before((Node or DOMString)... nodes); + [CEReactions, Unscopable] void after((Node or DOMString)... nodes); + [CEReactions, Unscopable] void replaceWith((Node or DOMString)... nodes); + [CEReactions, Unscopable] void remove(); }; DocumentType implements ChildNode; Element implements ChildNode; @@ -2384,15 +2511,14 @@ invoked, must run these steps: <li><p>Let <var>viablePreviousSibling</var> be <a>context object</a>'s first <a>preceding</a> <a>sibling</a> not in <var>nodes</var>, and null otherwise. - <li><p>Let <var>node</var> be the result of - <a>converting <var>nodes</var> into a node</a>. + <li><p>Let <var>node</var> be the result of <a>converting nodes into a node</a>, given + <var>nodes</var> and <a>context object</a>'s <a>node document</a>. Rethrow any exceptions. - <li><p>If <var>viablePreviousSibling</var> is non-null, set it to - <var>viablePreviousSibling</var>'s <a>next sibling</a>, and to <var>parent</var>'s - <a>first child</a> otherwise. + <li><p>If <var>viablePreviousSibling</var> is null, set it to <var>parent</var>'s + <a>first child</a>, and to <var>viablePreviousSibling</var>'s <a>next sibling</a> otherwise. <li><p><a>Pre-insert</a> <var>node</var> into <var>parent</var> before - <var>viablePreviousSibling</var>. + <var>viablePreviousSibling</var>. Rethrow any exceptions. </ol> The <dfn method for=ChildNode><code>after(<var>nodes</var>)</code></dfn> method, when @@ -2406,11 +2532,11 @@ invoked, must run these steps: <li><p>Let <var>viableNextSibling</var> be <a>context object</a>'s first <a>following</a> <a>sibling</a> not in <var>nodes</var>, and null otherwise. - <li><p>Let <var>node</var> be the result of - <a>converting <var>nodes</var> into a node</a>. + <li><p>Let <var>node</var> be the result of <a>converting nodes into a node</a>, given + <var>nodes</var> and <a>context object</a>'s <a>node document</a>. Rethrow any exceptions. <li><p><a>Pre-insert</a> <var>node</var> into <var>parent</var> before - <var>viableNextSibling</var>. + <var>viableNextSibling</var>. Rethrow any exceptions. </ol> The <dfn method for=ChildNode><code>replaceWith(<var>nodes</var>)</code></dfn> method, @@ -2424,17 +2550,17 @@ when invoked, must run these steps: <li><p>Let <var>viableNextSibling</var> be <a>context object</a>'s first <a>following</a> <a>sibling</a> not in <var>nodes</var>, and null otherwise. - <li><p>Let <var>node</var> be the result of - <a>converting <var>nodes</var> into a node</a>. + <li><p>Let <var>node</var> be the result of <a>converting nodes into a node</a>, given + <var>nodes</var> and <a>context object</a>'s <a>node document</a>. Rethrow any exceptions. <li> <p>If <a>context object</a>'s <a>parent</a> is <var>parent</var>, <a>replace</a> the - <a>context object</a> with <var>node</var> within <var>parent</var>. + <a>context object</a> with <var>node</var> within <var>parent</var>. Rethrow any exceptions. <p class=note><a>Context object</a> could have been inserted into <var>node</var>. <li><p>Otherwise, <a>pre-insert</a> <var>node</var> into <var>parent</var> before - <var>viableNextSibling</var>. + <var>viableNextSibling</var>. Rethrow any exceptions. </ol> The <dfn method for=ChildNode><code>remove()</code></dfn> method, when invoked, must run @@ -2458,7 +2584,7 @@ interface Slotable { }; Element implements Slotable; Text implements Slotable; -</pre><!-- XXX HTML slot --> +</pre> <p>The <dfn attribute for=Slotable><code>assignedSlot</code></dfn> attribute's getter must return the result of <a>find a slot</a> given <a>context object</a> and with the <i>open flag</i> set.</p> @@ -2724,6 +2850,16 @@ To <dfn export>notify mutation observers</dfn>, run these steps: <a>callback this value</a>. If this throws an exception, <a>report the exception</a>. </ol> + + <li><p>Let <var>signalList</var> be a copy of + <a>unit of related similar-origin browsing contexts</a>' <a>signal slot list</a>. + + <li><p>Empty <a>unit of related similar-origin browsing contexts</a>' <a>signal slot list</a>. + + <li><p>For each <a>slot</a> <var>slot</var> in <var>signalList</var>, in order, + <a>fire an event</a> named <code>slotchange</code>, with its {{Event/bubbles}} attribute set to + true, at <var>slot</var>. + <!-- XXX scoped (change this while updating events for shadow trees) --> </ol> <hr> @@ -3189,11 +3325,11 @@ interface Node : EventTarget { readonly attribute Node? previousSibling; readonly attribute Node? nextSibling; - attribute DOMString? nodeValue; - attribute DOMString? textContent; - void normalize(); + [CEReactions] attribute DOMString? nodeValue; + [CEReactions] attribute DOMString? textContent; + [CEReactions] void normalize(); - [NewObject] Node cloneNode(optional boolean deep = false); + [CEReactions, NewObject] Node cloneNode(optional boolean deep = false); boolean isEqualNode(Node? otherNode); boolean isSameNode(Node? otherNode); // historical alias of === @@ -3210,10 +3346,10 @@ interface Node : EventTarget { DOMString? lookupNamespaceURI(DOMString? prefix); boolean isDefaultNamespace(DOMString? namespace); - Node insertBefore(Node node, Node? child); - Node appendChild(Node node); - Node replaceChild(Node node, Node child); - Node removeChild(Node child); + [CEReactions] Node insertBefore(Node node, Node? child); + [CEReactions] Node appendChild(Node node); + [CEReactions] Node replaceChild(Node node, Node child); + [CEReactions] Node removeChild(Node child); }; </pre> @@ -3557,8 +3693,8 @@ following, switching on <a>context object</a>: <dd>Null. </dl> -<p>The {{Node/textContent}} attribute's setter must, if the new value is null, act as if it was the -empty string instead, and then do as described below, switching on <a>context object</a>: +<p>The {{Node/textContent}} attribute's setter must, if the given value is null, act as if it was +the empty string instead, and then do as described below, switching on <a>context object</a>: <dl class=switch> <dt>{{DocumentFragment}} @@ -3567,26 +3703,23 @@ empty string instead, and then do as described below, switching on <a>context ob <!--AttrExodus <dt>{{Attr}} --> <dd> <ol> - <li>Let <var>node</var> be null. + <li><p>Let <var>node</var> be null. - <li>If new value is not the empty string, set <var>node</var> to - a new {{Text}} <a>node</a> whose - <a>data</a> is new value. + <li><p>If the given value is not the empty string, set <var>node</var> to a new {{Text}} + <a>node</a> whose <a>data</a> is the given value and <a>node document</a> is + <a>context object</a>'s <a>node document</a>. - <li><a>Replace all</a> with - <var>node</var> within the <a>context object</a>. + <li><p><a>Replace all</a> with <var>node</var> within the <a>context object</a>. </ol> <dt>{{Text}} <dt>{{ProcessingInstruction}} <dt>{{Comment}} - <dd><a>Replace data</a> with node - <a>context object</a>, offset 0, count - {{CharacterData/length}} attribute value, and - data new value. + <dd><p><a>Replace data</a> with node <a>context object</a>, offset 0, count + {{CharacterData/length}} attribute value, and data the given value. <dt>Any other node - <dd>Do nothing. + <dd><p>Do nothing. </dl> <hr> @@ -3727,9 +3860,9 @@ dom-Range-extractContents, dom-Range-cloneContents --> <p>If <var>node</var> is an <a for=/>element</a>, then: <ol> - <li><p>Let <var>copy</var> be the result of <a>creating an element</a>, given <var>document</var>, - <var>node</var>'s <a for=Element>local name</a>, <var>node</var>'s - <a for=Element>namespace prefix</a>, <var>node</var>'s <a for=Element>namespace</a>, and the + <li><p>Let <var>copy</var> be the result of <a>creating an element</a>, given + <var>document</var>, <var>node</var>'s <a for=Element>local name</a>, <var>node</var>'s + <a for=Element>namespace</a>, <var>node</var>'s <a for=Element>namespace prefix</a>, and the value of <var>node</var>'s <code>is</code> attribute if present (or null if not). The <var>synchronous custom elements flag</var> should be unset. @@ -3803,8 +3936,8 @@ dom-Range-extractContents, dom-Range-cloneContents --> invoked, must run these steps: <ol> - <li><p>If <a>context object</a> is a <a for=/>shadow root</a>, <a>throw</a> a {{NotSupportedError}} - exception. + <li><p>If <a>context object</a> is a <a for=/>shadow root</a>, then <a>throw</a> a + {{NotSupportedError}}. <li><p>Return a <a lt="clone a node">clone</a> of the <a>context object</a>, with the <i>clone children flag</i> set if <var>deep</var> is true. @@ -4313,8 +4446,8 @@ interface Document : Node { [NewObject] Comment createComment(DOMString data); [NewObject] ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data); - [NewObject] Node importNode(Node node, optional boolean deep = false); - Node adoptNode(Node node); + [CEReactions, NewObject] Node importNode(Node node, optional boolean deep = false); + [CEReactions] Node adoptNode(Node node); [NewObject] Attr createAttribute(DOMString localName); [NewObject] Attr createAttributeNS(DOMString? namespace, DOMString qualifiedName); @@ -4580,11 +4713,10 @@ for the <a>context object</a>. If <var>localName</var> does not match the <code><a type>Name</a></code> production an - {{InvalidCharacterError}} - exception will be thrown. + {{InvalidCharacterError}} will be thrown. When supplied, <var>options</var>' <code>is</code> member can be used to create a - <a>type extension</a>. + <a>customized built-in element</a>. <dt><code><var>element</var> = <var>document</var> . <a method lt=createElementNS()>createElementNS(namespace, qualifiedName [, options])</a></code> @@ -4602,12 +4734,10 @@ for the <a>context object</a>. If <var>localName</var> does not match the <code><a type>Name</a></code> production an - {{InvalidCharacterError}} - exception will be thrown. + {{InvalidCharacterError}} will be thrown. If one of the following conditions is true a - {{NamespaceError}} exception - will be thrown: + {{NamespaceError}} will be thrown: <ul> <li><var>localName</var> does not match the @@ -4628,7 +4758,7 @@ for the <a>context object</a>. </ul> When supplied, <var>options</var>' <code>is</code> member can be used to create a - <a>type extension</a>. + <a>customized built-in element</a>. <dt><code><var>documentFragment</var> = <var>document</var> . {{createDocumentFragment()}}</code> <dd>Returns a {{DocumentFragment}} @@ -4650,11 +4780,9 @@ for the <a>context object</a>. <a>data</a> is <var>data</var>. If <var>target</var> does not match the <code><a type>Name</a></code> production an - {{InvalidCharacterError}} - exception will be thrown. + {{InvalidCharacterError}} will be thrown. If <var>data</var> contains "<code>?></code>" an - {{InvalidCharacterError}} - exception will be thrown. + {{InvalidCharacterError}} will be thrown. </dl> The <dfn export id=concept-element-interface>element interface</dfn> for any @@ -4669,10 +4797,8 @@ The <dfn method for=Document><code>createElement(<var>localName</var>, <var>opti invoked, must run these steps: <ol> - <li>If <var>localName</var> does not match the - <code><a type>Name</a></code> production, - <a>throw</a> an - {{InvalidCharacterError}} exception. + <li><p>If <var>localName</var> does not match the <code><a type>Name</a></code> production, then + <a>throw</a> an {{InvalidCharacterError}}. <li>If the <a>context object</a> is an <a>HTML document</a>, let <var>localName</var> be @@ -4694,8 +4820,8 @@ invoked, must run these steps: "<code>application/xhtml+xml</code>", and null otherwise. <li>Let <var>element</var> be the result of <a>creating an element</a> given the - <a>context object</a>, <var>localName</var>, null, <var>namespace</var>, <var>is</var>, and - with the <var>synchronous custom elements</var> flag set. Rethrow any exceptions. + <a>context object</a>, <var>localName</var>, <var>namespace</var>, null, <var>is</var>, and with + the <var>synchronous custom elements</var> flag set. Rethrow any exceptions. <li>If <var>is</var> is non-null, then <a>set an attribute value</a> for <var>element</var> using "<code>is</code>" and <var>is</var>. @@ -4703,7 +4829,7 @@ invoked, must run these steps: <li>Return <var>element</var>. </ol> -<p>The <dfn>internal <code>createElementNS</code> steps</dfn>, given <var>document</var>, +<p>The <dfn noexport>internal <code>createElementNS</code> steps</dfn>, given <var>document</var>, <var>namespace</var>, <var>qualifiedName</var>, and <var>options</var>, are as follows: <ol> @@ -4722,7 +4848,7 @@ invoked, must run these steps: {{NotFoundError}}. <li><p>Let <var>element</var> be the result of <a>creating an element</a> given - <var>document</var>, <var>localName</var>, <var>prefix</var>, <var>namespace</var>, <var>is</var>, + <var>document</var>, <var>localName</var>, <var>namespace</var>, <var>prefix</var>, <var>is</var>, and with the <var>synchronous custom elements</var> flag set. Rethrow any exceptions. <li>If <var>is</var> is non-null, then <a>set an attribute value</a> for <var>element</var> using @@ -4764,17 +4890,11 @@ method, when invoked, must run these steps: <li>If <var>target</var> does not match the <!--<code data-anolis-type>PITarget</code>--> <code><a type>Name</a></code> production, - <a>throw</a> an - {{InvalidCharacterError}} exception. <!-- DOM3 does not check for "xml" --> + then <a>throw</a> an {{InvalidCharacterError}}. <!-- DOM3 does not check for "xml" --> <li>If <var>data</var> contains the string - "<code>?></code>", <a>throw</a> an - {{InvalidCharacterError}} exception. <!-- Gecko does this. --> - - <!--<li>If <var>target</var> contains a U+003A COLON (":") - character, <a>throw</a> a - {{NamespaceError}} exception.--> - <!-- DOM3 didn't check this --> + "<code>?></code>", then <a>throw</a> an + {{InvalidCharacterError}}. <!-- Gecko does this. --> <li>Return a new {{ProcessingInstruction}} <a>node</a>, with @@ -4800,7 +4920,7 @@ method, when invoked, must run these steps: <var>node</var>'s <a>descendants</a>. If <var>node</var> is a <a>document</a> or a <a for=/>shadow root</a>, throws a - {{NotSupportedError}} exception. + {{NotSupportedError}}. <dt><var>node</var> = <var>document</var> . {{adoptNode(node)}} @@ -4809,19 +4929,18 @@ method, when invoked, must run these steps: <a>document</a> and returns it. If <var>node</var> is a <a>document</a>, throws a {{NotSupportedError}} or, if - <var>node</var> is a <a for=/>shadow root</a>, throws a {{HierarchyRequestError}} exception. + <var>node</var> is a <a for=/>shadow root</a>, throws a {{HierarchyRequestError}}. </dl> The <dfn method for=Document><code>importNode(<var>node</var>, <var>deep</var>)</code></dfn> method, when invoked, must run these steps: <ol> - <li>If <var>node</var> is a <a>document</a> or <a for=/>shadow root</a>, <a>throw</a> a - {{NotSupportedError}} exception. + <li><p>If <var>node</var> is a <a>document</a> or <a for=/>shadow root</a>, then <a>throw</a> a + {{NotSupportedError}}. - <li>Return a <a lt="clone a node">clone</a> of - <var>node</var>, with <a>context object</a> and the - <i>clone children flag</i> set if <var>deep</var> is true. + <li><p>Return a <a lt="clone a node">clone</a> of <var>node</var>, with <a>context object</a> and + the <i>clone children flag</i> set if <var>deep</var> is true. </ol> <a lt="Other applicable specifications">Specifications</a> may define @@ -4858,11 +4977,10 @@ The <dfn method for=Document><code>adoptNode(<var>node</var>)</code></dfn> metho must run these steps: <ol> - <li>If <var>node</var> is a <a>document</a>, <a>throw</a> a {{NotSupportedError}} - exception. + <li>If <var>node</var> is a <a>document</a>, then <a>throw</a> a {{NotSupportedError}}. - <li>If <var>node</var> is a <a for=/>shadow root</a>, <a>throw</a> a {{HierarchyRequestError}} - exception. + <li>If <var>node</var> is a <a for=/>shadow root</a>, then <a>throw</a> a + {{HierarchyRequestError}}. <li><a>Adopt</a> <var>node</var> into the <a>context object</a>. @@ -4876,9 +4994,8 @@ The <dfn method for=Document><code>createAttribute(<var>localName</var>)</code>< invoked, must run these steps: <ol> - <li>If <var>localName</var> does not match the <code><a type>Name</a></code> - production in XML, <a>throw</a> an - {{InvalidCharacterError}} exception. + <li><p>If <var>localName</var> does not match the <code><a type>Name</a></code> production in XML, + then <a>throw</a> an {{InvalidCharacterError}}. <li>If the <a>context object</a> is an <a>HTML document</a>, let <var>localName</var> be <a>converted to ASCII lowercase</a>. @@ -4903,48 +5020,75 @@ method, when invoked, must run these steps: <hr> -The <dfn method for=Document><code>createEvent(<var>interface</var>)</code></dfn> method, when +<p>The <dfn method for=Document><code>createEvent(<var>interface</var>)</code></dfn> method, when invoked, must run these steps: <ol> - <li>Let <var>constructor</var> be null. + <li><p>Let <var>constructor</var> be null. <li> - If <var>interface</var> is an - <a>ASCII case-insensitive</a> match for any of the strings in the - first column in the following table, set <var>constructor</var> to the - interface in the second column on the same row as the matching string: + <p>If <var>interface</var> is an <a>ASCII case-insensitive</a> match for any of the strings in the + first column in the following table, then set <var>constructor</var> to the interface in the + second column on the same row as the matching string: <table> <thead> <tr><th>String<th>Interface<td>Notes <tbody> - <tr><td>"<code>customevent</code>"<td>{{CustomEvent}}<td rowspan=4> - <tr><td>"<code>event</code><td rowspan=3>{{Event}} + <tr><td>"<code>animationevent</code>"<td>{{AnimationEvent}}<td>[[!CSS3-ANIMATIONS]] + <tr><td>"<code>beforeunloadevent</code>"<td>{{BeforeUnloadEvent}}<td rowspan=2>[[!HTML]] + <tr><td>"<code>closeevent</code>"<td>{{CloseEvent}} + <tr><td>"<code>compositionevent</code>"<td>{{CompositionEvent}}<td>[[!UIEVENTS]] + <!-- textevent also maps to CompositionEvent --> + <tr><td>"<code>customevent</code>"<td>{{CustomEvent}}<td> + <tr><td>"<code>devicemotionevent</code>"<td>{{DeviceMotionEvent}}<td rowspan=2>[[!DEVICE-ORIENTATION]] + <tr><td>"<code>deviceorientationevent</code>"<td>{{DeviceOrientationEvent}} + <tr><td>"<code>dragevent</code>"<td>{{DragEvent}}<td rowspan=2>[[!HTML]] + <tr><td>"<code>errorevent</code>"<td>{{ErrorEvent}} + <tr><td>"<code>event</code>"<td rowspan=2>{{Event}}<td rowspan=2> <tr><td>"<code>events</code>" - <tr><td>"<code>htmlevents</code>" + <!-- htmlevents and svgevents also map to Event --> + <tr><td>"<code>focusevent</code>"<td>{{FocusEvent}}<td>[[!UIEVENTS]] + <tr><td>"<code>hashchangeevent</code>"<td>{{HashChangeEvent}}<td>[[!HTML]] + <tr><td>"<code>htmlevents</code>"<td>{{Event}}<td> + <tr><td>"<code>idbversionchangeevent</code>"<td>{{IDBVersionChangeEvent}}<td>[[INDEXEDDB]] <tr><td>"<code>keyboardevent</code>"<td>{{KeyboardEvent}}<td>[[!UIEVENTS]] <tr><td>"<code>messageevent</code>"<td>{{MessageEvent}}<td>[[!HTML]] <tr><td>"<code>mouseevent</code>"<td rowspan=2>{{MouseEvent}}<td rowspan=2>[[!UIEVENTS]] <tr><td>"<code>mouseevents</code>" + <tr><td>"<code>pagetransitionevent</code>"<td>{{PageTransitionEvent}}<td rowspan=2>[[!HTML]] + <tr><td>"<code>popstateevent</code>"<td>{{PopStateEvent}} + <tr><td>"<code>progressevent</code>"<td>{{ProgressEvent}}<td>[[!XHR]] + <tr><td>"<code>storageevent</code>"<td>{{StorageEvent}}<td>[[!HTML]] + <tr><td>"<code>svgevents</code>"<td>{{Event}}<td> + <tr><td>"<code>svgzoomevent</code>"<td rowspan=2>{{SVGZoomEvent}}<td rowspan=2>[[!SVG]] + <tr><td>"<code>svgzoomevents</code>" + <tr><td>"<code>textevent</code>"<td>{{CompositionEvent}}<td>[[!UIEVENTS]] <tr><td>"<code>touchevent</code>"<td>{{TouchEvent}}<td>[[!TOUCH-EVENTS]] + <tr><td>"<code>trackevent</code>"<td>{{TrackEvent}}<td>[[!HTML]] + <tr><td>"<code>transitionevent</code>"<td>{{TransitionEvent}}<td>[[!CSS3-TRANSITIONS]] <tr><td>"<code>uievent</code>"<td rowspan=2>{{UIEvent}}<td rowspan=2>[[!UIEVENTS]] <tr><td>"<code>uievents</code>" + <tr><td>"<code>webglcontextevent</code>"<td>{{WebGLContextEvent}}<td>[[!WEBGL]] + <tr><td>"<code>wheelevent</code>"<td>{{WheelEvent}}<td>[[!UIEVENTS]] </table> - <!-- XXX WebKit's architecture is broken here and both browsers support more than DOM. - https://trac.webkit.org/browser/trunk/Source/WebCore/dom/EventNames.in - https://mxr.mozilla.org/mozilla-central/source/content/events/src/nsEventDispatcher.cpp#819 --> - <li>If <var>constructor</var> is null, <a>throw</a> a - {{NotSupportedError}}. + <li><p>If <var>constructor</var> is null, then <a>throw</a> a {{NotSupportedError}}. + + <li> + <p>If the initial value of <var>constructor</var> is undefined, then <a>throw</a> a + {{NotSupportedError}}. + + <p class=note>Typically user agents disable support for touch events in some configurations, in + which case the initial value of {{TouchEvent}} is undefined. - <li>Let <var>event</var> be the result of <a for=Event lt=constructor>invoking</a> the initial + <li><p>Let <var>event</var> be the result of <a for=Event lt=constructor>invoking</a> the initial value of <var>constructor</var> with the empty string as argument. <!-- "initial value" as in before script could get to it --> - <li>Unset <var>event</var>'s <a>initialized flag</a>. + <li><p>Unset <var>event</var>'s <a>initialized flag</a>. - <li>Return <var>event</var>. + <li><p>Return <var>event</var>. </ol> <p class=note><a>Event</a> constructors ought to be used instead. @@ -5013,11 +5157,9 @@ interface DOMImplementation { <var>qualifiedName</var>, <var>publicId</var>, and <var>systemId</var>. If <var>qualifiedName</var> does not match the <code><a type>Name</a></code> production, an - {{InvalidCharacterError}} - exception is thrown, and if it does not match the + {{InvalidCharacterError}} is thrown, and if it does not match the <code><a type>QName</a></code> production, a - {{NamespaceError}} exception - is thrown. + {{NamespaceError}} is thrown. <dt><code><var>doc</var> = <var>document</var> . {{Document/implementation}} . <a method lt="createDocument()">createDocument(<var>namespace</var>, <var>qualifiedName</var> [, <var>doctype</var> = null])</a></code> @@ -5089,6 +5231,20 @@ method, when invoked, must run these steps: <li><p><var>document</var>'s <a>origin</a> is the <a>origin</a> of the <a>context object</a>'s associated <a>document</a>. [[!HTML]] + <li> + <p><var>document</var>'s <a for=Document>content type</a> is determined by <var>namespace</var>: + + <dl class=switch> + <dt><a>HTML namespace</a> + <dd><code>application/xhtml+xml</code> + + <dt><a>SVG namespace</a> + <dd><code>image/svg+xml</code> + + <dt>Any other namespace + <dd><code>application/xml</code> + </dl> + <li><p>Return <var>document</var>. </ol> @@ -5097,39 +5253,39 @@ The method, when invoked, must run these steps: <ol> - <li>Let <var>doc</var> be a new <a>document</a> that is an <a>HTML document</a>. + <li><p>Let <var>doc</var> be a new <a>document</a> that is an <a>HTML document</a>. - <li>Set <var>doc</var>'s <a for=Document>content type</a> to "<code>text/html</code>". + <li><p>Set <var>doc</var>'s <a for=Document>content type</a> to "<code>text/html</code>". - <li><a>Append</a> a new <a>doctype</a>, with "<code>html</code>" as its + <li><p><a>Append</a> a new <a>doctype</a>, with "<code>html</code>" as its <a for=DocumentType>name</a> and with its <a>node document</a> set to <var>doc</var>, to <var>doc</var>. - <li><a>Append</a> a new <{html}> element in the <span>HTML namespace</span>, to - <var>doc</var>. + <li><p><a>Append</a> the result of <a>creating an element</a> given <var>doc</var>, <{html}>, and + the <a>HTML namespace</a>, to <var>doc</var>. - <li><a>Append</a> a new <{head}> element in the <span>HTML namespace</span>, to the - <{html}> element created earlier. + <li><p><a>Append</a> the result of <a>creating an element</a> given <var>doc</var>, <{head}>, and + the <a>HTML namespace</a>, to the <{html}> element created earlier. <li> - If the <var>title</var> argument is not omitted: + <p>If <var>title</var> is given: <ol> - <li><a>Append</a> a new <{title}> element in the <a>HTML namespace</a>, to the <{head}> - element created earlier. + <li><p><a>Append</a> the result of <a>creating an element</a> given <var>doc</var>, <{title}>, + and the <a>HTML namespace</a>, to the <{head}> element created earlier. - <li><a>Append</a> a new {{Text}} <a>node</a>, with its <a>data</a> set to - <var>title</var> (which could be the empty string), to the <{title}> element created - earlier. + <li><p><a>Append</a> a new {{Text}} <a>node</a>, with its <a>data</a> set to + <var>title</var> (which could be the empty string) and its <a>node document</a> set to + <var>doc</var>, to the <{title}> element created earlier. </ol> - <li><a>Append</a> a new <{body}> element in the <a>HTML namespace</a>, to the <{html}> - element created earlier. + <li><p><a>Append</a> the result of <a>creating an element</a> given <var>doc</var>, <{body}>, and + the <a>HTML namespace</a>, to the <{html}> element created earlier.</li> - <li><var>doc</var>'s <a>origin</a> is the <a>origin</a> of the <a>context object</a>'s associated - <a>document</a>. [[!HTML]] + <li><p><var>doc</var>'s <a>origin</a> is the <a>origin</a> of the <a>context object</a>'s + associated <a>document</a>. [[!HTML]] - <li>Return <var>doc</var>. + <li><p>Return <var>doc</var>. </ol> The <dfn method for="DOMImplementation"><code>hasFeature()</code></dfn> method, when @@ -5245,10 +5401,9 @@ or "<code>closed</code>").</p> <a>shadow-including preorder, depth-first traversal</a> of a <a>node tree</a>. <dfn noexport>shadow-including preorder, depth-first traversal</dfn> of a <a>node tree</a> <var>tree</var> is preorder, depth-first traversal of <var>tree</var>, with for each -<a for=/>element</a> <var>element</var> encountered in <var>tree</var> with a non-null -<a for=Element>shadow root</a>, <a>shadow-including preorder, depth-first traversal</a> of that -<a for=/>element</a>'s <a for=Element>shadow root</a>'s <a>node tree</a> just after it is -encountered. +<a for=Element>shadow host</a> encountered in <var>tree</var>, +<a>shadow-including preorder, depth-first traversal</a> of that <a for=/>element</a>'s +<a for=Element>shadow root</a>'s <a>node tree</a> just after it is encountered. <p>The <dfn export id=concept-shadow-including-root>shadow-including root</dfn> of an object is its <a for=tree>root</a>'s <a for=DocumentFragment>host</a>'s <a>shadow-including root</a>, if the @@ -5265,6 +5420,14 @@ otherwise.</p> <dfn export id=concept-shadow-including-inclusive-descendant>shadow-including inclusive descendant</dfn> is an object or one of its <a>shadow-including descendants</a>. +<p>An object <var>A</var> is a +<dfn export id=concept-shadow-including-ancestor>shadow-including ancestor</dfn> of an object +<var>B</var>, if and only if <var>B</var> is a <a>shadow-including descendant</a> of <var>A</var>. + +<p>A +<dfn export id=concept-shadow-including-inclusive-ancestor>shadow-including inclusive ancestor</dfn> +is an object or one of its <a>shadow-including ancestors</a>. + <hr> <p class="XXX">For now you can find more information about this object in @@ -5282,28 +5445,28 @@ interface Element : Node { readonly attribute DOMString localName; readonly attribute DOMString tagName; - attribute DOMString id; - attribute DOMString className; - [SameObject, PutForwards=value] readonly attribute DOMTokenList classList; - attribute DOMString slot; + [CEReactions] attribute DOMString id; + [CEReactions] attribute DOMString className; + [CEReactions, SameObject, PutForwards=value] readonly attribute DOMTokenList classList; + [CEReactions] attribute DOMString slot; boolean hasAttributes(); [SameObject] readonly attribute NamedNodeMap attributes; sequence<DOMString> getAttributeNames(); DOMString? getAttribute(DOMString qualifiedName); DOMString? getAttributeNS(DOMString? namespace, DOMString localName); - void setAttribute(DOMString qualifiedName, DOMString value); - void setAttributeNS(DOMString? namespace, DOMString qualifiedName, DOMString value); - void removeAttribute(DOMString qualifiedName); - void removeAttributeNS(DOMString? namespace, DOMString localName); + [CEReactions] void setAttribute(DOMString qualifiedName, DOMString value); + [CEReactions] void setAttributeNS(DOMString? namespace, DOMString qualifiedName, DOMString value); + [CEReactions] void removeAttribute(DOMString qualifiedName); + [CEReactions] void removeAttributeNS(DOMString? namespace, DOMString localName); boolean hasAttribute(DOMString qualifiedName); boolean hasAttributeNS(DOMString? namespace, DOMString localName); Attr? getAttributeNode(DOMString qualifiedName); Attr? getAttributeNodeNS(DOMString? namespace, DOMString localName); - Attr? setAttributeNode(Attr attr); - Attr? setAttributeNodeNS(Attr attr); - Attr removeAttributeNode(Attr attr); + [CEReactions] Attr? setAttributeNode(Attr attr); + [CEReactions] Attr? setAttributeNodeNS(Attr attr); + [CEReactions] Attr removeAttributeNode(Attr attr); ShadowRoot attachShadow(ShadowRootInit init); readonly attribute ShadowRoot? shadowRoot; @@ -5316,8 +5479,8 @@ interface Element : Node { HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName); HTMLCollection getElementsByClassName(DOMString classNames); - Element? insertAdjacentElement(DOMString where, Element element); // historical - void insertAdjacentText(DOMString where, DOMString data); // historical + [CEReactions] Element? insertAdjacentElement(DOMString where, Element element); // historical + [CEReactions] void insertAdjacentText(DOMString where, DOMString data); // historical }; dictionary ShadowRootInit { @@ -5381,10 +5544,12 @@ behavior of the <a href=#mutation-algorithms>mutation algorithms</a>.</p> <p><a for=/>Elements</a> also have an associated <dfn export id=concept-element-shadow-root for=Element>shadow root</dfn> (null or a -<a for=/>shadow root</a>). It is null unless otherwise stated. +<a for=/>shadow root</a>). It is null unless otherwise stated. An <a for=/>element</a> is a +<dfn export for=Element>shadow host</dfn> if its <a for=Element>shadow root</a> is non-null. -<p>An <a for=/>element</a>'s <dfn id=concept-element-qualified-name for=Element>qualified name</dfn> -is its <a for=Element>local name</a> if its <a for=Element>namespace prefix</a> is null, and its +<p>An <a for=/>element</a>'s +<dfn export id=concept-element-qualified-name for=Element>qualified name</dfn> is its +<a for=Element>local name</a> if its <a for=Element>namespace prefix</a> is null, and its <a for=Element>namespace prefix</a>, followed by "<code>:</code>", followed by its <a for=Element>local name</a>, otherwise. @@ -5393,10 +5558,14 @@ required to do so. The standard has this concept for readability. <p>To <dfn export id=concept-create-element lt="create an element|creating an element">create an element</dfn>, -given a <var>document</var>, <var>localName</var>, <var>prefix</var>, <var>namespace</var>, -<var>is</var>, and optional <var>synchronous custom elements flag</var>, run these steps: +given a <var>document</var>, <var>localName</var>, <var>namespace</var>, and optional +<var>prefix</var>, <var>is</var>, and <var>synchronous custom elements flag</var>, run these steps: <ol> + <li><p>If <var>prefix</var> was not given, let <var>prefix</var> be null. + + <li><p>If <var>is</var> was not given, let <var>is</var> be null. + <li><p>Let <var>result</var> be null. <li><p>Let <var>definition</var> be the result of @@ -5407,7 +5576,7 @@ given a <var>document</var>, <var>localName</var>, <var>prefix</var>, <var>names <p>If <var>definition</var> is non-null, and <var>definition</var>'s <a for="custom element definition">name</a> is not equal to its <a for="custom element definition">local name</a> (i.e., <var>definition</var> represents a - <a>type extension</a>), then: + <a>customized built-in element</a>), then: <ol> <li><p>Let <var>interface</var> be the <a>element interface</a> for <var>localName</var> and the @@ -5443,7 +5612,7 @@ given a <var>document</var>, <var>localName</var>, <var>prefix</var>, <var>names <li> <p>If <var>result</var> does not implement the {{HTMLElement}} interface, <a>throw</a> a - {{TypeError}} exception. + <code>TypeError</code>. <p class=note>This is meant to be a brand check to ensure that the object was allocated by the {{HTMLElement}} constructor. See @@ -5451,23 +5620,22 @@ given a <var>document</var>, <var>localName</var>, <var>prefix</var>, <var>names precise. </li> - <li><p>If <var>result</var>'s <a for=Element>attribute list</a> is not empty, <a>throw</a> a - {{NotSupportedError}} exception. + <li><p>If <var>result</var>'s <a for=Element>attribute list</a> is not empty, then <a>throw</a> + a {{NotSupportedError}}. - <li><p>If <var>result</var> has <a>children</a>, <a>throw</a> a {{NotSupportedError}} - exception. + <li><p>If <var>result</var> has <a>children</a>, then <a>throw</a> a {{NotSupportedError}}. - <li><p>If <var>result</var>'s <a>parent</a> is not null, <a>throw</a> a {{NotSupportedError}} - exception. + <li><p>If <var>result</var>'s <a>parent</a> is not null, then <a>throw</a> a + {{NotSupportedError}}. - <li><p>If <var>result</var>'s <a>node document</a> is not <var>document</var>, <a>throw</a> a - {{NotSupportedError}} exception. + <li><p>If <var>result</var>'s <a>node document</a> is not <var>document</var>, then + <a>throw</a> a {{NotSupportedError}}. <li><p>If <var>result</var>'s <a for=Element>namespace</a> is not the <a>HTML namespace</a>, - <a>throw</a> a {{NotSupportedError}} exception. + then <a>throw</a> a {{NotSupportedError}}. <li><p>If <var>result</var>'s <a for=Element>local name</a> is not equal to - <var>localName</var>, <a>throw</a> a {{NotSupportedError}} exception. + <var>localName</var>, then <a>throw</a> a {{NotSupportedError}}. <li><p>Set <var>result</var>'s <a for=Element>namespace prefix</a> to <var>prefix</var>. @@ -5526,11 +5694,10 @@ given a <var>document</var>, <var>localName</var>, <var>prefix</var>, <var>names <var>A</var> is in its <a for=Element>attribute list</a>. -This specification uses and -<a lt="other applicable specifications">applicable specifications</a> can use the hooks an -<dfn export>attribute is set</dfn>, an <dfn export>attribute is changed</dfn>, an -<dfn export>attribute is added</dfn>, and an <dfn export>attribute is removed</dfn>, for -further processing of the <a>attribute</a>'s <a for=Attr>value</a>. +This and <a lt="other applicable specifications">other specifications</a> may define +<dfn id=concept-element-attributes-change-ext>attribute change steps</dfn> for +<a for=/>elements</a>. The algorithm is passed <var>element</var>, <var>localName</var>, +<var>oldValue</var>, <var>value</var>, and <var>namespace</var>. To <dfn export id=concept-element-attributes-change lt="change an attribute">change</dfn> an <a>attribute</a> <var>attribute</var> @@ -5551,11 +5718,12 @@ to <var>value</var>, run these steps: list containing <var>attribute</var>'s <a for=Attr>local name</a>, <var>attribute</var>'s <a for=Attr>value</a>, <var>value</var>, and <var>attribute</var>'s <a for=Attr>namespace</a>. + <li><p>Run the <a>attribute change steps</a> with <var>element</var>, <var>attribute</var>'s + <a for=Attr>local name</a>, <var>attribute</var>'s <a for=Attr>value</a>, <var>value</var>, and + <var>attribute</var>'s <a for=Attr>namespace</a>. + <li>Set <var>attribute</var>'s <a for=Attr>value</a> to <var>value</var>. - - <li>An <a>attribute is set</a> and an - <a>attribute is changed</a>. </ol> To <dfn export id=concept-element-attributes-append lt="append an attribute">append</dfn> an @@ -5576,14 +5744,15 @@ run these steps: list containing <var>attribute</var>'s <a for=Attr>local name</a>, null, <var>attribute</var>'s <a for=Attr>value</a>, and <var>attribute</var>'s <a for=Attr>namespace</a>. + <li><p>Run the <a>attribute change steps</a> with <var>element</var>, <var>attribute</var>'s + <a for=Attr>local name</a>, null, <var>attribute</var>'s <a for=Attr>value</a>, and + <var>attribute</var>'s <a for=Attr>namespace</a>. + <li>Append the <var>attribute</var> to the <var>element</var>'s <a for=Element>attribute list</a>. <li>Set <var>attribute</var>'s <a for=Attr>element</a> to <var>element</var>. - - <li>An <a>attribute is set</a> and an - <a>attribute is added</a>. </ol> To <dfn export id=concept-element-attributes-remove lt="remove an attribute">remove</dfn> an @@ -5605,14 +5774,16 @@ run these steps: list containing <var>attribute</var>'s <a for=Attr>local name</a>, <var>attribute</var>'s <a for=Attr>value</a>, null, and <var>attribute</var>'s <a for=Attr>namespace</a>. + <li><p>Run the <a>attribute change steps</a> with <var>element</var>, <var>attribute</var>'s + <a for=Attr>local name</a>, <var>attribute</var>'s <a for=Attr>value</a>, null, and + <var>attribute</var>'s <a for=Attr>namespace</a>. + <li>Remove <var>attribute</var> from the <var>element</var>'s <a for=Element>attribute list</a>. <li>Set <var>attribute</var>'s <a for=Attr>element</a> to null. - - <li>An <a>attribute is removed</a>. </ol> To <dfn export id=concept-element-attributes-replace lt="replace an attribute">replace</dfn> an @@ -5631,14 +5802,16 @@ in an <a for="/">element</a> <var>element</var>, run these steps: <a for=Attr>value</a>, <var>newAttr</var>'s <a for=Attr>value</a>, and <var>oldAttr</var>'s <a for=Attr>namespace</a>. + <li><p>Run the <a>attribute change steps</a> with <var>element</var>, <var>oldAttr</var>'s + <a for=Attr>local name</a>, <var>oldAttr</var>'s <a for=Attr>value</a>, <var>newAttr</var>'s + <a for=Attr>value</a>, and <var>oldAttr</var>'s <a for=Attr>namespace</a>. + <li><p>Replace <var>oldAttr</var> by <var>newAttr</var> in the <var>element</var>'s <a for=Element>attribute list</a>. <li><p>Set <var>oldAttr</var>'s <a for=Attr>element</a> to null. <li><p>Set <var>newAttr</var>'s <a for=Attr>element</a> to <var>element</var>. - - <li><p>An <a>attribute is set</a> and an <a>attribute is changed</a>. </ol> <hr> @@ -5778,24 +5951,15 @@ the HTML <code>id</code> <a>attribute</a> and a DTD. This specification makes <a concept of the DOM and allows for only one per <a for="/">element</a>, given by an <a lt="named attribute"><code>id</code> attribute</a>. -When an <a for="/">element</a> is created that -<a lt="has an attribute">has</a> an -<a lt="named attribute"><code>id</code> attribute</a> whose -<a for=Attr>value</a> is not the empty string or -when an <a for="/">element</a>'s -<a lt="named attribute"><code>id</code> attribute</a> is -<a lt="attribute is set">set</a> to a -<a for=Attr>value</a> other than the empty -string, set the <a for="/">element</a>'s -<a>ID</a> to the new -<a for=Attr>value</a>. +<p>Use these <a>attribute change steps</a> to update an <a for=/>element</a>'s <a>ID</a>: + +<ol> + <li><p>If <var>localName</var> is <code>id</code>, <var>namespace</var> is null, and + <var>value</var> is null or the empty string, then unset <var>element</var>'s <a>ID</a>. -When an <a for="/">element</a>'s -<a lt="named attribute"><code>id</code> attribute</a> is -<a lt="attribute is removed">removed</a> or -<a lt="attribute is set">set</a> to the empty string, unset the -<a for="/">element</a>'s -<a>ID</a>. + <li><p>Otherwise, if <var>localName</var> is <code>id</code>, <var>namespace</var> is null, then + set <var>element</var>'s <a>ID</a> to <var>value</var>. +</ol> <p class="note no-backref">While this specification defines requirements for <code>class</code>, <code>id</code>, and <code>slot</code> <a>attributes</a> on any <a for="/">element</a>, it makes no @@ -5937,7 +6101,7 @@ method, when invoked, must run these steps: <ol> <li><p>If <var>qualifiedName</var> does not match the <code><a type>Name</a></code> production in - XML, <a>throw</a> an {{InvalidCharacterError}} exception. + XML, then <a>throw</a> an {{InvalidCharacterError}}. <li><p>If the <a>context object</a> is in the <a>HTML namespace</a> and its <a>node document</a> is an <a>HTML document</a>, let <var>qualifiedName</var> be <a>converted to ASCII lowercase</a>. @@ -6032,14 +6196,12 @@ The method, when invoked, must run these steps: <ol> - <li>If <var>attr</var> is not in <a>context object</a>'s - <a for=Element>attribute list</a>, - <a>throw</a> a {{NotFoundError}} exception. + <li><p>If <var>attr</var> is not in <a>context object</a>'s <a for=Element>attribute list</a>, then + <a>throw</a> a {{NotFoundError}}. - <li><a lt="remove an attribute">Remove</a> <var>attr</var> - from <a>context object</a>. + <li><p><a lt="remove an attribute">Remove</a> <var>attr</var> from <a>context object</a>. - <li>Return <var>attr</var>. + <li><p>Return <var>attr</var>. </ol> <hr> @@ -6057,9 +6219,11 @@ method, when invoked, must run these steps: invoked, must run these steps: <ol> - <li><p>If <a>context object</a> is not a <span class=XXX>custom element</span>, and is not an - <a for=/>element</a> whose <a for=Element>namespace</a> is the <a>HTML namespace</a> and - <a for=Element>local name</a> is + <li><p>If <a>context object</a>'s <a for=Element>namespace</a> is <em>not</em> the + <a>HTML namespace</a>, then <a>throw</a> a {{NotSupportedError}}. + + <li><p>If <a>context object</a>'s <a for=Element>local name</a> is <em>not</em> a + <a>valid custom element name</a>, "<code>article</code>", "<code>aside</code>", "<code>blockquote</code>", @@ -6076,10 +6240,10 @@ invoked, must run these steps: "<code>nav</code>", "<code>p</code>", "<code>section</code>", or - "<code>span</code>", then throw a {{NotSupportedError}} exception. + "<code>span</code>", then <a>throw</a> a {{NotSupportedError}}. - <li><p>If <a>context object</a>'s <a for=Element>shadow root</a> is non-null, then throw an - {{InvalidStateError}} exception. + <li><p>If <a>context object</a> is a <a for=Element>shadow host</a>, then <a>throw</a> an + {{InvalidStateError}}. <li><p>Let <var>shadow</var> be a new <a for=/>shadow root</a> whose <a>node document</a> is <a>context object</a>'s <a>node document</a>, <a for=DocumentFragment>host</a> is @@ -6208,7 +6372,7 @@ for the <a>context object</a>. <a>parent</a> before <var>element</var>'s <a for=tree>next sibling</a>. Rethrow any exceptions. <dt>Otherwise</dt> - <dd><p>Throw a {{SyntaxError}} exception. + <dd><p><a>Throw</a> a {{SyntaxError}}. </dl> <p>The @@ -6221,7 +6385,8 @@ method, when invoked, must return the result of running <a>insert adjacent</a>, method, when invoked, must run these steps: <ol> - <li><p>Let <var>text</var> be a new <code>Text</code> object whose <a>data</a> is <var>data</var>. + <li><p>Let <var>text</var> be a new {{Text}} <a>node</a> whose <a>data</a> is <var>data</var> and + <a>node document</a> is <a>context object</a>'s <a>node document</a>. <li><p>Run <a>insert adjacent</a>, given <a>context object</a>, <var>where</var>, and <var>text</var>. Rethrow any exceptions. @@ -6239,10 +6404,10 @@ interface NamedNodeMap { getter Attr? item(unsigned long index); getter Attr? getNamedItem(DOMString qualifiedName); Attr? getNamedItemNS(DOMString? namespace, DOMString localName); - Attr? setNamedItem(Attr attr); - Attr? setNamedItemNS(Attr attr); - Attr removeNamedItem(DOMString qualifiedName); - Attr removeNamedItemNS(DOMString? namespace, DOMString localName); + [CEReactions] Attr? setNamedItem(Attr attr); + [CEReactions] Attr? setNamedItemNS(Attr attr); + [CEReactions] Attr removeNamedItem(DOMString qualifiedName); + [CEReactions] Attr removeNamedItemNS(DOMString? namespace, DOMString localName); }; </pre> @@ -6328,8 +6493,7 @@ method, when invoked, must run these steps: <a lt="remove an attribute by name">removing an attribute</a> given <var>qualifiedName</var> and <a for=NamedNodeMap>element</a>. - <li><p>If <var>attr</var> is null, <a>throw</a> a - {{NotFoundError}} exception. + <li><p>If <var>attr</var> is null, then <a>throw</a> a {{NotFoundError}}. <li><p>Return <var>attr</var>. </ol> @@ -6343,7 +6507,7 @@ method, when invoked, must run these steps: <a lt="remove an attribute by namespace and local name">removing an attribute</a> given <var>namespace</var>, <var>localName</var>, and <a for=NamedNodeMap>element</a>. - <li><p>If <var>attr</var> is null, <a>throw</a> a {{NotFoundError}} exception. + <li><p>If <var>attr</var> is null, then <a>throw</a> a {{NotFoundError}}. <li><p>Return <var>attr</var>. </ol> @@ -6359,9 +6523,9 @@ interface Attr { readonly attribute DOMString localName; readonly attribute DOMString name; readonly attribute DOMString nodeName; // historical alias of .name - attribute DOMString value; - [TreatNullAs=EmptyString] attribute DOMString nodeValue; // historical alias of .value - [TreatNullAs=EmptyString] attribute DOMString textContent; // historical alias of .value + [CEReactions] attribute DOMString value; + [CEReactions, TreatNullAs=EmptyString] attribute DOMString nodeValue; // historical alias of .value + [CEReactions, TreatNullAs=EmptyString] attribute DOMString textContent; // historical alias of .value readonly attribute Element? ownerElement; @@ -6383,7 +6547,8 @@ to as <em>content attributes</em> to avoid confusion with IDL attributes. <p class="note no-backref">If designed today they would just have a name and value. ☹ -<p>An <a>attribute</a>'s <dfn id=concept-attribute-qualified-name for=Attr>qualified name</dfn> is its +<p>An <a>attribute</a>'s +<dfn export id=concept-attribute-qualified-name for=Attr>qualified name</dfn> is its <a for=Attr>local name</a> if its <a for=Attr>namespace prefix</a> is null, and its <a for=Attr>namespace prefix</a>, followed by "<code>:</code>", followed by its <a for=Attr>local name</a>, otherwise. @@ -6485,9 +6650,8 @@ To <dfn export for="CharacterData, Text, Comment, ProcessingInstruction" id=conc <li>Let <var>length</var> be <var>node</var>'s {{CharacterData/length}} attribute value. - <li>If <var>offset</var> is greater than <var>length</var>, - <a>throw</a> an - {{IndexSizeError}} exception. + <li>If <var>offset</var> is greater than <var>length</var>, then <a>throw</a> an + {{IndexSizeError}}. <li>If <var>offset</var> plus <var>count</var> is greater than <var>length</var> let <var>count</var> be @@ -6584,9 +6748,8 @@ To <dfn export for="CharacterData, Text, Comment, ProcessingInstruction" id=conc <li>Let <var>length</var> be <var>node</var>'s {{CharacterData/length}} attribute value. - <li>If <var>offset</var> is greater than <var>length</var>, - <a>throw</a> an - {{IndexSizeError}} exception. + <li>If <var>offset</var> is greater than <var>length</var>, then <a>throw</a> an + {{IndexSizeError}}. <li>If <var>offset</var> plus <var>count</var> is greater than <var>length</var>, return a string whose value is the @@ -6678,9 +6841,8 @@ To <dfn export id=concept-text-split lt="split a Text node">split</dfn> a {{Text <li>Let <var>length</var> be <var>node</var>'s {{CharacterData/length}} attribute value. - <li>If <var>offset</var> is greater than <var>length</var>, - <a>throw</a> an - {{IndexSizeError}} exception. + <li>If <var>offset</var> is greater than <var>length</var>, then <a>throw</a> an + {{IndexSizeError}}. <li>Let <var>count</var> be <var>length</var> minus <var>offset</var>. @@ -6949,11 +7111,11 @@ interface Range { const unsigned short END_TO_START = 3; short compareBoundaryPoints(unsigned short how, Range sourceRange); - void deleteContents(); - [NewObject] DocumentFragment extractContents(); - [NewObject] DocumentFragment cloneContents(); - void insertNode(Node node); - void surroundContents(Node newParent); + [CEReactions] void deleteContents(); + [CEReactions, NewObject] DocumentFragment extractContents(); + [CEReactions, NewObject] DocumentFragment cloneContents(); + [CEReactions] void insertNode(Node node); + [CEReactions] void surroundContents(Node newParent); [NewObject] Range cloneRange(); void detach(); @@ -7244,15 +7406,10 @@ To <dfn export id=concept-range-bp-set lt="set the start|set the end" for=Range> (<var>node</var>, <var>offset</var>), run these steps: <ol> - <li>If <var>node</var> is a - <a>doctype</a>, - <a>throw</a> an - {{InvalidNodeTypeError}} exception. + <li>If <var>node</var> is a <a>doctype</a>, then <a>throw</a> an {{InvalidNodeTypeError}}. - <li>If <var>offset</var> is greater than - <var>node</var>'s <a>length</a>, - <a>throw</a> an - {{IndexSizeError}} exception. + <li>If <var>offset</var> is greater than <var>node</var>'s <a>length</a>, then <a>throw</a> an + {{IndexSizeError}}. <li>Let <var>bp</var> be the <a>boundary point</a> @@ -7315,9 +7472,7 @@ method must run these steps: <li>Let <var>parent</var> be <var>node</var>'s <a>parent</a>. - <li>If <var>parent</var> is null, - <a>throw</a> an - {{InvalidNodeTypeError}} exception. + <li>If <var>parent</var> is null, then <a>throw</a> an {{InvalidNodeTypeError}}. <li><a>Set the start</a> of the <a>context object</a> to @@ -7334,9 +7489,7 @@ method must run these steps: <li>Let <var>parent</var> be <var>node</var>'s <a>parent</a>. - <li>If <var>parent</var> is null, - <a>throw</a> an - {{InvalidNodeTypeError}} exception. + <li>If <var>parent</var> is null, then <a>throw</a> an {{InvalidNodeTypeError}}. <li><a>Set the start</a> of the <a>context object</a> to @@ -7353,9 +7506,7 @@ method must run these steps: <li>Let <var>parent</var> be <var>node</var>'s <a>parent</a>. - <li>If <var>parent</var> is null, - <a>throw</a> an - {{InvalidNodeTypeError}} exception. + <li>If <var>parent</var> is null, then <a>throw</a> an {{InvalidNodeTypeError}}. <li><a>Set the end</a> of the <a>context object</a> to @@ -7371,9 +7522,7 @@ method must run these steps: <li>Let <var>parent</var> be <var>node</var>'s <a>parent</a>. - <li>If <var>parent</var> is null, - <a>throw</a> an - {{InvalidNodeTypeError}} exception. + <li>If <var>parent</var> is null, then <a>throw</a> an {{InvalidNodeTypeError}}. <li><a>Set the end</a> of the <a>context object</a> to @@ -7441,15 +7590,16 @@ method must run these steps: <ol> <li> - If <var>how</var> is not one of - <ul> + <p>If <var>how</var> is not one of + + <ul class=brief> <li>{{Range/START_TO_START}}, <li>{{Range/START_TO_END}}, <li>{{Range/END_TO_END}}, and <li>{{Range/END_TO_START}}, </ul> - <a>throw</a> a - {{NotSupportedError}} exception. + + <p>then <a>throw</a> a {{NotSupportedError}}. <!-- Apparent behaviors from black-box testing: @@ -7471,11 +7621,8 @@ method must run these steps: Opera) instead of a nonstandard exception type. --> - <li>If <a>context object</a>'s - <a for=Range>root</a> is not the same as - <var>sourceRange</var>'s <a for=Range>root</a>, - <a>throw</a> a - {{WrongDocumentError}} exception. + <li>If <a>context object</a>'s <a for=Range>root</a> is not the same as <var>sourceRange</var>'s + <a for=Range>root</a>, then <a>throw</a> a {{WrongDocumentError}}. <li> If <var>how</var> is: @@ -7722,9 +7869,8 @@ To <dfn export id=concept-range-extract lt="extract a range" local-lt="extract"> <var>range</var>, in <a>tree order</a>. <li> - If any member of <var>contained children</var> is a - <a>doctype</a>, <a>throw</a> a - {{HierarchyRequestError}} exception. + <p>If any member of <var>contained children</var> is a <a>doctype</a>, then <a>throw</a> a + {{HierarchyRequestError}}. <!-- Firefox 4.0 actually removes the non-DocumentType nodes before throwing the exception. Opera 11.00 removes the DocumentType too, and doesn't throw. I go with IE9 and Chrome 12 dev, which don't remove any @@ -7986,9 +8132,8 @@ of a <a>range</a> <var>range</var>, run these steps: <var>range</var>, in <a>tree order</a>. <li> - If any member of <var>contained children</var> is a - <a>doctype</a>, <a>throw</a> a - {{HierarchyRequestError}} exception. + <p>If any member of <var>contained children</var> is a <a>doctype</a>, then <a>throw</a> a + {{HierarchyRequestError}}. <p class="note no-backref">We do not have to worry about the first or last partially contained node, because a <a>doctype</a> can never be @@ -8117,10 +8262,9 @@ To <dfn export id=concept-range-insert for=Range>insert</dfn> a <a>node</a> <var>range</var>, run these steps: <ol> - <li>If <var>range</var>'s <a>start node</a> - is a {{ProcessingInstruction}} or {{Comment}} <a>node</a>, is a {{Text}} - <a>node</a> whose <a>parent</a> is null, or is <var>node</var>, <a>throw</a> - an {{HierarchyRequestError}} exception. + <li>If <var>range</var>'s <a>start node</a> is a {{ProcessingInstruction}} or {{Comment}} + <a>node</a>, is a {{Text}} <a>node</a> whose <a>parent</a> is null, or is <var>node</var>, then + <a>throw</a> a {{HierarchyRequestError}}. <!-- Behavior for Text node with null parent: @@ -8243,8 +8387,7 @@ check first thing, which matches everyone but Firefox. <ol> <li>If a non-{{Text}} <a>node</a> is <a>partially contained</a> in the <a>context object</a>, - <a>throw</a> an - {{InvalidStateError}} exception. + then <a>throw</a> an {{InvalidStateError}}. <!-- Makes some sense: otherwise we'd clone a bunch of containers, which is unexpected. --> <!-- XXX Could we rephrase this condition to be more algorithmic and less @@ -8253,8 +8396,7 @@ check first thing, which matches everyone but Firefox. <li>If <var>newParent</var> is a {{Document}}, {{DocumentType}}, or {{DocumentFragment}} <a>node</a>, - <a>throw</a> an - {{InvalidNodeTypeError}} exception. + then <a>throw</a> an {{InvalidNodeTypeError}}. <!-- But for Comment, Text, and ProcessingInstruction, we just fall through and throw a HIERARCHY_REQUEST_ERR when we try appendChild(). This makes absolutely no sense, but it's what DOM 2 Range specifies, and it's what @@ -8336,20 +8478,15 @@ must run these steps: <!-- This happens even if the offset is negative or too large, or if the node is a doctype, in both Firefox 9.0a2 and Chrome 16 dev. --> - <li>If <var>node</var> is a - <a>doctype</a>, - <a>throw</a> an - {{InvalidNodeTypeError}} exception. + <li>If <var>node</var> is a <a>doctype</a>, then <a>throw</a> an {{InvalidNodeTypeError}}. <!-- Firefox 9.0a2 doesn't throw. It ignores the offset and returns true or false depending on whether the doctype itself is in the range. This makes some sense, but it doesn't match how other Range APIs handle doctypes, and having the second argument mandatory but ignored is just weird. Thus I go with Chrome 16 dev, although I can see the merit in how Gecko works here. --> - <li>If <var>offset</var> is greater than - <var>node</var>'s <a>length</a>, - <a>throw</a> an - {{IndexSizeError}} exception. + <li>If <var>offset</var> is greater than <var>node</var>'s <a>length</a>, then <a>throw</a> an + {{IndexSizeError}}. <!-- Firefox 9.0a2 doesn't throw. It seems to return true if the node is completely contained in the range, like with selectNode(), and false otherwise - even if all boundary points in the node are contained in the range, like @@ -8374,26 +8511,18 @@ method must run these steps: and Opera Next 12.00 alpha all do. --> <ol> - <li>If <var>node</var>'s <a for=tree>root</a> is - different from the <a>context object</a>'s - <a for=Range>root</a>, - <a>throw</a> a {{WrongDocumentError}} - exception. + <li>If <var>node</var>'s <a for=tree>root</a> is different from the <a>context object</a>'s + <a for=Range>root</a>, then <a>throw</a> a {{WrongDocumentError}}. <!-- Opera Next 12.00 alpha seems to return -1 in this case. The spec matches Firefox 12.0a1 and Chrome 17 dev. --> - <li>If <var>node</var> is a - <a>doctype</a>, - <a>throw</a> an - {{InvalidNodeTypeError}} exception. + <li>If <var>node</var> is a <a>doctype</a>, then <a>throw</a> an {{InvalidNodeTypeError}}. <!-- This matches Chrome 17 dev instead of Firefox 12.0a1 and Opera Next 12.00 alpha, which don't throw and seem to just ignore the offset instead. See comment for isPointInRange(). --> - <li>If <var>offset</var> is greater than - <var>node</var>'s <a>length</a>, - <a>throw</a> an - {{IndexSizeError}} exception. + <li>If <var>offset</var> is greater than <var>node</var>'s <a>length</a>, then <a>throw</a> an + {{IndexSizeError}}. <!-- This matches Chrome 17 dev instead of Firefox 12.0a1 and Opera Next 12.00 alpha, which don't throw. See comment for isPointInRange(). --> @@ -8586,11 +8715,10 @@ The <dfn><code>NodeIterator</code> pre-removing steps</dfn> given a <p class="note no-backref">Steps are not terminated here. </ol> - <li><p>Set <var>nodeIterator</var>'s {{NodeIterator/referenceNode}} attribute to the - <a>inclusive descendant</a> of <var>toBeRemovedNode</var>'s <a>previous sibling</a> that - appears last in <a>tree order</a>, if <var>toBeRemovedNode</var>'s - <a>previous sibling</a> is non-null, and to <var>toBeRemovedNode</var>'s <a>parent</a> - otherwise. + <li><p>Set <var>nodeIterator</var>'s {{NodeIterator/referenceNode}} attribute to + <var>toBeRemovedNode</var>'s <a>parent</a>, if <var>toBeRemovedNode</var>'s <a>previous sibling</a> + is null, and to the <a>inclusive descendant</a> of <var>toBeRemovedNode</var>'s + <a>previous sibling</a> that appears last in <a>tree order</a> otherwise. </ol> <hr> @@ -8632,7 +8760,7 @@ To <dfn export id=concept-nodeiterator-traverse for="NodeIterator">traverse</dfn If <var>before node</var> is false, let <var>node</var> be the first <a>node</a> <a>following</a> - <var>node</var> in the <span>iterator collection</span>. If + <var>node</var> in the <a>iterator collection</a>. If there is no such <a>node</a> return null. If <var>before node</var> is true, set it to false. <dt>If <var>direction</var> is previous @@ -8640,7 +8768,7 @@ To <dfn export id=concept-nodeiterator-traverse for="NodeIterator">traverse</dfn If <var>before node</var> is true, let <var>node</var> be the first <a>node</a> <a>preceding</a> - <var>node</var> in the <span>iterator collection</span>. If + <var>node</var> in the <a>iterator collection</a>. If there is no such <a>node</a> return null. If <var>before node</var> is false, set it to true. </dl> @@ -9105,12 +9233,12 @@ interface DOMTokenList { readonly attribute unsigned long length; getter DOMString? item(unsigned long index); boolean contains(DOMString token); - void add(DOMString... tokens); - void remove(DOMString... tokens); - boolean toggle(DOMString token, optional boolean force); - void replace(DOMString token, DOMString newToken); + [CEReactions] void add(DOMString... tokens); + [CEReactions] void remove(DOMString... tokens); + [CEReactions] boolean toggle(DOMString token, optional boolean force); + [CEReactions] void replace(DOMString token, DOMString newToken); boolean supports(DOMString token); - attribute DOMString value; + [CEReactions] attribute DOMString value; stringifier; iterable<DOMString>; }; @@ -9153,17 +9281,33 @@ are to return the result of running <a>get an attribute value</a> given the asso <hr> -<p>When a {{DOMTokenList}} object is created and its associated <a for="/">element</a> -<a lt="has an attribute">has</a> an -<a lt="named attribute"><var>associated attribute's local name</var> attribute</a> or -associated <a for="/">element</a>'s -<a lt="named attribute"><var>associated attribute's local name</var> attribute</a> is -<a lt="attribute is set">set</a>, set <a>tokens</a> to the new <a for=Attr>value</a>, -<a lt="ordered set parser">parsed</a>. +<p>A {{DOMTokenList}} object has these <a>attribute change steps</a> for its associated +<a for=/>element</a>: + +<ol> + <li><p>If <var>localName</var> is associated attribute's <a for=Attr>local name</a>, + <var>namespace</var> is null, and <var>value</var> is null, then set <a>tokens</a> to the empty + set. + + <li><p>Otherwise, <var>localName</var> is associated attribute's <a for=Attr>local name</a>, + <var>namespace</var> is null, then set <a>tokens</a> to <var>value</var>, + <a lt="ordered set parser">parsed</a>. +</ol> + +<p>When a {{DOMTokenList}} object is created, run these substeps: + +<ol> + <li><p>Let <var>element</var> be associated <a for=/>element</a>. -<p>When an associated <a for="/">element</a>'s -<a lt="named attribute"><var>associated attribute's local name</var> attribute</a> is -<a lt="attribute is removed">removed</a>, set <a>tokens</a> to the empty set. + <li><p>Let <var>localName</var> be associated attribute's <a for=Attr>local name</a>. + + <li><p>Let <var>value</var> be the result of + <a lt="get an attribute by namespace and local name">getting an attribute</a> given null, + <var>localName</var>, and <var>element</var>. + + <li><p>Run the <a>attribute change steps</a> for <var>element</var>, <var>localName</var>, + <var>value</var>, <var>value</var>, and null. +</ol> <dl class="domintro"> <dt><code><var>tokenlist</var> . {{DOMTokenList/length}}</code> @@ -9179,15 +9323,15 @@ associated <a for="/">element</a>'s <dt><code><var>tokenlist</var> . <a for=DOMTokenList lt="add()">add(<var>tokens</var>…)</a></code> <dd> <p>Adds all arguments passed, except those already present. - <p>Throws a {{SyntaxError}} exception if one of the arguments is the empty string. - <p>Throws an {{InvalidCharacterError}} exception if one of the arguments contains any + <p>Throws a {{SyntaxError}} if one of the arguments is the empty string. + <p>Throws an {{InvalidCharacterError}} if one of the arguments contains any <a>ASCII whitespace</a>. <dt><code><var>tokenlist</var> . <a for=DOMTokenList lt="remove()">remove(<var>tokens</var>…)</a></code> <dd> <p>Removes arguments passed, if they are present. - <p>Throws a {{SyntaxError}} exception if one of the arguments is the empty string. - <p>Throws an {{InvalidCharacterError}} exception if one of the arguments contains any + <p>Throws a {{SyntaxError}} if one of the arguments is the empty string. + <p>Throws an {{InvalidCharacterError}} if one of the arguments contains any <a>ASCII whitespace</a>. <dt><code><var>tokenlist</var> . <a method for=DOMTokenList lt="toggle()">toggle(<var>token</var> [, <var>force</var>])</a></code> @@ -9197,21 +9341,21 @@ associated <a for="/">element</a>'s (same as {{add()}}). If <var>force</var> is false, removes <var>token</var> (same as {{DOMTokenList/remove()}}). <p>Returns true if <var>token</var> is now present, and false otherwise. - <p>Throws a {{SyntaxError}} exception if <var>token</var> is empty. - <p>Throws an {{InvalidCharacterError}} exception if <var>token</var> contains any spaces. + <p>Throws a {{SyntaxError}} if <var>token</var> is empty. + <p>Throws an {{InvalidCharacterError}} if <var>token</var> contains any spaces. <dt><code><var>tokenlist</var> . <a method for=DOMTokenList lt=replace()>replace(<var>token</var>, <var>newToken</var>)</a></code> <dd> <p>Replaces <var>token</var> with <var>newToken</var>. - <p>Throws a {{SyntaxError}} exception if one of the arguments is the empty string. - <p>Throws an {{InvalidCharacterError}} exception if one of the arguments contains any + <p>Throws a {{SyntaxError}} if one of the arguments is the empty string. + <p>Throws an {{InvalidCharacterError}} if one of the arguments contains any <a>ASCII whitespace</a>. <dt><code><var>tokenlist</var> . <a method for=DOMTokenList lt="supports()">supports(<var>token</var>)</a></code> <dd> <p>Returns true if <var>token</var> is in the associated attribute's supported tokens. Returns false otherwise. - <p>Throws a <code>TypeError</code> exception if the associated attribute has no supported tokens defined. + <p>Throws a <code>TypeError</code> if the associated attribute has no supported tokens defined. <dt><code><var>tokenlist</var> . {{DOMTokenList/value}}</code> <dd> @@ -9248,10 +9392,10 @@ method, when invoked, must run these steps: <p>For each <var>token</var> in <var>tokens</var>, run these substeps: <ol> - <li><p>If <var>token</var> is the empty string, <a>throw</a> a {{SyntaxError}} exception. + <li><p>If <var>token</var> is the empty string, then <a>throw</a> a {{SyntaxError}}. - <li><p>If <var>token</var> contains any <a>ASCII whitespace</a>, <a>throw</a> an - {{InvalidCharacterError}} exception. + <li><p>If <var>token</var> contains any <a>ASCII whitespace</a>, then <a>throw</a> an + {{InvalidCharacterError}}. </ol> <li><p>For each <var>token</var> in <var>tokens</var>, in given order, that is not in @@ -9269,10 +9413,10 @@ method, when invoked, must run these steps: <p>For each <var>token</var> in <var>tokens</var>, run these substeps: <ol> - <li><p>If <var>token</var> is the empty string, <a>throw</a> a {{SyntaxError}} exception. + <li><p>If <var>token</var> is the empty string, then <a>throw</a> a {{SyntaxError}}. - <li><p>If <var>token</var> contains any <a>ASCII whitespace</a>, <a>throw</a> an - {{InvalidCharacterError}} exception. + <li><p>If <var>token</var> contains any <a>ASCII whitespace</a>, then <a>throw</a> an + {{InvalidCharacterError}}. </ol> <li><p>For each <var>token</var> in <var>tokens</var>, remove <var>token</var> from <a>tokens</a>. @@ -9284,10 +9428,10 @@ method, when invoked, must run these steps: method, when invoked, must run these steps: <ol> - <li><p>If <var>token</var> is the empty string, <a>throw</a> a {{SyntaxError}} exception. + <li><p>If <var>token</var> is the empty string, then <a>throw</a> a {{SyntaxError}}. - <li><p>If <var>token</var> contains any <a>ASCII whitespace</a>, <a>throw</a> an - {{InvalidCharacterError}} exception. + <li><p>If <var>token</var> contains any <a>ASCII whitespace</a>, then <a>throw</a> an + {{InvalidCharacterError}}. <li> <p>If <var>token</var> is in <a>tokens</a>, run these substeps: @@ -9316,11 +9460,11 @@ method, when invoked, must run these steps: <!-- Argument order based on String.prototype.replace(), not replaceChild() --> <ol> - <li><p>If either <var>token</var> or <var>newToken</var> is the empty string, <a>throw</a> a - {{SyntaxError}} exception. + <li><p>If either <var>token</var> or <var>newToken</var> is the empty string, then <a>throw</a> a + {{SyntaxError}}. - <li><p>If either <var>token</var> or <var>newToken</var> contains any <a>ASCII whitespace</a>, - <a>throw</a> an {{InvalidCharacterError}} exception. + <li><p>If either <var>token</var> or <var>newToken</var> contains any <a>ASCII whitespace</a>, then + <a>throw</a> an {{InvalidCharacterError}}. <li><p>If <var>token</var> is not in <a>tokens</a>, terminate these steps. @@ -9565,6 +9709,7 @@ making this standard what it is today. With that, many thanks to Adam Klein, Adrian Bateman, +Aleksey Shvayka, Alex Komoroske, Alex Russell, Anthony Ramine, @@ -9619,6 +9764,7 @@ Jake Verbaten, James Graham, James Greene, James Robinson, +Jeffrey Yasskin, Jens Lindström, Jesse McCarthy, João Eiras, @@ -9665,7 +9811,6 @@ Ryosuke Niwa, Sam Dutton, Samuel Giles, Sebastian Mayr, -<i>senolv</i>, Seo Sanghyeon, Sergey G. Grekhov, Shiki Okasaka, @@ -9682,6 +9827,7 @@ Tobie Langel, Tom Pixley, Travis Leithead, <i>triple-underscore</i>,<!--GitHub--> +Veli Şenol, Vidur Apparao, Warren He, Yehuda Katz, diff --git a/dom.html b/dom.html index 39cf0f767..3d8783ded 100644 --- a/dom.html +++ b/dom.html @@ -71,7 +71,7 @@ <p data-fill-with="logo"><a class="logo" href="https://whatwg.org/"> <img alt="WHATWG" height="100" src="https://resources.whatwg.org/logo-dom.svg"> </a> </p> <hgroup> <h1 class="p-name no-ref allcaps" id="title">DOM</h1> - <h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Living Standard — Last Updated <time class="dt-updated" datetime="2016-04-13">13 April 2016</time></span></h2> + <h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Living Standard — Last Updated <time class="dt-updated" datetime="2016-04-27">27 April 2016</time></span></h2> </hgroup> <div data-fill-with="spec-metadata"> <dl> @@ -81,6 +81,8 @@ <h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="cont <dt>Commits: <dd><span><a href="https://github.com/whatwg/dom/commits">GitHub whatwg/dom/commits</a></span> <dd><span><a href="https://twitter.com/thedomstandard">@thedomstandard</a></span> + <dt>Translation (non-normative): + <dd><span><span title="Japanese"><a href="https://triple-underscore.github.io/DOM4-ja.html" hreflang="ja" lang="ja" rel="alternate">日本語</a></span></span> </dl> </div> <div data-fill-with="warning"></div> @@ -136,6 +138,8 @@ <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2> <li><a href="#shadow-tree-slots"><span class="secno">4.2.2.1</span> <span class="content">Slots</span></a> <li><a href="#light-tree-slotables"><span class="secno">4.2.2.2</span> <span class="content">Slotables</span></a> <li><a href="#finding-slots-and-slotables"><span class="secno">4.2.2.3</span> <span class="content">Finding slots and slotables</span></a> + <li><a href="#assigning-slotables-and-slots"><span class="secno">4.2.2.4</span> <span class="content">Assigning slotables and slots</span></a> + <li><a href="#signaling-slot-change"><span class="secno">4.2.2.5</span> <span class="content">Signaling slot change</span></a> </ol> <li><a href="#mutation-algorithms"><span class="secno">4.2.3</span> <span class="content">Mutation algorithms</span></a> <li><a href="#interface-nonelementparentnode"><span class="secno">4.2.4</span> <span class="content">Mixin <code class="idl"><span>NonElementParentNode</span></code></span></a> @@ -292,7 +296,7 @@ <h2 class="heading settled" data-level="2" id="terminology"><span class="secno"> <h3 class="heading settled" data-level="2.1" id="trees"><span class="secno">2.1. </span><span class="content">Trees</span><a class="self-link" href="#trees"></a></h3> <p>A <dfn data-dfn-type="dfn" data-export="" id="concept-tree">tree<a class="self-link" href="#concept-tree"></a></dfn> is a finite hierarchical tree structure. In <dfn data-dfn-type="dfn" data-export="" id="concept-tree-order">tree order<a class="self-link" href="#concept-tree-order"></a></dfn> is preorder, depth-first traversal of a <a data-link-type="dfn" href="#concept-tree">tree</a>.</p> - <p>An object that <dfn data-dfn-for="tree" data-dfn-type="dfn" data-export="" data-lt="participate" id="concept-tree-participate">participates<a class="self-link" href="#concept-tree-participate"></a></dfn> in + <p>An object that <dfn data-dfn-for="tree" data-dfn-type="dfn" data-export="" data-lt="participate|participate in a tree|participates in a tree" id="concept-tree-participate">participates<a class="self-link" href="#concept-tree-participate"></a></dfn> in a <a data-link-type="dfn" href="#concept-tree">tree</a> has a <dfn data-dfn-for="tree" data-dfn-type="dfn" data-export="" id="concept-tree-parent">parent<a class="self-link" href="#concept-tree-parent"></a></dfn>, which is either another object or null, and an ordered list of zero or more <dfn data-dfn-for="tree" data-dfn-type="dfn" data-export="" data-lt="child|children" id="concept-tree-child">child<a class="self-link" href="#concept-tree-child"></a></dfn> objects. An object <var>A</var> whose <a data-link-type="dfn" href="#concept-tree-parent">parent</a> is object <var>B</var> is a <a data-link-type="dfn" href="#concept-tree-child">child</a> of <var>B</var>.</p> <p>The <dfn data-dfn-for="tree" data-dfn-type="dfn" data-export="" id="concept-tree-root">root<a class="self-link" href="#concept-tree-root"></a></dfn> of an object is itself, if its <a data-link-type="dfn" href="#concept-tree-parent">parent</a> is null, or else it is the <a data-link-type="dfn" href="#concept-tree-root">root</a> of its <a data-link-type="dfn" href="#concept-tree-parent">parent</a>. The <a data-link-type="dfn" href="#concept-tree-root">root</a> of a <a data-link-type="dfn" href="#concept-tree">tree</a> is any object <a data-link-type="dfn" href="#concept-tree-participate">participating</a> in that <a data-link-type="dfn" href="#concept-tree">tree</a> whose <a data-link-type="dfn" href="#concept-tree-parent">parent</a> is null. </p> @@ -385,12 +389,17 @@ <h3 class="heading settled" data-level="2.4" id="selectors"><span class="secno"> added. </p> <h3 class="heading settled" data-level="2.5" id="namespaces"><span class="secno">2.5. </span><span class="content">Namespaces</span><a class="self-link" href="#namespaces"></a></h3> <p>The <dfn data-dfn-type="dfn" data-export="" id="html-namespace">HTML namespace<a class="self-link" href="#html-namespace"></a></dfn> is <code>http://www.w3.org/1999/xhtml</code>.</p> + <p>The <dfn data-dfn-type="dfn" data-export="" id="svg-namespace">SVG namespace<a class="self-link" href="#svg-namespace"></a></dfn> is <code>http://www.w3.org/2000/svg</code>.</p> <p>The <dfn data-dfn-type="dfn" data-export="" id="xml-namespace">XML namespace<a class="self-link" href="#xml-namespace"></a></dfn> is <code>http://www.w3.org/XML/1998/namespace</code>.</p> <p>The <dfn data-dfn-type="dfn" data-export="" id="xmlns-namespace">XMLNS namespace<a class="self-link" href="#xmlns-namespace"></a></dfn> is <code>http://www.w3.org/2000/xmlns/</code>.</p> <p>To <dfn data-dfn-type="dfn" data-export="" id="validate">validate<a class="self-link" href="#validate"></a></dfn> a <var>qualifiedName</var>, run these steps:</p> <ol> - <li>If <var>qualifiedName</var> does not match the <code><a class="css" data-link-type="type" href="https://www.w3.org/TR/xml/#NT-Name">Name</a></code> production, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code> exception. - <li>If <var>qualifiedName</var> does not match the <code><a class="css" data-link-type="type" href="https://www.w3.org/TR/xml-names/#NT-QName">QName</a></code> production, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#namespaceerror">NamespaceError</a></code> exception. + <li> + <p>If <var>qualifiedName</var> does not match the <code><a class="css" data-link-type="type" href="https://www.w3.org/TR/xml/#NT-Name">Name</a></code> production, + then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code>. </p> + <li> + <p>If <var>qualifiedName</var> does not match the <code><a class="css" data-link-type="type" href="https://www.w3.org/TR/xml-names/#NT-QName">QName</a></code> production, + then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#namespaceerror">NamespaceError</a></code>. </p> </ol> <p>To <dfn data-dfn-type="dfn" data-export="" id="validate-and-extract">validate and extract<a class="self-link" href="#validate-and-extract"></a></dfn> a <var>namespace</var> and <var>qualifiedName</var>, run these steps:</p> @@ -402,12 +411,11 @@ <h3 class="heading settled" data-level="2.5" id="namespaces"><span class="secno" <li>If <var>qualifiedName</var> contains a "<code>:</code>" (U+003E), then split the string on it and set <var>prefix</var> to the part before and <var>localName</var> to the part after. - <li>If <var>prefix</var> is non-null and <var>namespace</var> is null, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#namespaceerror">NamespaceError</a></code> exception. - <li>If <var>prefix</var> is "<code>xml</code>" and <var>namespace</var> is - not the <a data-link-type="dfn" href="#xml-namespace">XML namespace</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#namespaceerror">NamespaceError</a></code> exception. + <li>If <var>prefix</var> is non-null and <var>namespace</var> is null, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#namespaceerror">NamespaceError</a></code>. + <li>If <var>prefix</var> is "<code>xml</code>" and <var>namespace</var> is not the <a data-link-type="dfn" href="#xml-namespace">XML namespace</a>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#namespaceerror">NamespaceError</a></code>. <li>If either <var>qualifiedName</var> or <var>prefix</var> is - "<code>xmlns</code>" and <var>namespace</var> is not the <a data-link-type="dfn" href="#xmlns-namespace">XMLNS namespace</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#namespaceerror">NamespaceError</a></code> exception. - <li>If <var>namespace</var> is the <a data-link-type="dfn" href="#xmlns-namespace">XMLNS namespace</a> and neither <var>qualifiedName</var> nor <var>prefix</var> is "<code>xmlns</code>", <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#namespaceerror">NamespaceError</a></code> exception. + "<code>xmlns</code>" and <var>namespace</var> is not the <a data-link-type="dfn" href="#xmlns-namespace">XMLNS namespace</a>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#namespaceerror">NamespaceError</a></code>. + <li>If <var>namespace</var> is the <a data-link-type="dfn" href="#xmlns-namespace">XMLNS namespace</a> and neither <var>qualifiedName</var> nor <var>prefix</var> is "<code>xmlns</code>", then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#namespaceerror">NamespaceError</a></code>. <li>Return <var>namespace</var>, <var>prefix</var>, and <var>localName</var>. </ol> <h2 class="heading settled" data-level="3" id="events"><span class="secno">3. </span><span class="content">Events</span><a class="self-link" href="#events"></a></h2> @@ -544,7 +552,7 @@ <h3 class="heading settled" data-level="3.2" id="interface-event"><span class="s during which <var>event</var> was <a data-link-type="dfn" href="#concept-event-dispatch">dispatched</a>, can be canceled by invoking the <code class="idl"><a data-link-type="idl" href="#dom-event-preventdefault">preventDefault()</a></code> method. <dt><code><var>event</var> . <a class="idl-code" data-link-type="method" href="#dom-event-preventdefault">preventDefault</a>()</code> <dd>If invoked when the <code class="idl"><a data-link-type="idl" href="#dom-event-cancelable">cancelable</a></code> attribute value is true, and while executing a - listener for the <var>event</var> with <code class="idl"><a data-link-type="idl" href="#dom-eventlisteneroptions-passive">passive</a></code> set to false, signals to + listener for the <var>event</var> with <code class="idl"><a data-link-type="idl" href="#dom-addeventlisteneroptions-passive">passive</a></code> set to false, signals to the operation that caused <var>event</var> to be <a data-link-type="dfn" href="#concept-event-dispatch">dispatched</a> that it needs to be canceled. <dt><code><var>event</var> . <code class="idl"><a data-link-type="idl" href="#dom-event-defaultprevented">defaultPrevented</a></code></code> <dd>Returns true if <code class="idl"><a data-link-type="idl" href="#dom-event-preventdefault">preventDefault()</a></code> was invoked successfully to indicate cancellation, @@ -606,6 +614,8 @@ <h3 class="heading settled" data-level="3.2" id="interface-event"><span class="s must return the value it was initialized to. When an <a data-link-type="dfn" href="#concept-event">event</a> is created the attribute must be initialized to the number of milliseconds that have passed since 00:00:00 UTC on 1 January 1970, ignoring leap seconds.</p> + <p class="XXX">This is highly likely to change and already does not reflect implementations well. +Please see <a href="https://github.com/whatwg/dom/issues/23">dom #23</a> for more details. </p> <hr> <p>To <dfn data-dfn-for="Event" data-dfn-type="dfn" data-export="" id="concept-event-initialize">initialize<a class="self-link" href="#concept-event-initialize"></a></dfn> an <var>event</var>, with <var>type</var>, <var>bubbles</var>, and <var>cancelable</var>, run these steps:</p> <ol> @@ -687,7 +697,7 @@ <h3 class="heading settled" data-level="3.5" id="defining-event-interfaces"><spa <h3 class="heading settled" data-level="3.6" id="interface-eventtarget"><span class="secno">3.6. </span><span class="content">Interface <code class="idl"><a data-link-type="idl" href="#eventtarget">EventTarget</a></code></span><a class="self-link" href="#interface-eventtarget"></a></h3> <pre class="idl def">[Exposed=(Window,Worker)] interface <dfn class="idl-code" data-dfn-type="interface" data-export="" id="eventtarget">EventTarget<a class="self-link" href="#eventtarget"></a></dfn> { - void <a class="idl-code" data-link-type="method" href="#dom-eventtarget-addeventlistener">addEventListener</a>(DOMString <dfn class="idl-code" data-dfn-for="EventTarget/addEventListener(type, callback, options), EventTarget/addEventListener(type, callback)" data-dfn-type="argument" data-export="" id="dom-eventtarget-addeventlistener-type-callback-options-type">type<a class="self-link" href="#dom-eventtarget-addeventlistener-type-callback-options-type"></a></dfn>, <a data-link-type="idl-name" href="#callbackdef-eventlistener">EventListener</a>? callback, optional (<a data-link-type="idl-name" href="#dictdef-eventlisteneroptions">EventListenerOptions</a> or boolean) <dfn class="idl-code" data-dfn-for="EventTarget/addEventListener(type, callback, options), EventTarget/addEventListener(type, callback)" data-dfn-type="argument" data-export="" id="dom-eventtarget-addeventlistener-type-callback-options-options">options<a class="self-link" href="#dom-eventtarget-addeventlistener-type-callback-options-options"></a></dfn>); + void <a class="idl-code" data-link-type="method" href="#dom-eventtarget-addeventlistener">addEventListener</a>(DOMString <dfn class="idl-code" data-dfn-for="EventTarget/addEventListener(type, callback, options), EventTarget/addEventListener(type, callback)" data-dfn-type="argument" data-export="" id="dom-eventtarget-addeventlistener-type-callback-options-type">type<a class="self-link" href="#dom-eventtarget-addeventlistener-type-callback-options-type"></a></dfn>, <a data-link-type="idl-name" href="#callbackdef-eventlistener">EventListener</a>? callback, optional (<a data-link-type="idl-name" href="#dictdef-addeventlisteneroptions">AddEventListenerOptions</a> or boolean) <dfn class="idl-code" data-dfn-for="EventTarget/addEventListener(type, callback, options), EventTarget/addEventListener(type, callback)" data-dfn-type="argument" data-export="" id="dom-eventtarget-addeventlistener-type-callback-options-options">options<a class="self-link" href="#dom-eventtarget-addeventlistener-type-callback-options-options"></a></dfn>); void <a class="idl-code" data-link-type="method" href="#dom-eventtarget-removeeventlistener">removeEventListener</a>(DOMString <dfn class="idl-code" data-dfn-for="EventTarget/removeEventListener(type, callback, options), EventTarget/removeEventListener(type, callback)" data-dfn-type="argument" data-export="" id="dom-eventtarget-removeeventlistener-type-callback-options-type">type<a class="self-link" href="#dom-eventtarget-removeeventlistener-type-callback-options-type"></a></dfn>, <a data-link-type="idl-name" href="#callbackdef-eventlistener">EventListener</a>? callback, optional (<a data-link-type="idl-name" href="#dictdef-eventlisteneroptions">EventListenerOptions</a> or boolean) <dfn class="idl-code" data-dfn-for="EventTarget/removeEventListener(type, callback, options), EventTarget/removeEventListener(type, callback)" data-dfn-type="argument" data-export="" id="dom-eventtarget-removeeventlistener-type-callback-options-options">options<a class="self-link" href="#dom-eventtarget-removeeventlistener-type-callback-options-options"></a></dfn>); boolean <a class="idl-code" data-link-type="method" href="#dom-eventtarget-dispatchevent">dispatchEvent</a>(<a data-link-type="idl-name" href="#event">Event</a> <dfn class="idl-code" data-dfn-for="EventTarget/dispatchEvent(event)" data-dfn-type="argument" data-export="" id="dom-eventtarget-dispatchevent-event-event">event<a class="self-link" href="#dom-eventtarget-dispatchevent-event-event"></a></dfn>); }; @@ -697,8 +707,12 @@ <h3 class="heading settled" data-level="3.6" id="interface-eventtarget"><span cl }; dictionary <dfn class="idl-code" data-dfn-type="dictionary" data-export="" id="dictdef-eventlisteneroptions">EventListenerOptions<a class="self-link" href="#dictdef-eventlisteneroptions"></a></dfn> { - boolean <dfn class="idl-code" data-dfn-for="EventListenerOptions" data-dfn-type="dict-member" data-export="" data-type="boolean " id="dom-eventlisteneroptions-capture">capture<a class="self-link" href="#dom-eventlisteneroptions-capture"></a></dfn>; - boolean <dfn class="idl-code" data-dfn-for="EventListenerOptions" data-dfn-type="dict-member" data-export="" data-type="boolean " id="dom-eventlisteneroptions-passive">passive<a class="self-link" href="#dom-eventlisteneroptions-passive"></a></dfn>; + boolean <dfn class="idl-code" data-default="false" data-dfn-for="EventListenerOptions" data-dfn-type="dict-member" data-export="" data-type="boolean " id="dom-eventlisteneroptions-capture">capture<a class="self-link" href="#dom-eventlisteneroptions-capture"></a></dfn> = false; +}; + +dictionary <dfn class="idl-code" data-dfn-type="dictionary" data-export="" id="dictdef-addeventlisteneroptions">AddEventListenerOptions<a class="self-link" href="#dictdef-addeventlisteneroptions"></a></dfn> : <a data-link-type="idl-name" href="#dictdef-eventlisteneroptions">EventListenerOptions</a> { + boolean <dfn class="idl-code" data-default="false" data-dfn-for="AddEventListenerOptions" data-dfn-type="dict-member" data-export="" data-type="boolean " id="dom-addeventlisteneroptions-passive">passive<a class="self-link" href="#dom-addeventlisteneroptions-passive"></a></dfn> = false; + boolean <dfn class="idl-code" data-default="false" data-dfn-for="AddEventListenerOptions" data-dfn-type="dict-member" data-export="" data-type="boolean " id="dom-addeventlisteneroptions-once">once<a class="self-link" href="#dom-addeventlisteneroptions-once"></a></dfn> = false; }; </pre> <p>The <code class="idl"><a data-link-type="idl" href="#eventtarget">EventTarget</a></code> object represents the target to which an <a data-link-type="dfn" href="#concept-event">event</a> is <a data-link-type="dfn" href="#concept-event-dispatch">dispatched</a> when something has occurred. </p> @@ -710,6 +724,7 @@ <h3 class="heading settled" data-level="3.6" id="interface-eventtarget"><span cl <li><b>callback</b> (an <code class="idl"><a data-link-type="idl" href="#callbackdef-eventlistener">EventListener</a></code>) <li><b>capture</b> (a boolean, initially false) <li><b>passive</b> (a boolean, initially false) + <li><b>once</b> (a boolean, initially false) <li><b>removed</b> (a boolean for bookkeeping purposes, initially false) </ul> <p class="note no-backref" role="note">Although <b>callback</b> is an <code class="idl"><a data-link-type="idl" href="#callbackdef-eventlistener">EventListener</a></code>, as can be seen from the @@ -717,7 +732,7 @@ <h3 class="heading settled" data-level="3.6" id="interface-eventtarget"><span cl <p>Each <code class="idl"><a data-link-type="idl" href="#eventtarget">EventTarget</a></code> object also has an associated <dfn data-dfn-type="dfn" data-export="" id="get-the-parent">get the parent<a class="self-link" href="#get-the-parent"></a></dfn> algorithm, which takes an <a data-link-type="dfn" href="#concept-event">event</a> <var>event</var>, and returns an <code class="idl"><a data-link-type="idl" href="#eventtarget">EventTarget</a></code> object. Unless specified otherwise it returns null. </p> - <p class="note no-backref" role="note"><a data-link-type="dfn" href="#concept-node">Nodes</a> and <a data-link-type="dfn" href="#concept-document">documents</a> override the <span>get the parent</span> algorithm. </p> + <p class="note no-backref" role="note"><a data-link-type="dfn" href="#concept-node">Nodes</a> and <a data-link-type="dfn" href="#concept-document">documents</a> override the <a data-link-type="dfn" href="#get-the-parent">get the parent</a> algorithm. </p> <dl class="domintro"> <dt><code><var>target</var> . <a class="idl-code" data-link-type="method" href="#dom-eventtarget-addeventlistener">addEventListener</a>(<var>type</var>, <var>callback</var> [, <var>options</var>])</code> <dd> @@ -730,28 +745,38 @@ <h3 class="heading settled" data-level="3.6" id="interface-eventtarget"><span cl being invoked when the <a data-link-type="dfn" href="#concept-event">event</a>’s <code class="idl"><a data-link-type="idl" href="#dom-event-eventphase">eventPhase</a></code> attribute value is <code class="idl"><a data-link-type="idl" href="#dom-event-bubbling_phase">BUBBLING_PHASE</a></code>. When false (or not present), <b>callback</b> will not be invoked when <a data-link-type="dfn" href="#concept-event">event</a>’s <code class="idl"><a data-link-type="idl" href="#dom-event-eventphase">eventPhase</a></code> attribute value is <code class="idl"><a data-link-type="idl" href="#dom-event-capturing_phase">CAPTURING_PHASE</a></code>. Either way, <b>callback</b> will be invoked if <a data-link-type="dfn" href="#concept-event">event</a>’s <code class="idl"><a data-link-type="idl" href="#dom-event-eventphase">eventPhase</a></code> attribute value is <code class="idl"><a data-link-type="idl" href="#dom-event-at_target">AT_TARGET</a></code>.</p> <p>When set to true, <var>options</var>’ <code>passive</code> member indicates that the <b>callback</b> will not cancel the event by invoking <code class="idl"><a data-link-type="idl" href="#dom-event-preventdefault">preventDefault()</a></code>. This is used to enable performance optimizations described in <a href="#observing-event-listeners">§3.7 Observing event listeners</a>.</p> + <p>When set to true, <var>options</var>’s <code>once</code> member indicates that the <b>callback</b> will only be invoked once after which the event listener will be removed.</p> <p>The <a data-link-type="dfn" href="#concept-event-listener">event listener</a> is appended to <var>target</var>’s list of <a data-link-type="dfn" href="#concept-event-listener">event listeners</a> and is - not appended if it is a duplicate, i.e., having the same <b>type</b>, <b>callback</b>, <b>capture</b> and <b>passive</b> values.</p> + not appended if it is a duplicate, i.e., having the same <b>type</b>, <b>callback</b>, and <b>capture</b> values.</p> <dt><code><var>target</var> . <a class="idl-code" data-link-type="method" href="#dom-eventtarget-removeeventlistener">removeEventListener</a>(<var>type</var>, <var>callback</var> [, <var>options</var>])</code> <dd>Remove the <a data-link-type="dfn" href="#concept-event-listener">event listener</a> in <var>target</var>’s list of <a data-link-type="dfn" href="#concept-event-listener">event listeners</a> with the same <var>type</var>, <var>callback</var>, and <var>options</var>. <dt><code><var>target</var> . <a class="idl-code" data-link-type="method" href="#dom-eventtarget-dispatchevent">dispatchEvent</a>(<var>event</var>)</code> <dd><a data-link-type="dfn" href="#concept-event-dispatch">Dispatches</a> a synthetic event <var>event</var> to <var>target</var> and returns true if either <var>event</var>’s <code class="idl"><a data-link-type="idl" href="#dom-event-cancelable">cancelable</a></code> attribute value is false or its <code class="idl"><a data-link-type="idl" href="#dom-event-preventdefault">preventDefault()</a></code> method was not invoked, and false otherwise. </dl> - <p>To <dfn data-dfn-for="Event" data-dfn-type="dfn" data-export="" id="concept-flatten-options">flatten<a class="self-link" href="#concept-flatten-options"></a></dfn> <var>options</var> run these steps: </p> + <p>To <dfn data-dfn-for="Event" data-dfn-type="dfn" data-export="" id="concept-flatten-options">flatten<a class="self-link" href="#concept-flatten-options"></a></dfn> <var>options</var>, run these +steps: </p> <ol> <li> - <p>Let <var>capture</var> and <var>passive</var> be false. </p> + <p>Let <var>capture</var> be false. </p> <li> <p>If <var>options</var> is a boolean, set <var>capture</var> to <var>options</var>. </p> <li> - <p>If <var>options</var> is a dictionary and <code><code class="idl"><a data-link-type="idl" href="#dom-eventlisteneroptions-capture">capture</a></code></code> is - present in <var>options</var> with value true, then set <var>capture</var> to true. </p> + <p>If <var>options</var> is a dictionary, then set <var>capture</var> to <var>options</var>’s <code><code class="idl"><a data-link-type="idl" href="#dom-eventlisteneroptions-capture">capture</a></code></code>. </p> + <li> + <p>Return <var>capture</var>. </p> + </ol> + <p>To <dfn data-dfn-for="Event" data-dfn-type="dfn" data-export="" id="event-flatten-more">flatten more<a class="self-link" href="#event-flatten-more"></a></dfn> <var>options</var>, run these +steps: </p> + <ol> <li> - <p>If <var>options</var> is a dictionary and <code><code class="idl"><a data-link-type="idl" href="#dom-eventlisteneroptions-passive">passive</a></code></code> is - present in <var>options</var> with value true, then set <var>passive</var> to true. </p> + <p>Let <var>capture</var> be the result of <a data-link-type="dfn" href="#concept-flatten-options">flattening</a> <var>options</var>. </p> <li> - <p>Return <var>capture</var> and <var>passive</var>. </p> + <p>Let <var>once</var> and <var>passive</var> be false. </p> + <li> + <p>If <var>options</var> is a dictionary, then set <var>passive</var> to <var>options</var>’s <code><code class="idl"><a data-link-type="idl" href="#dom-addeventlisteneroptions-passive">passive</a></code></code> and <var>once</var> to <var>options</var>’s <code><code class="idl"><a data-link-type="idl" href="#dom-addeventlisteneroptions-once">once</a></code></code>. </p> + <li> + <p>Return <var>capture</var>, <var>passive</var>, and <var>once</var>. </p> </ol> <p>The <dfn class="idl-code" data-dfn-for="EventTarget" data-dfn-type="method" data-export="" data-lt="addEventListener(type, callback, options)|addEventListener(type, callback)" id="dom-eventtarget-addeventlistener"><code>addEventListener(<var>type</var>, <var>callback</var>, <var>options</var>)</code><a class="self-link" href="#dom-eventtarget-addeventlistener"></a></dfn> method, when invoked, must run these steps: </p> <ol> @@ -765,9 +790,10 @@ <h3 class="heading settled" data-level="3.6" id="interface-eventtarget"><span cl <li> <p>If <var>callback</var> is null, terminate these steps. </p> <li> - <p>Let <var>capture</var> and <var>passive</var> be the result of <a data-link-type="dfn" href="#concept-flatten-options">flattening</a> <var>options</var>. </p> + <p>Let <var>capture</var>, <var>passive</var>, and <var>once</var> be the result of <a data-link-type="dfn" href="#event-flatten-more">flattening more</a> <var>options</var>. </p> <li> - <p>Append an <a data-link-type="dfn" href="#concept-event-listener">event listener</a> to the associated list of <a data-link-type="dfn" href="#concept-event-listener">event listeners</a> with <b>type</b> set to <var>type</var>, <b>callback</b> set to <var>callback</var>, <b>capture</b> set to <var>capture</var>, and <b>passive</b> set to <var>passive</var> unless there already is an <a data-link-type="dfn" href="#concept-event-listener">event listener</a> in that list with the same <b>type</b>, <b>callback</b>, <b>capture</b>, and <b>passive</b>. </p> + <p>If <a data-link-type="dfn" href="#context-object">context object</a>’s associated list of <a data-link-type="dfn" href="#concept-event-listener">event listener</a> does not contain an <a data-link-type="dfn" href="#concept-event-listener">event listener</a> whose <b>type</b> is <var>type</var>, <b>callback</b> is <var>callback</var>, + and <b>capture</b> is <var>capture</var>, then append a new <a data-link-type="dfn" href="#concept-event-listener">event listener</a> to it, whose <b>type</b> is <var>type</var>, <b>callback</b> is <var>callback</var>, <b>capture</b> is <var>capture</var>, <b>passive</b> is <var>passive</var>, and <b>once</b> is <var>once</var>. </p> </ol> <p>The <dfn class="idl-code" data-dfn-for="EventTarget" data-dfn-type="method" data-export="" data-lt="removeEventListener(type, callback, options)|removeEventListener(type, callback)" id="dom-eventtarget-removeeventlistener"><code>removeEventListener(<var>type</var>, <var>callback</var>, <var>options</var>)</code><a class="self-link" href="#dom-eventtarget-removeeventlistener"></a></dfn> method, when invoked, must, run these steps </p> <ol> @@ -775,16 +801,17 @@ <h3 class="heading settled" data-level="3.6" id="interface-eventtarget"><span cl <p>If the <a data-link-type="dfn" href="#context-object">context object</a>’s global object is a <code class="idl"><a data-link-type="idl" href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#service-worker-global-scope-interface">ServiceWorkerGlobalScope</a></code> object and its associated <a data-link-type="dfn" href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#dfn-service-worker">service worker</a>’s <a data-link-type="dfn" href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#dfn-script-resource">script resource</a>’s <a data-link-type="dfn" href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#dfn-has-ever-been-evaluated-flag">has ever been evaluated flag</a> is set, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code>TypeError</code>. <a data-link-type="biblio" href="#biblio-service-workers">[SERVICE-WORKERS]</a> </p> <li> - <p>Let <var>capture</var> and <var>passive</var> be the result of <a data-link-type="dfn" href="#concept-flatten-options">flattening</a> <var>options</var>. </p> + <p>Let <var>capture</var> be the result of <a data-link-type="dfn" href="#concept-flatten-options">flattening</a> <var>options</var>. </p> <li> - <p>If there is an <a data-link-type="dfn" href="#concept-event-listener">event listener</a> in the associated list of <a data-link-type="dfn" href="#concept-event-listener">event listeners</a> whose <b>type</b> is <var>type</var>, <b>callback</b> is <var>callback</var>, <b>capture</b> is <var>capture</var>, and <b>passive</b> is <var>passive</var> then set that <a data-link-type="dfn" href="#concept-event-listener">event listener</a>’s <b>removed</b> to true and remove it from the associated list of <a data-link-type="dfn" href="#concept-event-listener">event listeners</a>. </p> + <p>If there is an <a data-link-type="dfn" href="#concept-event-listener">event listener</a> in the associated list of <a data-link-type="dfn" href="#concept-event-listener">event listeners</a> whose <b>type</b> is <var>type</var>, <b>callback</b> is <var>callback</var>, and <b>capture</b> is <var>capture</var>, then set that <a data-link-type="dfn" href="#concept-event-listener">event listener</a>’s <b>removed</b> to true and remove it from + the associated list of <a data-link-type="dfn" href="#concept-event-listener">event listeners</a>. </p> </ol> <p>The <dfn class="idl-code" data-dfn-for="EventTarget" data-dfn-type="method" data-export="" id="dom-eventtarget-dispatchevent"><code>dispatchEvent(<var>event</var>)</code><a class="self-link" href="#dom-eventtarget-dispatchevent"></a></dfn> method, when invoked, must run these steps: </p> <ol> <li> <p>If <var>event</var>’s <a data-link-type="dfn" href="#dispatch-flag">dispatch flag</a> is set, or if its <a data-link-type="dfn" href="#initialized-flag">initialized flag</a> is not - set, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror">InvalidStateError</a></code> exception. </p> + set, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror">InvalidStateError</a></code>. </p> <li> <p>Initialize <var>event</var>’s <code class="idl"><a data-link-type="idl" href="#dom-event-istrusted">isTrusted</a></code> attribute to false. </p> <li> @@ -799,10 +826,10 @@ <h3 class="heading settled" data-level="3.7" id="observing-event-listeners"><spa that even empty listeners can have a dramatic performance impact on the behavior of the application. For example, touch and wheel events which can be used to block asynchronous scrolling. In some cases this problem can be mitigated by specifying the event to be <code class="idl"><a data-link-type="idl" href="#dom-event-cancelable">cancelable</a></code> only when there is -at least one non-<code class="idl"><a data-link-type="idl" href="#dom-eventlisteneroptions-passive">passive</a></code> listener. For example, -non-<code class="idl"><a data-link-type="idl" href="#dom-eventlisteneroptions-passive">passive</a></code> <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/touch-events/#touchevent-interface">TouchEvent</a></code> listeners must block scrolling, but if all -listeners are <code class="idl"><a data-link-type="idl" href="#dom-eventlisteneroptions-passive">passive</a></code> then scrolling can be allowed to start <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel">in parallel</a> by making the <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/touch-events/#touchevent-interface">TouchEvent</a></code> uncancelable (so that calls to <code class="idl"><a data-link-type="idl" href="#dom-event-preventdefault">preventDefault()</a></code> are ignored). So code dispatching an event is able to observe the absence -of non-<code class="idl"><a data-link-type="idl" href="#dom-eventlisteneroptions-passive">passive</a></code> listeners, and use that to clear the <code class="idl"><a data-link-type="idl" href="#dom-event-cancelable">cancelable</a></code> property of the event being dispatched. </p> +at least one non-<code class="idl"><a data-link-type="idl" href="#dom-addeventlisteneroptions-passive">passive</a></code> listener. For example, +non-<code class="idl"><a data-link-type="idl" href="#dom-addeventlisteneroptions-passive">passive</a></code> <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/touch-events/#touchevent-interface">TouchEvent</a></code> listeners must block scrolling, but if all +listeners are <code class="idl"><a data-link-type="idl" href="#dom-addeventlisteneroptions-passive">passive</a></code> then scrolling can be allowed to start <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel">in parallel</a> by making the <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/touch-events/#touchevent-interface">TouchEvent</a></code> uncancelable (so that calls to <code class="idl"><a data-link-type="idl" href="#dom-event-preventdefault">preventDefault()</a></code> are ignored). So code dispatching an event is able to observe the absence +of non-<code class="idl"><a data-link-type="idl" href="#dom-addeventlisteneroptions-passive">passive</a></code> listeners, and use that to clear the <code class="idl"><a data-link-type="idl" href="#dom-event-cancelable">cancelable</a></code> property of the event being dispatched. </p> <p>Ideally, any new event APIs are defined such that they do not need this property (use <a href="https://lists.w3.org/Archives/Public/public-script-coord/">public-scrip-coord@w3.org</a> for discussion). </p> <h3 class="heading settled" data-level="3.8" id="dispatching-events"><span class="secno">3.8. </span><span class="content">Dispatching events</span><a class="self-link" href="#dispatching-events"></a></h3> <p>To <dfn data-dfn-for="Event" data-dfn-type="dfn" data-export="" id="concept-event-dispatch">dispatch<a class="self-link" href="#concept-event-dispatch"></a></dfn> an <var>event</var> to a <var>target</var>, with an optional <var>target override</var>, run these steps: </p> @@ -819,18 +846,18 @@ <h3 class="heading settled" data-level="3.8" id="dispatching-events"><span class <li> <p>Initialize <var>event</var>’s <code class="idl"><a data-link-type="idl" href="#dom-event-eventphase">eventPhase</a></code> attribute to <code class="idl"><a data-link-type="idl" href="#dom-event-capturing_phase">CAPTURING_PHASE</a></code>. </p> <li> - <p>For each <var>object</var> in <var>eventPath</var>, in reverse order, if <var>event</var>’s <a data-link-type="dfn" href="#stop-propagation-flag">stop propagation flag</a> is unset and <var>object</var> is not <var>target</var>, <a data-link-type="dfn" href="#concept-event-listener-invoke">invoke</a> <var>object</var> with <var>event</var>. </p> + <p>For each <var>object</var> in <var>eventPath</var>, in reverse order, if <var>object</var> is not <var>target</var>, <a data-link-type="dfn" href="#concept-event-listener-invoke">invoke</a> <var>object</var> with <var>event</var>. </p> <li> <p>Initialize <var>event</var>’s <code class="idl"><a data-link-type="idl" href="#dom-event-eventphase">eventPhase</a></code> attribute to <code class="idl"><a data-link-type="idl" href="#dom-event-at_target">AT_TARGET</a></code>. </p> <li> - <p>If <var>event</var>’s <a data-link-type="dfn" href="#stop-propagation-flag">stop propagation flag</a> is unset, <a data-link-type="dfn" href="#concept-event-listener-invoke">invoke</a> <var>target</var> with <var>event</var>. </p> + <p><a data-link-type="dfn" href="#concept-event-listener-invoke">Invoke</a> <var>target</var> with <var>event</var>. </p> <li> <p>If <var>event</var>’s <code class="idl"><a data-link-type="idl" href="#dom-event-bubbles">bubbles</a></code> attribute value is true, run these substeps: </p> <ol> <li> <p>Initialize <var>event</var>’s <code class="idl"><a data-link-type="idl" href="#dom-event-eventphase">eventPhase</a></code> attribute to <code class="idl"><a data-link-type="idl" href="#dom-event-bubbling_phase">BUBBLING_PHASE</a></code>. </p> <li> - <p>For each <var>object</var> in <var>eventPath</var>, if <var>event</var>’s <a data-link-type="dfn" href="#stop-propagation-flag">stop propagation flag</a> is unset and <var>object</var> is not <var>target</var>, <a data-link-type="dfn" href="#concept-event-listener-invoke">invoke</a> <var>object</var> with <var>event</var>. </p> + <p>For each <var>object</var> in <var>eventPath</var>, if <var>object</var> is not <var>target</var>, <a data-link-type="dfn" href="#concept-event-listener-invoke">invoke</a> <var>object</var> with <var>event</var>. </p> </ol> <li> <p>Unset <var>event</var>’s <a data-link-type="dfn" href="#dispatch-flag">dispatch flag</a>. </p> @@ -843,6 +870,8 @@ <h3 class="heading settled" data-level="3.8" id="dispatching-events"><span class </ol> <p>To <dfn data-dfn-for="event listener" data-dfn-type="dfn" data-noexport="" id="concept-event-listener-invoke">invoke<a class="self-link" href="#concept-event-listener-invoke"></a></dfn> an <var>object</var> with <var>event</var>, run these steps: </p> <ol> + <li> + <p>If <var>event</var>’s <a data-link-type="dfn" href="#stop-propagation-flag">stop propagation flag</a> is set, then terminate these steps. </p> <li> <p>Let <var>listeners</var> be the empty list. </p> <li> @@ -908,9 +937,11 @@ <h3 class="heading settled" data-level="3.8" id="dispatching-events"><span class <li> <p>If <var>listener</var>’s <b>passive</b> is true, set <var>event</var>’s <a data-link-type="dfn" href="#in-passive-listener-flag">in passive listener flag</a>. </p> <li> - <p>Call <var>listener</var>’s <b>callback</b>’s <code class="idl"><a data-link-type="idl" href="#dom-eventlistener-handleevent">handleEvent()</a></code>, with <var>event</var> as argument and <var>event</var>’s <code class="idl"><a data-link-type="idl" href="#dom-event-currenttarget">currentTarget</a></code> attribute value as <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-callback-this-value">callback this value</a>. If this throws any exception, <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#report-the-exception">report the exception</a>. </p> + <p>Call <var>listener</var>’s <b>callback</b>’s <code class="idl"><a data-link-type="idl" href="#dom-eventlistener-handleevent">handleEvent()</a></code>, with <var>event</var> as argument and <var>event</var>’s <code class="idl"><a data-link-type="idl" href="#dom-event-currenttarget">currentTarget</a></code> attribute value as <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-callback-this-value">callback this value</a>. If this throws an exception, <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#report-the-exception">report the exception</a>. </p> <li> <p>Unset <var>event</var>’s <a data-link-type="dfn" href="#in-passive-listener-flag">in passive listener flag</a>. </p> + <li> + <p>If <var>listener</var>’s <b>once</b> is true, then set <var>listener</var>’s <b>removed</b> to true and remove it from <var>object</var>’s associated list of <a data-link-type="dfn" href="#concept-event-listener">event listeners</a>. </p> <li> <p>If <var>event</var>’s <a data-link-type="dfn" href="#stop-immediate-propagation-flag">stop immediate propagation flag</a> is set, return <var>found</var>. </p> @@ -1036,22 +1067,60 @@ <h4 class="heading settled" data-level="4.2.2" id="shadow-trees"><span class="se <p>An <a data-link-type="dfn" href="#concept-element">element</a> is <dfn data-dfn-type="dfn" data-export="" id="in-a-shadow-including-document">in a shadow-including document<a class="self-link" href="#in-a-shadow-including-document"></a></dfn> if its <a data-link-type="dfn" href="#concept-shadow-including-root">shadow-including root</a> is a <a data-link-type="dfn" href="#concept-document">document</a>. </p> <h5 class="heading settled" data-level="4.2.2.1" id="shadow-tree-slots"><span class="secno">4.2.2.1. </span><span class="content">Slots</span><a class="self-link" href="#shadow-tree-slots"></a></h5> <p>A <a data-link-type="dfn" href="#concept-shadow-tree">shadow tree</a> contains zero or more <a data-link-type="dfn" href="#concept-element">elements</a> that are <dfn data-dfn-type="dfn" data-export="" data-lt="slot" id="concept-slot">slots<a class="self-link" href="#concept-slot"></a></dfn>.</p> - <p class="note" role="note">A <a data-link-type="dfn" href="#concept-slot">slot</a> can only be created through HTML’s <code>slot</code> element.</p> + <p class="note" role="note">A <a data-link-type="dfn" href="#concept-slot">slot</a> can only be created through HTML’s <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/scripting.html#the-slot-element">slot</a></code> element.</p> <p>A <a data-link-type="dfn" href="#concept-slot">slot</a> has an associated <dfn data-dfn-for="slot" data-dfn-type="dfn" data-export="" id="slot-name">name<a class="self-link" href="#slot-name"></a></dfn> (a string). Unless stated otherwise it is the empty string.</p> + <p>Use these <a data-link-type="dfn" href="#concept-element-attributes-change-ext">attribute change steps</a> to update a <a data-link-type="dfn" href="#concept-slot">slot</a>’s <a data-link-type="dfn" href="#slot-name">name</a>: </p> + <ol> + <li> + <p>If <var>element</var> is a <a data-link-type="dfn" href="#concept-slot">slot</a>, <var>localName</var> is <code>name</code>, and <var>namespace</var> is null, then: </p> + <ol> + <li> + <p>If <var>value</var> is <var>oldValue</var>, then return. </p> + <li> + <p>If <var>value</var> is null and <var>oldValue</var> is the empty string, then return. </p> + <li> + <p>If <var>value</var> is the empty string and <var>oldValue</var> is null, then return. </p> + <li> + <p>If <var>value</var> is null or the empty string, then set <var>element</var>’s <a data-link-type="dfn" href="#slot-name">name</a> to the empty string. </p> + <li> + <p>Otherwise, set <var>element</var>’s <a data-link-type="dfn" href="#slot-name">name</a> to <var>value</var>. </p> + <li> + <p>Run <a data-link-type="dfn" href="#assign-slotables-for-a-tree">assign slotables for a tree</a> with <var>element</var>’s <a data-link-type="dfn" href="#concept-tree">tree</a>. </p> + </ol> + </ol> <p class="note" role="note">The first <a data-link-type="dfn" href="#concept-slot">slot</a> in a <a data-link-type="dfn" href="#concept-shadow-tree">shadow tree</a>, in <a data-link-type="dfn" href="#concept-tree-order">tree order</a>, whose <a data-link-type="dfn" href="#slot-name">name</a> is the empty string, is sometimes known as the "default slot".</p> + <p>A <a data-link-type="dfn" href="#concept-slot">slot</a> has an associated <dfn data-dfn-for="slot" data-dfn-type="dfn" data-export="" id="slot-assigned-nodes">assigned nodes<a class="self-link" href="#slot-assigned-nodes"></a></dfn> (a list of <a data-link-type="dfn" href="#concept-slotable">slotables</a>). Unless stated otherwise it is empty.</p> <h5 class="heading settled" data-level="4.2.2.2" id="light-tree-slotables"><span class="secno">4.2.2.2. </span><span class="content">Slotables</span><a class="self-link" href="#light-tree-slotables"></a></h5> <p><code class="idl"><a data-link-type="idl" href="#element">Element</a></code> and <code class="idl"><a data-link-type="idl" href="#text">Text</a></code> <a data-link-type="dfn" href="#concept-node">nodes</a> are <dfn data-dfn-type="dfn" data-export="" data-lt="slotable" id="concept-slotable">slotables<a class="self-link" href="#concept-slotable"></a></dfn>.</p> - <p>A <a data-link-type="dfn" href="#concept-slotable">slotable</a> has a <dfn data-dfn-for="slotable" data-dfn-type="dfn" data-noexport="" id="slotable-get-name">get name<a class="self-link" href="#slotable-get-name"></a></dfn> algorithm, which runs these steps:</p> + <p class="note" role="note">A <a data-link-type="dfn" href="#concept-slot">slot</a> can be a <a data-link-type="dfn" href="#concept-slotable">slotable</a>. </p> + <p>A <a data-link-type="dfn" href="#concept-slotable">slotable</a> has an associated <dfn data-dfn-for="slotable" data-dfn-type="dfn" data-export="" id="slotable-name">name<a class="self-link" href="#slotable-name"></a></dfn> (a string). Unless stated +otherwise it is the empty string.</p> + <p>Use these <a data-link-type="dfn" href="#concept-element-attributes-change-ext">attribute change steps</a> to update a <a data-link-type="dfn" href="#concept-slotable">slotable</a>’s <a data-link-type="dfn" href="#slotable-name">name</a>: </p> <ol> <li> - <p>If <a data-link-type="dfn" href="#context-object">context object</a> is a <code class="idl"><a data-link-type="idl" href="#text">Text</a></code> <a data-link-type="dfn" href="#concept-node">node</a>, then return the empty string.</p> - <li> - <p>Return the result of running <a data-link-type="dfn" href="#concept-element-attributes-get-value">get an attribute value</a> given <a data-link-type="dfn" href="#context-object">context object</a> and - "<code>slot</code>".</p> + <p>If <var>localName</var> is <code>slot</code> and <var>namespace</var> is null, then: </p> + <ol> + <li> + <p>If <var>value</var> is <var>oldValue</var>, then return. </p> + <li> + <p>If <var>value</var> is null and <var>oldValue</var> is the empty string, then return. </p> + <li> + <p>If <var>value</var> is the empty string and <var>oldValue</var> is null, then return. </p> + <li> + <p>If <var>value</var> is null or the empty string, then set <var>element</var>’s <a data-link-type="dfn" href="#slotable-name">name</a> to the empty string. </p> + <li> + <p>Otherwise, set <var>element</var>’s <a data-link-type="dfn" href="#slotable-name">name</a> to <var>value</var>. </p> + <li> + <p>If <var>element</var> is <a data-link-type="dfn" href="#slotable-assigned">assigned</a>, then run <a data-link-type="dfn" href="#assign-slotables">assign slotables</a> for <var>element</var>’s <a data-link-type="dfn" href="#slotable-assigned-slot">assigned slot</a>. </p> + <li> + <p>Run <a data-link-type="dfn" href="#assign-a-slot">assign a slot</a> for <var>element</var>. </p> + </ol> </ol> + <p>A <a data-link-type="dfn" href="#concept-slotable">slotable</a> has an associated <dfn data-dfn-for="slotable" data-dfn-type="dfn" data-export="" id="slotable-assigned-slot">assigned slot<a class="self-link" href="#slotable-assigned-slot"></a></dfn> (null or a <a data-link-type="dfn" href="#concept-slot">slot</a>). Unless stated otherwise it is null. A <a data-link-type="dfn" href="#concept-slotable">slotable</a> is <dfn data-dfn-for="slotable" data-dfn-type="dfn" data-export="" id="slotable-assigned">assigned<a class="self-link" href="#slotable-assigned"></a></dfn> if its <a data-link-type="dfn" href="#slotable-assigned-slot">assigned slot</a> is non-null.</p> <h5 class="heading settled" data-level="4.2.2.3" id="finding-slots-and-slotables"><span class="secno">4.2.2.3. </span><span class="content">Finding slots and slotables</span><a class="self-link" href="#finding-slots-and-slotables"></a></h5> - <p>To <dfn data-dfn-type="dfn" data-noexport="" id="find-a-slot">find a slot<a class="self-link" href="#find-a-slot"></a></dfn> for a given <a data-link-type="dfn" href="#concept-slotable">slotable</a> <var>slotable</var> and an optional <i>open flag</i> (unset unless stated otherwise), run these steps:</p> + <p>To <dfn data-dfn-type="dfn" data-export="" data-lt="find a slot|finding a slot" id="find-a-slot">find a slot<a class="self-link" href="#find-a-slot"></a></dfn> for a given <a data-link-type="dfn" href="#concept-slotable">slotable</a> <var>slotable</var> and an optional <i>open flag</i> (unset unless stated otherwise), run these +steps:</p> <ol> <li> <p>If <var>slotable</var>’s <a data-link-type="dfn" href="#concept-tree-parent">parent</a> is null, then return null.</p> @@ -1062,11 +1131,9 @@ <h5 class="heading settled" data-level="4.2.2.3" id="finding-slots-and-slotables <li> <p>If the <i>open flag</i> is set and <var>shadow</var>’s <a data-link-type="dfn" href="#shadowroot-mode">mode</a> is <em>not</em> "<code>open</code>", then return null.</p> <li> - <p>Let <var>name</var> be the result of running <var>slotable</var>’s <a data-link-type="dfn" href="#slotable-get-name">get name</a>.</p> - <li> - <p>Return the first <a data-link-type="dfn" href="#concept-slot">slot</a> in <var>shadow</var>’s <a data-link-type="dfn" href="#concept-tree">tree</a> whose <a data-link-type="dfn" href="#slot-name">name</a> is <var>name</var>, if any, and null otherwise.</p> + <p>Return the first <a data-link-type="dfn" href="#concept-slot">slot</a> in <var>shadow</var>’s <a data-link-type="dfn" href="#concept-tree">tree</a> whose <a data-link-type="dfn" href="#slot-name">name</a> is <var>slotable</var>’s <a data-link-type="dfn" href="#slotable-name">name</a>, if any, and null otherwise.</p> </ol> - <p>To <dfn data-dfn-type="dfn" data-noexport="" id="find-slotables">find slotables<a class="self-link" href="#find-slotables"></a></dfn> for a given <a data-link-type="dfn" href="#concept-slot">slot</a> <var>slot</var>, run these steps:</p> + <p>To <dfn data-dfn-type="dfn" data-export="" data-lt="find slotables|finding slotables" id="find-slotables">find slotables<a class="self-link" href="#find-slotables"></a></dfn> for a given <a data-link-type="dfn" href="#concept-slot">slot</a> <var>slot</var>, run these steps:</p> <ol> <li> <p>Let <var>result</var> be an empty list.</p> @@ -1078,20 +1145,19 @@ <h5 class="heading settled" data-level="4.2.2.3" id="finding-slots-and-slotables <p>For each <a data-link-type="dfn" href="#concept-slotable">slotable</a> <a data-link-type="dfn" href="#concept-tree-child">child</a> of <var>host</var>, <var>slotable</var>, in <a data-link-type="dfn" href="#concept-tree-order">tree order</a>, run these substeps:</p> <ol> <li> - <p>Let <var>foundSlot</var> be the result of running <a data-link-type="dfn" href="#find-a-slot">find a slot</a> given <var>slotable</var>.</p> + <p>Let <var>foundSlot</var> be the result of <a data-link-type="dfn" href="#find-a-slot">finding a slot</a> given <var>slotable</var>.</p> <li> <p>If <var>foundSlot</var> is <var>slot</var>, then append <var>slotable</var> to <var>result</var>.</p> </ol> <li> <p>Return <var>result</var>.</p> </ol> - <p>To <dfn data-dfn-type="dfn" data-noexport="" id="find-distributed-slotables">find distributed slotables<a class="self-link" href="#find-distributed-slotables"></a></dfn> for a given <a data-link-type="dfn" href="#concept-slot">slot</a> <var>slot</var>, run these -steps:</p> + <p>To <dfn data-dfn-type="dfn" data-export="" data-lt="find flattened slotables|finding flattened slotables" id="find-flattened-slotables">find flattened slotables<a class="self-link" href="#find-flattened-slotables"></a></dfn> for a given <a data-link-type="dfn" href="#concept-slot">slot</a> <var>slot</var>, run these steps:</p> <ol> <li> <p>Let <var>result</var> be an empty list.</p> <li> - <p>Let <var>slotables</var> be the result of running <a data-link-type="dfn" href="#find-slotables">find slotables</a> given <var>slot</var>.</p> + <p>Let <var>slotables</var> be the result of <a data-link-type="dfn" href="#find-slotables">finding slotables</a> given <var>slot</var>.</p> <li> <p>If <var>slotables</var> is the empty list, then append each <a data-link-type="dfn" href="#concept-slotable">slotable</a> <a data-link-type="dfn" href="#concept-tree-child">child</a> of <var>slot</var>, in <a data-link-type="dfn" href="#concept-tree-order">tree order</a>, to <var>slotables</var>.</p> <li> @@ -1101,7 +1167,7 @@ <h5 class="heading settled" data-level="4.2.2.3" id="finding-slots-and-slotables <p>If <var>node</var> is a <a data-link-type="dfn" href="#concept-slot">slot</a>, run these subsubsteps:</p> <ol> <li> - <p>Let <var>temporaryResult</var> be the result of running <a data-link-type="dfn" href="#find-distributed-slotables">find distributed slotables</a> given <var>node</var>.</p> + <p>Let <var>temporaryResult</var> be the result of <a data-link-type="dfn" href="#find-flattened-slotables">finding flattened slotables</a> given <var>node</var>.</p> <li> <p>Append each <a data-link-type="dfn" href="#concept-slotable">slotable</a> in <var>temporaryResult</var>, in order, to <var>result</var>.</p> </ol> @@ -1111,12 +1177,54 @@ <h5 class="heading settled" data-level="4.2.2.3" id="finding-slots-and-slotables <li> <p>Return <var>result</var>.</p> </ol> + <h5 class="heading settled" data-level="4.2.2.4" id="assigning-slotables-and-slots"><span class="secno">4.2.2.4. </span><span class="content">Assigning slotables and slots</span><a class="self-link" href="#assigning-slotables-and-slots"></a></h5> + <p>To <dfn data-dfn-type="dfn" data-noexport="" id="assign-slotables">assign slotables<a class="self-link" href="#assign-slotables"></a></dfn>, for a <a data-link-type="dfn" href="#concept-slot">slot</a> <var>slot</var> with an optional <var>suppress signaling flag</var> (unset unless stated otherwise), run these steps: </p> + <ol> + <li> + <p>Let <var>slotables</var> be the result of <a data-link-type="dfn" href="#find-slotables">finding slotables</a> for <var>slot</var>. </p> + <li> + <p>If <var>suppress signaling flag</var> is unset, and <var>slotables</var> and <var>slot</var>’s <a data-link-type="dfn" href="#slot-assigned-nodes">assigned nodes</a> are not identical, then run <a data-link-type="dfn" href="#signal-a-slot-change">signal a slot change</a> for <var>slot</var>. </p> + <li> + <p>Set <var>slot</var>’s <a data-link-type="dfn" href="#slot-assigned-nodes">assigned nodes</a> to <var>slotables</var>. </p> + <li> + <p>For each <var>slotable</var> in <var>slotables</var>, set <var>slotable</var>’s <a data-link-type="dfn" href="#slotable-assigned-slot">assigned slot</a> to <var>slot</var>. </p> + </ol> + <p>To <dfn data-dfn-type="dfn" data-noexport="" id="assign-slotables-for-a-tree">assign slotables for a tree<a class="self-link" href="#assign-slotables-for-a-tree"></a></dfn>, given a <a data-link-type="dfn" href="#concept-tree">tree</a> <var>tree</var> and an +optional set of <a data-link-type="dfn" href="#concept-slot">slots</a> <var>noSignalSlots</var> (empty unless stated otherwise), run these +steps for each <a data-link-type="dfn" href="#concept-slot">slot</a> <var>slot</var> in <var>tree</var>, in <a data-link-type="dfn" href="#concept-tree-order">tree order</a>: </p> + <ol> + <li> + <p>Let <var>suppress signaling flag</var> be set, if <var>slot</var> is in <var>noSignalSlots</var>, and unset otherwise.</p> + <li> + <p>Run <a data-link-type="dfn" href="#assign-slotables">assign slotables</a> for <var>slot</var> with <var>suppress signaling flag</var>. </p> + </ol> + <p>To <dfn data-dfn-type="dfn" data-noexport="" id="assign-a-slot">assign a slot<a class="self-link" href="#assign-a-slot"></a></dfn>, given a <a data-link-type="dfn" href="#concept-slotable">slotable</a> <var>slotable</var>, run these +steps: </p> + <ol> + <li> + <p>Let <var>slot</var> be the result of <a data-link-type="dfn" href="#find-a-slot">finding a slot</a> with <var>slotable</var>. </p> + <li> + <p>If <var>slot</var> is non-null, then run <a data-link-type="dfn" href="#assign-slotables">assign slotables</a> for <var>slot</var>. </p> + </ol> + <h5 class="heading settled" data-level="4.2.2.5" id="signaling-slot-change"><span class="secno">4.2.2.5. </span><span class="content">Signaling slot change</span><a class="self-link" href="#signaling-slot-change"></a></h5> + <p>Each <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#unit-of-related-similar-origin-browsing-contexts">unit of related similar-origin browsing contexts</a> has a <dfn data-dfn-type="dfn" data-export="" id="signal-slot-list">signal slot list<a class="self-link" href="#signal-slot-list"></a></dfn> (a list of <a data-link-type="dfn" href="#concept-slot">slots</a>). Unless stated otherwise it is empty. <a data-link-type="biblio" href="#biblio-html">[HTML]</a> </p> + <p>To <dfn data-dfn-type="dfn" data-noexport="" id="signal-a-slot-change">signal a slot change<a class="self-link" href="#signal-a-slot-change"></a></dfn>, for a <a data-link-type="dfn" href="#concept-slot">slot</a> <var>slot</var>, run these steps: </p> + <ol> + <li> + <p>If <var>slot</var> is not in <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#unit-of-related-similar-origin-browsing-contexts">unit of related similar-origin browsing contexts</a>' <a data-link-type="dfn" href="#signal-slot-list">signal slot list</a>, append <var>slot</var> to <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#unit-of-related-similar-origin-browsing-contexts">unit of related similar-origin browsing contexts</a>' <a data-link-type="dfn" href="#signal-slot-list">signal slot list</a>. </p> + <li> + <p>If <var>slot</var> is <a data-link-type="dfn" href="#slotable-assigned">assigned</a>, then run <a data-link-type="dfn" href="#signal-a-slot-change">signal a slot change</a> for <var>slot</var>’s <a data-link-type="dfn" href="#slotable-assigned-slot">assigned slot</a>. </p> + <li> + <p>Otherwise, if <var>slot</var>’s <a data-link-type="dfn" href="#concept-tree-parent">parent</a> is a <a data-link-type="dfn" href="#concept-slot">slot</a> and <var>slot</var>’s <a data-link-type="dfn" href="#concept-tree-parent">parent</a>’s <a data-link-type="dfn" href="#slot-assigned-nodes">assigned nodes</a> is the empty list, then run <a data-link-type="dfn" href="#signal-a-slot-change">signal a slot change</a> for <var>slot</var>’s <a data-link-type="dfn" href="#concept-tree-parent">parent</a>. </p> + <li> + <p><a data-link-type="dfn" href="#queue-a-mutation-observer-compound-microtask">Queue a mutation observer compound microtask</a>. </p> + </ol> <h4 class="heading settled" data-level="4.2.3" id="mutation-algorithms"><span class="secno">4.2.3. </span><span class="content">Mutation algorithms</span><a class="self-link" href="#mutation-algorithms"></a></h4> <p>To <dfn data-dfn-for="Node" data-dfn-type="dfn" data-export="" id="concept-node-ensure-pre-insertion-validity">ensure pre-insertion validity<a class="self-link" href="#concept-node-ensure-pre-insertion-validity"></a></dfn> of a <var>node</var> into a <var>parent</var> before a <var>child</var>, run these steps:</p> <ol> <li>If <var>parent</var> is not a <code class="idl"><a data-link-type="idl" href="#document">Document</a></code>, <code class="idl"><a data-link-type="idl" href="#documentfragment">DocumentFragment</a></code>, or <code class="idl"><a data-link-type="idl" href="#element">Element</a></code> <a data-link-type="dfn" href="#concept-node">node</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#hierarchyrequesterror">HierarchyRequestError</a></code>. <li>If <var>node</var> is a <a data-link-type="dfn" href="#concept-tree-host-including-inclusive-ancestor">host-including inclusive ancestor</a> of <var>parent</var>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#hierarchyrequesterror">HierarchyRequestError</a></code>. - <li>If <var>child</var> is not null and its <a data-link-type="dfn" href="#concept-tree-parent">parent</a> is not <var>parent</var>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notfounderror">NotFoundError</a></code> exception. + <li>If <var>child</var> is not null and its <a data-link-type="dfn" href="#concept-tree-parent">parent</a> is not <var>parent</var>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notfounderror">NotFoundError</a></code>. <li>If <var>node</var> is not a <code class="idl"><a data-link-type="idl" href="#documentfragment">DocumentFragment</a></code>, <code class="idl"><a data-link-type="idl" href="#documenttype">DocumentType</a></code>, <code class="idl"><a data-link-type="idl" href="#element">Element</a></code>, <code class="idl"><a data-link-type="idl" href="#text">Text</a></code>, <code class="idl"><a data-link-type="idl" href="#processinginstruction">ProcessingInstruction</a></code>, or <code class="idl"><a data-link-type="idl" href="#comment">Comment</a></code> <a data-link-type="dfn" href="#concept-node">node</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#hierarchyrequesterror">HierarchyRequestError</a></code>. <li>If either <var>node</var> is a <code class="idl"><a data-link-type="idl" href="#text">Text</a></code> <a data-link-type="dfn" href="#concept-node">node</a> and <var>parent</var> is a <a data-link-type="dfn" href="#concept-document">document</a>, or <var>node</var> is a <a data-link-type="dfn" href="#concept-doctype">doctype</a> and <var>parent</var> is not a <a data-link-type="dfn" href="#concept-document">document</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#hierarchyrequesterror">HierarchyRequestError</a></code>. @@ -1173,6 +1281,14 @@ <h4 class="heading settled" data-level="4.2.3" id="mutation-algorithms"><span cl <ol> <li> <p>Insert <var>node</var> into <var>parent</var> before <var>child</var> or at the end of <var>parent</var> if <var>child</var> is null. </p> + <li> + <p>If <var>parent</var> is a <a data-link-type="dfn" href="#element-shadow-host">shadow host</a> and <var>node</var> is a <a data-link-type="dfn" href="#concept-slotable">slotable</a>, then <a data-link-type="dfn" href="#assign-a-slot">assign a slot</a> for <var>node</var>. </p> + <li> + <p>If <var>parent</var> is a <a data-link-type="dfn" href="#concept-slot">slot</a> whose <a data-link-type="dfn" href="#slot-assigned-nodes">assigned nodes</a> is the empty list, then + run <a data-link-type="dfn" href="#signal-a-slot-change">signal a slot change</a> for <var>parent</var>. </p> + <li> + <p>Run <a data-link-type="dfn" href="#assign-slotables-for-a-tree">assign slotables for a tree</a> with <var>node</var>’s <a data-link-type="dfn" href="#concept-tree">tree</a> and a set + containing each <a data-link-type="dfn" href="#concept-tree-inclusive-descendant">inclusive descendant</a> of <var>node</var> that is a <a data-link-type="dfn" href="#concept-slot">slot</a>. </p> <li> <p>For each <a data-link-type="dfn" href="#concept-shadow-including-inclusive-descendant">shadow-including inclusive descendant</a> <var>inclusiveDescendant</var> of <var>node</var>, in <a data-link-type="dfn" href="#concept-shadow-including-tree-order">shadow-including tree order</a>, run these subsubsteps: </p> <ol> @@ -1182,11 +1298,11 @@ <h4 class="heading settled" data-level="4.2.3" id="mutation-algorithms"><span cl <p>If <var>inclusiveDescendant</var> is <a data-link-type="dfn" href="#in-a-shadow-including-document">in a shadow-including document</a>, then: </p> <ol> <li> - <p>If <var>inclusiveDescendant</var> is <a data-link-type="dfn" href="#concept-element-custom">custom</a>, then <a data-link-type="dfn" href="https://rawgit.com/w3c/webcomponents/15a203c8393aef0df7223ab1d43406aa11a7e71e/spec/custom/index.html#dfn-enqueue-lifecycle-callback">enqueue a custom element callback reaction</a> with <var>inclusiveDescendant</var>, + <p>If <var>inclusiveDescendant</var> is <a data-link-type="dfn" href="#concept-element-custom">custom</a>, then <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/scripting.html#enqueue-a-custom-element-callback-reaction">enqueue a custom element callback reaction</a> with <var>inclusiveDescendant</var>, callback name "<code>connectedCallback</code>", and an empty argument list. </p> <li> - <p>Otherwise, <a data-link-type="dfn" href="https://rawgit.com/w3c/webcomponents/15a203c8393aef0df7223ab1d43406aa11a7e71e/spec/custom/index.html#dfn-try-upgrade">try to upgrade</a> <var>inclusiveDescendant</var>. </p> - <p class="note" role="note">If this successfully upgrades <var>inclusiveDescendant</var>, its <code>connectedCallback</code> will be enqueued automatically during the <a data-link-type="dfn" href="https://rawgit.com/w3c/webcomponents/15a203c8393aef0df7223ab1d43406aa11a7e71e/spec/custom/index.html#dfn-upgrade-a-custom-element">upgrade an element</a> algorithm. </p> + <p>Otherwise, <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/scripting.html#concept-try-upgrade">try to upgrade</a> <var>inclusiveDescendant</var>. </p> + <p class="note" role="note">If this successfully upgrades <var>inclusiveDescendant</var>, its <code>connectedCallback</code> will be enqueued automatically during the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/scripting.html#concept-upgrade-an-element">upgrade an element</a> algorithm. </p> </ol> </ol> </ol> @@ -1198,7 +1314,7 @@ <h4 class="heading settled" data-level="4.2.3" id="mutation-algorithms"><span cl <ol> <li>If <var>parent</var> is not a <code class="idl"><a data-link-type="idl" href="#document">Document</a></code>, <code class="idl"><a data-link-type="idl" href="#documentfragment">DocumentFragment</a></code>, or <code class="idl"><a data-link-type="idl" href="#element">Element</a></code> <a data-link-type="dfn" href="#concept-node">node</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#hierarchyrequesterror">HierarchyRequestError</a></code>. <li>If <var>node</var> is a <a data-link-type="dfn" href="#concept-tree-host-including-inclusive-ancestor">host-including inclusive ancestor</a> of <var>parent</var>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#hierarchyrequesterror">HierarchyRequestError</a></code>. - <li>If <var>child</var>’s <a data-link-type="dfn" href="#concept-tree-parent">parent</a> is not <var>parent</var>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notfounderror">NotFoundError</a></code> exception. + <li>If <var>child</var>’s <a data-link-type="dfn" href="#concept-tree-parent">parent</a> is not <var>parent</var>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notfounderror">NotFoundError</a></code>. <li>If <var>node</var> is not a <code class="idl"><a data-link-type="idl" href="#documentfragment">DocumentFragment</a></code>, <code class="idl"><a data-link-type="idl" href="#documenttype">DocumentType</a></code>, <code class="idl"><a data-link-type="idl" href="#element">Element</a></code>, <code class="idl"><a data-link-type="idl" href="#text">Text</a></code>, <code class="idl"><a data-link-type="idl" href="#processinginstruction">ProcessingInstruction</a></code>, or <code class="idl"><a data-link-type="idl" href="#comment">Comment</a></code> <a data-link-type="dfn" href="#concept-node">node</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#hierarchyrequesterror">HierarchyRequestError</a></code>. <li>If either <var>node</var> is a <code class="idl"><a data-link-type="idl" href="#text">Text</a></code> <a data-link-type="dfn" href="#concept-node">node</a> and <var>parent</var> is a <a data-link-type="dfn" href="#concept-document">document</a>, or <var>node</var> is a <a data-link-type="dfn" href="#concept-doctype">doctype</a> and <var>parent</var> is not a <a data-link-type="dfn" href="#concept-document">document</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#hierarchyrequesterror">HierarchyRequestError</a></code>. @@ -1253,7 +1369,7 @@ <h4 class="heading settled" data-level="4.2.3" id="mutation-algorithms"><span cl <p class="note no-backref" role="note">This algorithm does not make any checks with regards to the <a data-link-type="dfn" href="#concept-node-tree">node tree</a> constraints. Specification authors need to use it wisely. </p> <p>To <dfn data-dfn-for="Node" data-dfn-type="dfn" data-export="" id="concept-node-pre-remove">pre-remove<a class="self-link" href="#concept-node-pre-remove"></a></dfn> a <var>child</var> from a <var>parent</var>, run these steps:</p> <ol> - <li>If <var>child</var>’s <a data-link-type="dfn" href="#concept-tree-parent">parent</a> is not <var>parent</var>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notfounderror">NotFoundError</a></code> exception. + <li>If <var>child</var>’s <a data-link-type="dfn" href="#concept-tree-parent">parent</a> is not <var>parent</var>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notfounderror">NotFoundError</a></code>. <li><a data-link-type="dfn" href="#concept-node-remove">Remove</a> <var>child</var> from <var>parent</var>. <li>Return <var>child</var>. </ol> @@ -1275,10 +1391,24 @@ <h4 class="heading settled" data-level="4.2.3" id="mutation-algorithms"><span cl <li>Let <var>oldPreviousSibling</var> be <var>node</var>’s <a data-link-type="dfn" href="#concept-tree-previous-sibling">previous sibling</a>. <li>Let <var>oldNextSibling</var> be <var>node</var>’s <a data-link-type="dfn" href="#concept-tree-next-sibling">next sibling</a>. <li>Remove <var>node</var> from its <var>parent</var>. + <li> + <p>If <var>node</var> is <a data-link-type="dfn" href="#slotable-assigned">assigned</a>, then run <a data-link-type="dfn" href="#assign-slotables">assign slotables</a> for <var>node</var>’s <a data-link-type="dfn" href="#slotable-assigned-slot">assigned slot</a>. </p> + <li> + <p>If <var>parent</var> is a <a data-link-type="dfn" href="#concept-slot">slot</a> whose <a data-link-type="dfn" href="#slot-assigned-nodes">assigned nodes</a> is the empty list, then + run <a data-link-type="dfn" href="#signal-a-slot-change">signal a slot change</a> for <var>parent</var>. </p> + <li> + <p>If <var>node</var> has an <a data-link-type="dfn" href="#concept-tree-inclusive-descendant">inclusive descendant</a> that is a <a data-link-type="dfn" href="#concept-slot">slot</a>, then: </p> + <ol> + <li> + <p>Run <a data-link-type="dfn" href="#assign-slotables-for-a-tree">assign slotables for a tree</a> with <var>parent</var>’s <a data-link-type="dfn" href="#concept-tree">tree</a>. </p> + <li> + <p>Run <a data-link-type="dfn" href="#assign-slotables-for-a-tree">assign slotables for a tree</a> with <var>node</var>’s <a data-link-type="dfn" href="#concept-tree">tree</a> and a set + containing each <a data-link-type="dfn" href="#concept-tree-inclusive-descendant">inclusive descendant</a> of <var>node</var> that is a <a data-link-type="dfn" href="#concept-slot">slot</a>. </p> + </ol> <li> <p>Run the <a data-link-type="dfn" href="#concept-node-remove-ext">removing steps</a> with <var>node</var> and <var>parent</var>. </p> <li> - <p>If <var>node</var> is <a data-link-type="dfn" href="#concept-element-custom">custom</a>, then <a data-link-type="dfn" href="https://rawgit.com/w3c/webcomponents/15a203c8393aef0df7223ab1d43406aa11a7e71e/spec/custom/index.html#dfn-enqueue-lifecycle-callback">enqueue a custom element callback reaction</a> with <var>node</var>, callback name "<code>disconnectedCallback</code>", and an empty argument + <p>If <var>node</var> is <a data-link-type="dfn" href="#concept-element-custom">custom</a>, then <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/scripting.html#enqueue-a-custom-element-callback-reaction">enqueue a custom element callback reaction</a> with <var>node</var>, callback name "<code>disconnectedCallback</code>", and an empty argument list. </p> <p class="note" role="note">It is intentional for now that <a data-link-type="dfn" href="#concept-element-custom">custom</a> <a data-link-type="dfn" href="#concept-element">elements</a> do not get <var>parent</var> passed. This might change in the future if there is a need. </p> <li> @@ -1287,7 +1417,7 @@ <h4 class="heading settled" data-level="4.2.3" id="mutation-algorithms"><span cl <li> <p>Run the <a data-link-type="dfn" href="#concept-node-remove-ext">removing steps</a> with <var>descendant</var>. </p> <li> - <p>If <var>descendant</var> is <a data-link-type="dfn" href="#concept-element-custom">custom</a>, then <a data-link-type="dfn" href="https://rawgit.com/w3c/webcomponents/15a203c8393aef0df7223ab1d43406aa11a7e71e/spec/custom/index.html#dfn-enqueue-lifecycle-callback">enqueue a custom element callback reaction</a> with <var>descendant</var>, callback name + <p>If <var>descendant</var> is <a data-link-type="dfn" href="#concept-element-custom">custom</a>, then <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/scripting.html#enqueue-a-custom-element-callback-reaction">enqueue a custom element callback reaction</a> with <var>descendant</var>, callback name "<code>disconnectedCallback</code>", and an empty argument list. </p> </ol> <li>For each <a data-link-type="dfn" href="#concept-tree-inclusive-ancestor">inclusive ancestor</a> <var>inclusiveAncestor</var> of <var>parent</var>, if <var>inclusiveAncestor</var> has any <a data-link-type="dfn" href="#registered-observer">registered observers</a> whose <b>options</b>' <code class="idl"><a data-link-type="idl" href="#dom-mutationobserverinit-subtree">subtree</a></code> is true, then for each @@ -1296,8 +1426,7 @@ <h4 class="heading settled" data-level="4.2.3" id="mutation-algorithms"><span cl nextSibling <var>oldNextSibling</var>, and previousSibling <var>oldPreviousSibling</var>. </ol> <h4 class="heading settled" data-level="4.2.4" id="interface-nonelementparentnode"><span class="secno">4.2.4. </span><span class="content">Mixin <code class="idl"><a data-link-type="idl" href="#nonelementparentnode">NonElementParentNode</a></code></span><a class="self-link" href="#interface-nonelementparentnode"></a></h4> - <p class="note no-backref" role="note">The <code class="idl"><a data-link-type="idl" href="#dom-nonelementparentnode-getelementbyid">getElementById()</a></code> method is not on <a data-link-type="dfn" href="#concept-element">elements</a> for compatibility with older versions of jQuery. If a time comes where that -version of jQuery has disappeared, we might be able to support it. </p> + <p class="note no-backref" role="note">Web compatibility prevents the <code class="idl"><a data-link-type="idl" href="#dom-nonelementparentnode-getelementbyid">getElementById()</a></code> method from being exposed on <a data-link-type="dfn" href="#concept-element">elements</a> (and therefore on <code class="idl"><a data-link-type="idl" href="#parentnode">ParentNode</a></code>). </p> <pre class="idl def">[NoInterfaceObject, Exposed=Window] interface <dfn class="idl-code" data-dfn-type="interface" data-export="" id="nonelementparentnode">NonElementParentNode<a class="self-link" href="#nonelementparentnode"></a></dfn> { @@ -1324,18 +1453,18 @@ <h4 class="heading settled" data-level="4.2.5" id="mixin-documentorshadowroot">< <p class="note no-backref" role="note">The <code class="idl"><a data-link-type="idl" href="#documentorshadowroot">DocumentOrShadowRoot</a></code> mixin is expected to be used by other standards that want to define APIs shared between <a data-link-type="dfn" href="#concept-document">documents</a> and <a data-link-type="dfn" href="#concept-shadow-root">shadow roots</a>. </p> <h4 class="heading settled" data-level="4.2.6" id="interface-parentnode"><span class="secno">4.2.6. </span><span class="content">Mixin <code class="idl"><a data-link-type="idl" href="#parentnode">ParentNode</a></code></span><a class="self-link" href="#interface-parentnode"></a></h4> - <p>To <dfn data-dfn-type="dfn" data-export="" data-lt="converting nodes into a node" id="converting-nodes-into-a-node">convert <var>nodes</var> into a node<a class="self-link" href="#converting-nodes-into-a-node"></a></dfn>, -run these steps:</p> + <p>To <dfn data-dfn-type="dfn" data-export="" data-lt="converting nodes into a node" id="converting-nodes-into-a-node">convert nodes into a node<a class="self-link" href="#converting-nodes-into-a-node"></a></dfn>, given <var>nodes</var> and <var>document</var>, run these steps:</p> <ol> <li> <p>Let <var>node</var> be null. </p> <li> - <p>Replace each string in <var>nodes</var> with a <code class="idl"><a data-link-type="idl" href="#text">Text</a></code> <a data-link-type="dfn" href="#concept-node">node</a> whose <a data-link-type="dfn" href="#concept-cd-data">data</a> is the string. </p> + <p>Replace each string in <var>nodes</var> with a new <code class="idl"><a data-link-type="idl" href="#text">Text</a></code> <a data-link-type="dfn" href="#concept-node">node</a> whose <a data-link-type="dfn" href="#concept-cd-data">data</a> is + the string and <a data-link-type="dfn" href="#concept-node-document">node document</a> is <var>document</var>. </p> <li> <p>If <var>nodes</var> contains one <a data-link-type="dfn" href="#concept-node">node</a>, set <var>node</var> to that <a data-link-type="dfn" href="#concept-node">node</a>. </p> <li> - <p>Otherwise, set <var>node</var> to a new <code class="idl"><a data-link-type="idl" href="#documentfragment">DocumentFragment</a></code>, and then <a data-link-type="dfn" href="#concept-node-append">append</a> each <a data-link-type="dfn" href="#concept-node">node</a> in <var>nodes</var>, if any, to it. Rethrow any - exceptions. </p> + <p>Otherwise, set <var>node</var> to a new <code class="idl"><a data-link-type="idl" href="#documentfragment">DocumentFragment</a></code> whose <a data-link-type="dfn" href="#concept-node-document">node document</a> is <var>document</var>, and then <a data-link-type="dfn" href="#concept-node-append">append</a> each <a data-link-type="dfn" href="#concept-node">node</a> in <var>nodes</var>, if any, to it. + Rethrow any exceptions. </p> <li> <p>Return <var>node</var>. </p> </ol> @@ -1347,8 +1476,8 @@ <h4 class="heading settled" data-level="4.2.6" id="interface-parentnode"><span c readonly attribute <a data-link-type="idl-name" href="#element">Element</a>? <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="Element? " href="#dom-parentnode-lastelementchild">lastElementChild</a>; readonly attribute unsigned long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="unsigned long " href="#dom-parentnode-childelementcount">childElementCount</a>; - [Unscopable] void <a class="idl-code" data-link-type="method" href="#dom-parentnode-prepend">prepend</a>((<a data-link-type="idl-name" href="#node">Node</a> or DOMString)... <dfn class="idl-code" data-dfn-for="ParentNode/prepend(nodes...), ParentNode/prepend(nodes)" data-dfn-type="argument" data-export="" id="dom-parentnode-prepend-nodes-nodes">nodes<a class="self-link" href="#dom-parentnode-prepend-nodes-nodes"></a></dfn>); - [Unscopable] void <a class="idl-code" data-link-type="method" href="#dom-parentnode-append">append</a>((<a data-link-type="idl-name" href="#node">Node</a> or DOMString)... <dfn class="idl-code" data-dfn-for="ParentNode/append(nodes...), ParentNode/append(nodes)" data-dfn-type="argument" data-export="" id="dom-parentnode-append-nodes-nodes">nodes<a class="self-link" href="#dom-parentnode-append-nodes-nodes"></a></dfn>); + [CEReactions, Unscopable] void <a class="idl-code" data-link-type="method" href="#dom-parentnode-prepend">prepend</a>((<a data-link-type="idl-name" href="#node">Node</a> or DOMString)... <dfn class="idl-code" data-dfn-for="ParentNode/prepend(nodes...), ParentNode/prepend(nodes)" data-dfn-type="argument" data-export="" id="dom-parentnode-prepend-nodes-nodes">nodes<a class="self-link" href="#dom-parentnode-prepend-nodes-nodes"></a></dfn>); + [CEReactions, Unscopable] void <a class="idl-code" data-link-type="method" href="#dom-parentnode-append">append</a>((<a data-link-type="idl-name" href="#node">Node</a> or DOMString)... <dfn class="idl-code" data-dfn-for="ParentNode/append(nodes...), ParentNode/append(nodes)" data-dfn-type="argument" data-export="" id="dom-parentnode-append-nodes-nodes">nodes<a class="self-link" href="#dom-parentnode-append-nodes-nodes"></a></dfn>); <a data-link-type="idl-name" href="#element">Element</a>? <a class="idl-code" data-link-type="method" href="#dom-parentnode-queryselector">querySelector</a>(DOMString <dfn class="idl-code" data-dfn-for="ParentNode/querySelector(selectors)" data-dfn-type="argument" data-export="" id="dom-parentnode-queryselector-selectors-selectors">selectors<a class="self-link" href="#dom-parentnode-queryselector-selectors-selectors"></a></dfn>); [NewObject] <a data-link-type="idl-name" href="#nodelist">NodeList</a> <a class="idl-code" data-link-type="method" href="#dom-parentnode-queryselectorall">querySelectorAll</a>(DOMString <dfn class="idl-code" data-dfn-for="ParentNode/querySelectorAll(selectors)" data-dfn-type="argument" data-export="" id="dom-parentnode-queryselectorall-selectors-selectors">selectors<a class="self-link" href="#dom-parentnode-queryselectorall-selectors-selectors"></a></dfn>); @@ -1385,21 +1514,23 @@ <h4 class="heading settled" data-level="4.2.6" id="interface-parentnode"><span c <p>The <dfn class="idl-code" data-dfn-for="ParentNode" data-dfn-type="attribute" data-export="" id="dom-parentnode-childelementcount">childElementCount<a class="self-link" href="#dom-parentnode-childelementcount"></a></dfn> attribute must return the number of <a data-link-type="dfn" href="#concept-tree-child">children</a> of the <a data-link-type="dfn" href="#context-object">context object</a> that are <a data-link-type="dfn" href="#concept-element">elements</a>.</p> <p>The <dfn class="idl-code" data-dfn-for="ParentNode" data-dfn-type="method" data-export="" data-lt="prepend(nodes...)|prepend(nodes)" id="dom-parentnode-prepend">prepend(<var>nodes</var>)<a class="self-link" href="#dom-parentnode-prepend"></a></dfn> method must run these steps:</p> <ol> - <li>Let <var>node</var> be the result of <a data-link-type="dfn" href="#converting-nodes-into-a-node">converting <var>nodes</var> into a node</a>. - <li><a data-link-type="dfn" href="#concept-node-pre-insert">Pre-insert</a> <var>node</var> into the <a data-link-type="dfn" href="#context-object">context object</a> before the <a data-link-type="dfn" href="#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-tree-first-child">first child</a>. + <li> + <p>Let <var>node</var> be the result of <a data-link-type="dfn" href="#converting-nodes-into-a-node">converting nodes into a node</a> given <var>nodes</var> and <a data-link-type="dfn" href="#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-node-document">node document</a>. Rethrow any exceptions. </p> + <li> + <p><a data-link-type="dfn" href="#concept-node-pre-insert">Pre-insert</a> <var>node</var> into <a data-link-type="dfn" href="#context-object">context object</a> before the <a data-link-type="dfn" href="#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-tree-first-child">first child</a>. Rethrow any exceptions. </p> </ol> <p>The <dfn class="idl-code" data-dfn-for="ParentNode" data-dfn-type="method" data-export="" data-lt="append(nodes...)|append(nodes)" id="dom-parentnode-append">append(<var>nodes</var>)<a class="self-link" href="#dom-parentnode-append"></a></dfn> method must run these steps:</p> <ol> - <li>Let <var>node</var> be the result of <a data-link-type="dfn" href="#converting-nodes-into-a-node">converting <var>nodes</var> into a node</a>. - <li><a data-link-type="dfn" href="#concept-node-append">Append</a> <var>node</var> to the <a data-link-type="dfn" href="#context-object">context object</a>. + <li> + <p>Let <var>node</var> be the result of <a data-link-type="dfn" href="#converting-nodes-into-a-node">converting nodes into a node</a> given <var>nodes</var> and <a data-link-type="dfn" href="#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-node-document">node document</a>. Rethrow any exceptions. </p> + <li> + <p><a data-link-type="dfn" href="#concept-node-append">Append</a> <var>node</var> to <a data-link-type="dfn" href="#context-object">context object</a>. Rethrow any exceptions. </p> </ol> <p>The <dfn class="idl-code" data-dfn-for="ParentNode" data-dfn-type="method" data-export="" id="dom-parentnode-queryselector"><code>querySelector(<var>selectors</var>)</code><a class="self-link" href="#dom-parentnode-queryselector"></a></dfn> method, when invoked, must return the first result of running <a data-link-type="dfn" href="#scope-match-a-selectors-string">scope-match a selectors string</a> <var>selectors</var> against the <a data-link-type="dfn" href="#context-object">context object</a>, and null if the result is an empty list otherwise.</p> <p>The <dfn class="idl-code" data-dfn-for="ParentNode" data-dfn-type="method" data-export="" id="dom-parentnode-queryselectorall"><code>querySelectorAll(<var>selectors</var>)</code><a class="self-link" href="#dom-parentnode-queryselectorall"></a></dfn> method, when invoked, must return the <a data-link-type="dfn" href="#concept-collection-static">static</a> result of running <a data-link-type="dfn" href="#scope-match-a-selectors-string">scope-match a selectors string</a> <var>selectors</var> against the <a data-link-type="dfn" href="#context-object">context object</a>.</p> <h4 class="heading settled" data-level="4.2.7" id="interface-nondocumenttypechildnode"><span class="secno">4.2.7. </span><span class="content">Mixin <code class="idl"><a data-link-type="idl" href="#nondocumenttypechildnode">NonDocumentTypeChildNode</a></code></span><a class="self-link" href="#interface-nondocumenttypechildnode"></a></h4> - <p class="note no-backref" role="note">The <code class="idl"><a data-link-type="idl" href="#dom-nondocumenttypechildnode-previouselementsibling">previousElementSibling</a></code> and <code class="idl"><a data-link-type="idl" href="#dom-nondocumenttypechildnode-nextelementsibling">nextElementSibling</a></code> attributes have -been removed from <code class="idl"><a data-link-type="idl" href="#documenttype">DocumentType</a></code> nodes for compatibility reasons. If these additions are deemed -compatible enough in the future, they could be reinstated. </p> + <p class="note no-backref" role="note">Web compatibility prevents the <code class="idl"><a data-link-type="idl" href="#dom-nondocumenttypechildnode-previouselementsibling">previousElementSibling</a></code> and <code class="idl"><a data-link-type="idl" href="#dom-nondocumenttypechildnode-nextelementsibling">nextElementSibling</a></code> attributes from being exposed on <a data-link-type="dfn" href="#concept-doctype">doctypes</a> (and therefore on <code class="idl"><a data-link-type="idl" href="#childnode">ChildNode</a></code>). </p> <pre class="idl def">[NoInterfaceObject, Exposed=Window] interface <dfn class="idl-code" data-dfn-type="interface" data-export="" id="nondocumenttypechildnode">NonDocumentTypeChildNode<a class="self-link" href="#nondocumenttypechildnode"></a></dfn> { @@ -1425,10 +1556,10 @@ <h4 class="heading settled" data-level="4.2.8" id="interface-childnode"><span cl <pre class="idl def">[NoInterfaceObject, Exposed=Window] interface <dfn class="idl-code" data-dfn-type="interface" data-export="" id="childnode">ChildNode<a class="self-link" href="#childnode"></a></dfn> { - [Unscopable] void <a class="idl-code" data-link-type="method" href="#dom-childnode-before">before</a>((<a data-link-type="idl-name" href="#node">Node</a> or DOMString)... <dfn class="idl-code" data-dfn-for="ChildNode/before(nodes...), ChildNode/before(nodes)" data-dfn-type="argument" data-export="" id="dom-childnode-before-nodes-nodes">nodes<a class="self-link" href="#dom-childnode-before-nodes-nodes"></a></dfn>); - [Unscopable] void <a class="idl-code" data-link-type="method" href="#dom-childnode-after">after</a>((<a data-link-type="idl-name" href="#node">Node</a> or DOMString)... <dfn class="idl-code" data-dfn-for="ChildNode/after(nodes...), ChildNode/after(nodes)" data-dfn-type="argument" data-export="" id="dom-childnode-after-nodes-nodes">nodes<a class="self-link" href="#dom-childnode-after-nodes-nodes"></a></dfn>); - [Unscopable] void <a class="idl-code" data-link-type="method" href="#dom-childnode-replacewith">replaceWith</a>((<a data-link-type="idl-name" href="#node">Node</a> or DOMString)... <dfn class="idl-code" data-dfn-for="ChildNode/replaceWith(nodes...), ChildNode/replaceWith(nodes)" data-dfn-type="argument" data-export="" id="dom-childnode-replacewith-nodes-nodes">nodes<a class="self-link" href="#dom-childnode-replacewith-nodes-nodes"></a></dfn>); - [Unscopable] void <a class="idl-code" data-link-type="method" href="#dom-childnode-remove">remove</a>(); + [CEReactions, Unscopable] void <a class="idl-code" data-link-type="method" href="#dom-childnode-before">before</a>((<a data-link-type="idl-name" href="#node">Node</a> or DOMString)... <dfn class="idl-code" data-dfn-for="ChildNode/before(nodes...), ChildNode/before(nodes)" data-dfn-type="argument" data-export="" id="dom-childnode-before-nodes-nodes">nodes<a class="self-link" href="#dom-childnode-before-nodes-nodes"></a></dfn>); + [CEReactions, Unscopable] void <a class="idl-code" data-link-type="method" href="#dom-childnode-after">after</a>((<a data-link-type="idl-name" href="#node">Node</a> or DOMString)... <dfn class="idl-code" data-dfn-for="ChildNode/after(nodes...), ChildNode/after(nodes)" data-dfn-type="argument" data-export="" id="dom-childnode-after-nodes-nodes">nodes<a class="self-link" href="#dom-childnode-after-nodes-nodes"></a></dfn>); + [CEReactions, Unscopable] void <a class="idl-code" data-link-type="method" href="#dom-childnode-replacewith">replaceWith</a>((<a data-link-type="idl-name" href="#node">Node</a> or DOMString)... <dfn class="idl-code" data-dfn-for="ChildNode/replaceWith(nodes...), ChildNode/replaceWith(nodes)" data-dfn-type="argument" data-export="" id="dom-childnode-replacewith-nodes-nodes">nodes<a class="self-link" href="#dom-childnode-replacewith-nodes-nodes"></a></dfn>); + [CEReactions, Unscopable] void <a class="idl-code" data-link-type="method" href="#dom-childnode-remove">remove</a>(); }; <a data-link-type="idl-name" href="#documenttype">DocumentType</a> implements <a data-link-type="idl-name" href="#childnode">ChildNode</a>; <a data-link-type="idl-name" href="#element">Element</a> implements <a data-link-type="idl-name" href="#childnode">ChildNode</a>; @@ -1463,11 +1594,11 @@ <h4 class="heading settled" data-level="4.2.8" id="interface-childnode"><span cl <li> <p>Let <var>viablePreviousSibling</var> be <a data-link-type="dfn" href="#context-object">context object</a>’s first <a data-link-type="dfn" href="#concept-tree-preceding">preceding</a> <a data-link-type="dfn" href="#concept-tree-sibling">sibling</a> not in <var>nodes</var>, and null otherwise. </p> <li> - <p>Let <var>node</var> be the result of <a data-link-type="dfn" href="#converting-nodes-into-a-node">converting <var>nodes</var> into a node</a>. </p> + <p>Let <var>node</var> be the result of <a data-link-type="dfn" href="#converting-nodes-into-a-node">converting nodes into a node</a>, given <var>nodes</var> and <a data-link-type="dfn" href="#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-node-document">node document</a>. Rethrow any exceptions. </p> <li> - <p>If <var>viablePreviousSibling</var> is non-null, set it to <var>viablePreviousSibling</var>’s <a data-link-type="dfn" href="#concept-tree-next-sibling">next sibling</a>, and to <var>parent</var>’s <a data-link-type="dfn" href="#concept-tree-first-child">first child</a> otherwise. </p> + <p>If <var>viablePreviousSibling</var> is null, set it to <var>parent</var>’s <a data-link-type="dfn" href="#concept-tree-first-child">first child</a>, and to <var>viablePreviousSibling</var>’s <a data-link-type="dfn" href="#concept-tree-next-sibling">next sibling</a> otherwise. </p> <li> - <p><a data-link-type="dfn" href="#concept-node-pre-insert">Pre-insert</a> <var>node</var> into <var>parent</var> before <var>viablePreviousSibling</var>. </p> + <p><a data-link-type="dfn" href="#concept-node-pre-insert">Pre-insert</a> <var>node</var> into <var>parent</var> before <var>viablePreviousSibling</var>. Rethrow any exceptions. </p> </ol> <p>The <dfn class="idl-code" data-dfn-for="ChildNode" data-dfn-type="method" data-export="" data-lt="after(nodes...)|after(nodes)" id="dom-childnode-after"><code>after(<var>nodes</var>)</code><a class="self-link" href="#dom-childnode-after"></a></dfn> method, when invoked, must run these steps:</p> @@ -1479,9 +1610,9 @@ <h4 class="heading settled" data-level="4.2.8" id="interface-childnode"><span cl <li> <p>Let <var>viableNextSibling</var> be <a data-link-type="dfn" href="#context-object">context object</a>’s first <a data-link-type="dfn" href="#concept-tree-following">following</a> <a data-link-type="dfn" href="#concept-tree-sibling">sibling</a> not in <var>nodes</var>, and null otherwise. </p> <li> - <p>Let <var>node</var> be the result of <a data-link-type="dfn" href="#converting-nodes-into-a-node">converting <var>nodes</var> into a node</a>. </p> + <p>Let <var>node</var> be the result of <a data-link-type="dfn" href="#converting-nodes-into-a-node">converting nodes into a node</a>, given <var>nodes</var> and <a data-link-type="dfn" href="#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-node-document">node document</a>. Rethrow any exceptions. </p> <li> - <p><a data-link-type="dfn" href="#concept-node-pre-insert">Pre-insert</a> <var>node</var> into <var>parent</var> before <var>viableNextSibling</var>. </p> + <p><a data-link-type="dfn" href="#concept-node-pre-insert">Pre-insert</a> <var>node</var> into <var>parent</var> before <var>viableNextSibling</var>. Rethrow any exceptions. </p> </ol> <p>The <dfn class="idl-code" data-dfn-for="ChildNode" data-dfn-type="method" data-export="" data-lt="replaceWith(nodes...)|replaceWith(nodes)" id="dom-childnode-replacewith"><code>replaceWith(<var>nodes</var>)</code><a class="self-link" href="#dom-childnode-replacewith"></a></dfn> method, when invoked, must run these steps:</p> @@ -1493,12 +1624,12 @@ <h4 class="heading settled" data-level="4.2.8" id="interface-childnode"><span cl <li> <p>Let <var>viableNextSibling</var> be <a data-link-type="dfn" href="#context-object">context object</a>’s first <a data-link-type="dfn" href="#concept-tree-following">following</a> <a data-link-type="dfn" href="#concept-tree-sibling">sibling</a> not in <var>nodes</var>, and null otherwise. </p> <li> - <p>Let <var>node</var> be the result of <a data-link-type="dfn" href="#converting-nodes-into-a-node">converting <var>nodes</var> into a node</a>. </p> + <p>Let <var>node</var> be the result of <a data-link-type="dfn" href="#converting-nodes-into-a-node">converting nodes into a node</a>, given <var>nodes</var> and <a data-link-type="dfn" href="#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-node-document">node document</a>. Rethrow any exceptions. </p> <li> - <p>If <a data-link-type="dfn" href="#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-tree-parent">parent</a> is <var>parent</var>, <a data-link-type="dfn" href="#concept-node-replace">replace</a> the <a data-link-type="dfn" href="#context-object">context object</a> with <var>node</var> within <var>parent</var>. </p> + <p>If <a data-link-type="dfn" href="#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-tree-parent">parent</a> is <var>parent</var>, <a data-link-type="dfn" href="#concept-node-replace">replace</a> the <a data-link-type="dfn" href="#context-object">context object</a> with <var>node</var> within <var>parent</var>. Rethrow any exceptions. </p> <p class="note" role="note"><a data-link-type="dfn" href="#context-object">Context object</a> could have been inserted into <var>node</var>. </p> <li> - <p>Otherwise, <a data-link-type="dfn" href="#concept-node-pre-insert">pre-insert</a> <var>node</var> into <var>parent</var> before <var>viableNextSibling</var>. </p> + <p>Otherwise, <a data-link-type="dfn" href="#concept-node-pre-insert">pre-insert</a> <var>node</var> into <var>parent</var> before <var>viableNextSibling</var>. Rethrow any exceptions. </p> </ol> <p>The <dfn class="idl-code" data-dfn-for="ChildNode" data-dfn-type="method" data-export="" id="dom-childnode-remove"><code>remove()</code><a class="self-link" href="#dom-childnode-remove"></a></dfn> method, when invoked, must run these steps:</p> @@ -1512,7 +1643,7 @@ <h4 class="heading settled" data-level="4.2.9" id="mixin-slotable"><span class=" <pre class="idl def">[NoInterfaceObject, Exposed=Window] interface <dfn class="idl-code" data-dfn-type="interface" data-export="" id="slotable">Slotable<a class="self-link" href="#slotable"></a></dfn> { - readonly attribute <a data-link-type="idl-name">HTMLSlotElement</a>? <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="HTMLSlotElement? " href="#dom-slotable-assignedslot">assignedSlot</a>; + readonly attribute <a data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/scripting.html#htmlslotelement">HTMLSlotElement</a>? <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="HTMLSlotElement? " href="#dom-slotable-assignedslot">assignedSlot</a>; }; <a data-link-type="idl-name" href="#element">Element</a> implements <a data-link-type="idl-name" href="#slotable">Slotable</a>; <a data-link-type="idl-name" href="#text">Text</a> implements <a data-link-type="idl-name" href="#slotable">Slotable</a>; @@ -1641,6 +1772,13 @@ <h3 class="heading settled" data-level="4.3" id="mutation-observers"><span class <li>Remove all <a data-link-type="dfn" href="#transient-registered-observer">transient registered observers</a> whose <b>observer</b> is <var>mo</var>. <li>If <var>queue</var> is non-empty, call <var>mo</var>’s <a data-link-type="dfn" href="#concept-mo-callback">callback</a> with <var>queue</var> as first argument, and <var>mo</var> (itself) as second argument and <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-callback-this-value">callback this value</a>. If this throws an exception, <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#report-the-exception">report the exception</a>. </ol> + <li> + <p>Let <var>signalList</var> be a copy of <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#unit-of-related-similar-origin-browsing-contexts">unit of related similar-origin browsing contexts</a>' <a data-link-type="dfn" href="#signal-slot-list">signal slot list</a>. </p> + <li> + <p>Empty <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#unit-of-related-similar-origin-browsing-contexts">unit of related similar-origin browsing contexts</a>' <a data-link-type="dfn" href="#signal-slot-list">signal slot list</a>. </p> + <li> + <p>For each <a data-link-type="dfn" href="#concept-slot">slot</a> <var>slot</var> in <var>signalList</var>, in order, <a data-link-type="dfn" href="#concept-event-fire">fire an event</a> named <code>slotchange</code>, with its <code class="idl"><a data-link-type="idl" href="#dom-event-bubbles">bubbles</a></code> attribute set to + true, at <var>slot</var>. </p> </ol> <hr> <p>Each <a data-link-type="dfn" href="#concept-node">node</a> has an associated list of <a data-link-type="dfn" href="#registered-observer">registered observers</a>.</p> @@ -1883,11 +2021,11 @@ <h3 class="heading settled" data-level="4.4" id="interface-node"><span class="se readonly attribute <a data-link-type="idl-name" href="#node">Node</a>? <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="Node? " href="#dom-node-previoussibling">previousSibling</a>; readonly attribute <a data-link-type="idl-name" href="#node">Node</a>? <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="Node? " href="#dom-node-nextsibling">nextSibling</a>; - attribute DOMString? <a class="idl-code" data-link-type="attribute" data-type="DOMString? " href="#dom-node-nodevalue">nodeValue</a>; - attribute DOMString? <a class="idl-code" data-link-type="attribute" data-type="DOMString? " href="#dom-node-textcontent">textContent</a>; - void <a class="idl-code" data-link-type="method" href="#dom-node-normalize">normalize</a>(); + [CEReactions] attribute DOMString? <a class="idl-code" data-link-type="attribute" data-type="DOMString? " href="#dom-node-nodevalue">nodeValue</a>; + [CEReactions] attribute DOMString? <a class="idl-code" data-link-type="attribute" data-type="DOMString? " href="#dom-node-textcontent">textContent</a>; + [CEReactions] void <a class="idl-code" data-link-type="method" href="#dom-node-normalize">normalize</a>(); - [NewObject] <a data-link-type="idl-name" href="#node">Node</a> <a class="idl-code" data-link-type="method" href="#dom-node-clonenode">cloneNode</a>(optional boolean <dfn class="idl-code" data-dfn-for="Node/cloneNode(deep), Node/cloneNode()" data-dfn-type="argument" data-export="" id="dom-node-clonenode-deep-deep">deep<a class="self-link" href="#dom-node-clonenode-deep-deep"></a></dfn> = false); + [CEReactions, NewObject] <a data-link-type="idl-name" href="#node">Node</a> <a class="idl-code" data-link-type="method" href="#dom-node-clonenode">cloneNode</a>(optional boolean <dfn class="idl-code" data-dfn-for="Node/cloneNode(deep), Node/cloneNode()" data-dfn-type="argument" data-export="" id="dom-node-clonenode-deep-deep">deep<a class="self-link" href="#dom-node-clonenode-deep-deep"></a></dfn> = false); boolean <a class="idl-code" data-link-type="method" href="#dom-node-isequalnode">isEqualNode</a>(<a data-link-type="idl-name" href="#node">Node</a>? <dfn class="idl-code" data-dfn-for="Node/isEqualNode(otherNode)" data-dfn-type="argument" data-export="" id="dom-node-isequalnode-othernode-othernode">otherNode<a class="self-link" href="#dom-node-isequalnode-othernode-othernode"></a></dfn>); boolean <a class="idl-code" data-link-type="method" href="#dom-node-issamenode">isSameNode</a>(<a data-link-type="idl-name" href="#node">Node</a>? <dfn class="idl-code" data-dfn-for="Node/isSameNode(otherNode)" data-dfn-type="argument" data-export="" id="dom-node-issamenode-othernode-othernode">otherNode<a class="self-link" href="#dom-node-issamenode-othernode-othernode"></a></dfn>); // historical alias of === @@ -1904,10 +2042,10 @@ <h3 class="heading settled" data-level="4.4" id="interface-node"><span class="se DOMString? <a class="idl-code" data-link-type="method" href="#dom-node-lookupnamespaceuri">lookupNamespaceURI</a>(DOMString? <dfn class="idl-code" data-dfn-for="Node/lookupNamespaceURI(prefix)" data-dfn-type="argument" data-export="" id="dom-node-lookupnamespaceuri-prefix-prefix">prefix<a class="self-link" href="#dom-node-lookupnamespaceuri-prefix-prefix"></a></dfn>); boolean <a class="idl-code" data-link-type="method" href="#dom-node-isdefaultnamespace">isDefaultNamespace</a>(DOMString? <dfn class="idl-code" data-dfn-for="Node/isDefaultNamespace(namespace)" data-dfn-type="argument" data-export="" id="dom-node-isdefaultnamespace-namespace-namespace">namespace<a class="self-link" href="#dom-node-isdefaultnamespace-namespace-namespace"></a></dfn>); - <a data-link-type="idl-name" href="#node">Node</a> <a class="idl-code" data-link-type="method" href="#dom-node-insertbefore">insertBefore</a>(<a data-link-type="idl-name" href="#node">Node</a> <dfn class="idl-code" data-dfn-for="Node/insertBefore(node, child)" data-dfn-type="argument" data-export="" id="dom-node-insertbefore-node-child-node">node<a class="self-link" href="#dom-node-insertbefore-node-child-node"></a></dfn>, <a data-link-type="idl-name" href="#node">Node</a>? <dfn class="idl-code" data-dfn-for="Node/insertBefore(node, child)" data-dfn-type="argument" data-export="" id="dom-node-insertbefore-node-child-child">child<a class="self-link" href="#dom-node-insertbefore-node-child-child"></a></dfn>); - <a data-link-type="idl-name" href="#node">Node</a> <a class="idl-code" data-link-type="method" href="#dom-node-appendchild">appendChild</a>(<a data-link-type="idl-name" href="#node">Node</a> <dfn class="idl-code" data-dfn-for="Node/appendChild(node)" data-dfn-type="argument" data-export="" id="dom-node-appendchild-node-node">node<a class="self-link" href="#dom-node-appendchild-node-node"></a></dfn>); - <a data-link-type="idl-name" href="#node">Node</a> <a class="idl-code" data-link-type="method" href="#dom-node-replacechild">replaceChild</a>(<a data-link-type="idl-name" href="#node">Node</a> <dfn class="idl-code" data-dfn-for="Node/replaceChild(node, child)" data-dfn-type="argument" data-export="" id="dom-node-replacechild-node-child-node">node<a class="self-link" href="#dom-node-replacechild-node-child-node"></a></dfn>, <a data-link-type="idl-name" href="#node">Node</a> <dfn class="idl-code" data-dfn-for="Node/replaceChild(node, child)" data-dfn-type="argument" data-export="" id="dom-node-replacechild-node-child-child">child<a class="self-link" href="#dom-node-replacechild-node-child-child"></a></dfn>); - <a data-link-type="idl-name" href="#node">Node</a> <a class="idl-code" data-link-type="method" href="#dom-node-removechild">removeChild</a>(<a data-link-type="idl-name" href="#node">Node</a> <dfn class="idl-code" data-dfn-for="Node/removeChild(child)" data-dfn-type="argument" data-export="" id="dom-node-removechild-child-child">child<a class="self-link" href="#dom-node-removechild-child-child"></a></dfn>); + [CEReactions] <a data-link-type="idl-name" href="#node">Node</a> <a class="idl-code" data-link-type="method" href="#dom-node-insertbefore">insertBefore</a>(<a data-link-type="idl-name" href="#node">Node</a> <dfn class="idl-code" data-dfn-for="Node/insertBefore(node, child)" data-dfn-type="argument" data-export="" id="dom-node-insertbefore-node-child-node">node<a class="self-link" href="#dom-node-insertbefore-node-child-node"></a></dfn>, <a data-link-type="idl-name" href="#node">Node</a>? <dfn class="idl-code" data-dfn-for="Node/insertBefore(node, child)" data-dfn-type="argument" data-export="" id="dom-node-insertbefore-node-child-child">child<a class="self-link" href="#dom-node-insertbefore-node-child-child"></a></dfn>); + [CEReactions] <a data-link-type="idl-name" href="#node">Node</a> <a class="idl-code" data-link-type="method" href="#dom-node-appendchild">appendChild</a>(<a data-link-type="idl-name" href="#node">Node</a> <dfn class="idl-code" data-dfn-for="Node/appendChild(node)" data-dfn-type="argument" data-export="" id="dom-node-appendchild-node-node">node<a class="self-link" href="#dom-node-appendchild-node-node"></a></dfn>); + [CEReactions] <a data-link-type="idl-name" href="#node">Node</a> <a class="idl-code" data-link-type="method" href="#dom-node-replacechild">replaceChild</a>(<a data-link-type="idl-name" href="#node">Node</a> <dfn class="idl-code" data-dfn-for="Node/replaceChild(node, child)" data-dfn-type="argument" data-export="" id="dom-node-replacechild-node-child-node">node<a class="self-link" href="#dom-node-replacechild-node-child-node"></a></dfn>, <a data-link-type="idl-name" href="#node">Node</a> <dfn class="idl-code" data-dfn-for="Node/replaceChild(node, child)" data-dfn-type="argument" data-export="" id="dom-node-replacechild-node-child-child">child<a class="self-link" href="#dom-node-replacechild-node-child-child"></a></dfn>); + [CEReactions] <a data-link-type="idl-name" href="#node">Node</a> <a class="idl-code" data-link-type="method" href="#dom-node-removechild">removeChild</a>(<a data-link-type="idl-name" href="#node">Node</a> <dfn class="idl-code" data-dfn-for="Node/removeChild(child)" data-dfn-type="argument" data-export="" id="dom-node-removechild-child-child">child<a class="self-link" href="#dom-node-removechild-child-child"></a></dfn>); }; </pre> <p class="note no-backref" role="note"><code class="idl"><a data-link-type="idl" href="#node">Node</a></code> is an abstract interface and does not exist as <a data-link-type="dfn" href="#concept-node">node</a>. It @@ -2084,26 +2222,29 @@ <h3 class="heading settled" data-level="4.4" id="interface-node"><span class="se <dt>Any other node <dd>Null. </dl> - <p>The <code class="idl"><a data-link-type="idl" href="#dom-node-textcontent">textContent</a></code> attribute’s setter must, if the new value is null, act as if it was the -empty string instead, and then do as described below, switching on <a data-link-type="dfn" href="#context-object">context object</a>: </p> + <p>The <code class="idl"><a data-link-type="idl" href="#dom-node-textcontent">textContent</a></code> attribute’s setter must, if the given value is null, act as if it was +the empty string instead, and then do as described below, switching on <a data-link-type="dfn" href="#context-object">context object</a>: </p> <dl class="switch"> <dt><code class="idl"><a data-link-type="idl" href="#documentfragment">DocumentFragment</a></code> <dt><code class="idl"><a data-link-type="idl" href="#shadowroot">ShadowRoot</a></code> <dt><code class="idl"><a data-link-type="idl" href="#element">Element</a></code> <dd> <ol> - <li>Let <var>node</var> be null. - <li>If new value is not the empty string, set <var>node</var> to - a new <code class="idl"><a data-link-type="idl" href="#text">Text</a></code> <a data-link-type="dfn" href="#concept-node">node</a> whose <a data-link-type="dfn" href="#concept-cd-data">data</a> is new value. - <li><a data-link-type="dfn" href="#concept-node-replace-all">Replace all</a> with <var>node</var> within the <a data-link-type="dfn" href="#context-object">context object</a>. + <li> + <p>Let <var>node</var> be null. </p> + <li> + <p>If the given value is not the empty string, set <var>node</var> to a new <code class="idl"><a data-link-type="idl" href="#text">Text</a></code> <a data-link-type="dfn" href="#concept-node">node</a> whose <a data-link-type="dfn" href="#concept-cd-data">data</a> is the given value and <a data-link-type="dfn" href="#concept-node-document">node document</a> is <a data-link-type="dfn" href="#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-node-document">node document</a>. </p> + <li> + <p><a data-link-type="dfn" href="#concept-node-replace-all">Replace all</a> with <var>node</var> within the <a data-link-type="dfn" href="#context-object">context object</a>. </p> </ol> <dt><code class="idl"><a data-link-type="idl" href="#text">Text</a></code> <dt><code class="idl"><a data-link-type="idl" href="#processinginstruction">ProcessingInstruction</a></code> <dt><code class="idl"><a data-link-type="idl" href="#comment">Comment</a></code> - <dd><a data-link-type="dfn" href="#concept-cd-replace">Replace data</a> with node <a data-link-type="dfn" href="#context-object">context object</a>, offset 0, count <code class="idl"><a data-link-type="idl" href="#dom-characterdata-length">length</a></code> attribute value, and - data new value. + <dd> + <p><a data-link-type="dfn" href="#concept-cd-replace">Replace data</a> with node <a data-link-type="dfn" href="#context-object">context object</a>, offset 0, count <code class="idl"><a data-link-type="idl" href="#dom-characterdata-length">length</a></code> attribute value, and data the given value. </p> <dt>Any other node - <dd>Do nothing. + <dd> + <p>Do nothing. </p> </dl> <hr> <dl class="domintro"> @@ -2156,7 +2297,7 @@ <h3 class="heading settled" data-level="4.4" id="interface-node"><span class="se <p>If <var>node</var> is an <a data-link-type="dfn" href="#concept-element">element</a>, then: </p> <ol> <li> - <p>Let <var>copy</var> be the result of <a data-link-type="dfn" href="#concept-create-element">creating an element</a>, given <var>document</var>, <var>node</var>’s <a data-link-type="dfn" href="#concept-element-local-name">local name</a>, <var>node</var>’s <a data-link-type="dfn" href="#concept-element-namespace-prefix">namespace prefix</a>, <var>node</var>’s <a data-link-type="dfn" href="#concept-element-namespace">namespace</a>, and the + <p>Let <var>copy</var> be the result of <a data-link-type="dfn" href="#concept-create-element">creating an element</a>, given <var>document</var>, <var>node</var>’s <a data-link-type="dfn" href="#concept-element-local-name">local name</a>, <var>node</var>’s <a data-link-type="dfn" href="#concept-element-namespace">namespace</a>, <var>node</var>’s <a data-link-type="dfn" href="#concept-element-namespace-prefix">namespace prefix</a>, and the value of <var>node</var>’s <code>is</code> attribute if present (or null if not). The <var>synchronous custom elements flag</var> should be unset. </p> <li> <p>For each <var>attribute</var> in <var>node</var>’s <a data-link-type="dfn" href="#concept-element-attribute">attribute list</a>, in order, run these substeps: </p> @@ -2199,7 +2340,7 @@ <h3 class="heading settled" data-level="4.4" id="interface-node"><span class="se invoked, must run these steps: </p> <ol> <li> - <p>If <a data-link-type="dfn" href="#context-object">context object</a> is a <a data-link-type="dfn" href="#concept-shadow-root">shadow root</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code> exception. </p> + <p>If <a data-link-type="dfn" href="#context-object">context object</a> is a <a data-link-type="dfn" href="#concept-shadow-root">shadow root</a>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code>. </p> <li> <p>Return a <a data-link-type="dfn" href="#concept-node-clone">clone</a> of the <a data-link-type="dfn" href="#context-object">context object</a>, with the <i>clone children flag</i> set if <var>deep</var> is true. </p> </ol> @@ -2435,8 +2576,8 @@ <h3 class="heading settled" data-level="4.5" id="interface-document"><span class [NewObject] <a data-link-type="idl-name" href="#comment">Comment</a> <a class="idl-code" data-link-type="method" href="#dom-document-createcomment">createComment</a>(DOMString <dfn class="idl-code" data-dfn-for="Document/createComment(data)" data-dfn-type="argument" data-export="" id="dom-document-createcomment-data-data">data<a class="self-link" href="#dom-document-createcomment-data-data"></a></dfn>); [NewObject] <a data-link-type="idl-name" href="#processinginstruction">ProcessingInstruction</a> <a class="idl-code" data-link-type="method" href="#dom-document-createprocessinginstruction">createProcessingInstruction</a>(DOMString <dfn class="idl-code" data-dfn-for="Document/createProcessingInstruction(target, data)" data-dfn-type="argument" data-export="" id="dom-document-createprocessinginstruction-target-data-target">target<a class="self-link" href="#dom-document-createprocessinginstruction-target-data-target"></a></dfn>, DOMString <dfn class="idl-code" data-dfn-for="Document/createProcessingInstruction(target, data)" data-dfn-type="argument" data-export="" id="dom-document-createprocessinginstruction-target-data-data">data<a class="self-link" href="#dom-document-createprocessinginstruction-target-data-data"></a></dfn>); - [NewObject] <a data-link-type="idl-name" href="#node">Node</a> <a class="idl-code" data-link-type="method" href="#dom-document-importnode">importNode</a>(<a data-link-type="idl-name" href="#node">Node</a> <dfn class="idl-code" data-dfn-for="Document/importNode(node, deep), Document/importNode(node)" data-dfn-type="argument" data-export="" id="dom-document-importnode-node-deep-node">node<a class="self-link" href="#dom-document-importnode-node-deep-node"></a></dfn>, optional boolean <dfn class="idl-code" data-dfn-for="Document/importNode(node, deep), Document/importNode(node)" data-dfn-type="argument" data-export="" id="dom-document-importnode-node-deep-deep">deep<a class="self-link" href="#dom-document-importnode-node-deep-deep"></a></dfn> = false); - <a data-link-type="idl-name" href="#node">Node</a> <a class="idl-code" data-link-type="method" href="#dom-document-adoptnode">adoptNode</a>(<a data-link-type="idl-name" href="#node">Node</a> <dfn class="idl-code" data-dfn-for="Document/adoptNode(node)" data-dfn-type="argument" data-export="" id="dom-document-adoptnode-node-node">node<a class="self-link" href="#dom-document-adoptnode-node-node"></a></dfn>); + [CEReactions, NewObject] <a data-link-type="idl-name" href="#node">Node</a> <a class="idl-code" data-link-type="method" href="#dom-document-importnode">importNode</a>(<a data-link-type="idl-name" href="#node">Node</a> <dfn class="idl-code" data-dfn-for="Document/importNode(node, deep), Document/importNode(node)" data-dfn-type="argument" data-export="" id="dom-document-importnode-node-deep-node">node<a class="self-link" href="#dom-document-importnode-node-deep-node"></a></dfn>, optional boolean <dfn class="idl-code" data-dfn-for="Document/importNode(node, deep), Document/importNode(node)" data-dfn-type="argument" data-export="" id="dom-document-importnode-node-deep-deep">deep<a class="self-link" href="#dom-document-importnode-node-deep-deep"></a></dfn> = false); + [CEReactions] <a data-link-type="idl-name" href="#node">Node</a> <a class="idl-code" data-link-type="method" href="#dom-document-adoptnode">adoptNode</a>(<a data-link-type="idl-name" href="#node">Node</a> <dfn class="idl-code" data-dfn-for="Document/adoptNode(node)" data-dfn-type="argument" data-export="" id="dom-document-adoptnode-node-node">node<a class="self-link" href="#dom-document-adoptnode-node-node"></a></dfn>); [NewObject] <a data-link-type="idl-name" href="#attr">Attr</a> <a class="idl-code" data-link-type="method" href="#dom-document-createattribute">createAttribute</a>(DOMString <dfn class="idl-code" data-dfn-for="Document/createAttribute(localName)" data-dfn-type="argument" data-export="" id="dom-document-createattribute-localname-localname">localName<a class="self-link" href="#dom-document-createattribute-localname-localname"></a></dfn>); [NewObject] <a data-link-type="idl-name" href="#attr">Attr</a> <a class="idl-code" data-link-type="method" href="#dom-document-createattributens">createAttributeNS</a>(DOMString? <dfn class="idl-code" data-dfn-for="Document/createAttributeNS(namespace, qualifiedName)" data-dfn-type="argument" data-export="" id="dom-document-createattributens-namespace-qualifiedname-namespace">namespace<a class="self-link" href="#dom-document-createattributens-namespace-qualifiedname-namespace"></a></dfn>, DOMString <dfn class="idl-code" data-dfn-for="Document/createAttributeNS(namespace, qualifiedName)" data-dfn-type="argument" data-export="" id="dom-document-createattributens-namespace-qualifiedname-qualifiedname">qualifiedName<a class="self-link" href="#dom-document-createattributens-namespace-qualifiedname-qualifiedname"></a></dfn>); @@ -2560,16 +2701,15 @@ <h3 class="heading settled" data-level="4.5" id="interface-document"><span class <dt><code><var>element</var> = <var>document</var> . <a class="idl-code" data-link-type="method" href="#dom-document-createelement">createElement(localName [, options])</a></code> <dd> Returns an <a data-link-type="dfn" href="#concept-element">element</a> in the <a data-link-type="dfn" href="#html-namespace">HTML namespace</a> with <var>localName</var> as <a data-link-type="dfn" href="#concept-element-local-name">local name</a>. (In an <a data-link-type="dfn" href="#html-document">HTML document</a> <var>localName</var> is lowercased.) - <p>If <var>localName</var> does not match the <code><a class="css" data-link-type="type" href="https://www.w3.org/TR/xml/#NT-Name">Name</a></code> production an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code> exception will be thrown.</p> - <p>When supplied, <var>options</var>’ <code>is</code> member can be used to create a <a data-link-type="dfn" href="https://rawgit.com/w3c/webcomponents/15a203c8393aef0df7223ab1d43406aa11a7e71e/spec/custom/index.html#dfn-type-extension">type extension</a>.</p> + <p>If <var>localName</var> does not match the <code><a class="css" data-link-type="type" href="https://www.w3.org/TR/xml/#NT-Name">Name</a></code> production an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code> will be thrown.</p> + <p>When supplied, <var>options</var>’ <code>is</code> member can be used to create a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/scripting.html#customized-built-in-element">customized built-in element</a>.</p> <dt><code><var>element</var> = <var>document</var> . <a class="idl-code" data-link-type="method" href="#dom-document-createelementns">createElementNS(namespace, qualifiedName [, options])</a></code> <dd> Returns an <a data-link-type="dfn" href="#concept-element">element</a> with <a data-link-type="dfn" href="#concept-element-namespace">namespace</a> <var>namespace</var>. Its <a data-link-type="dfn" href="#concept-element-namespace-prefix">namespace prefix</a> will be everything before "<code>:</code>" (U+003E) in <var>qualifiedName</var> or null. Its <a data-link-type="dfn" href="#concept-element-local-name">local name</a> will be everything after "<code>:</code>" (U+003E) in <var>qualifiedName</var> or <var>qualifiedName</var>. - <p>If <var>localName</var> does not match the <code><a class="css" data-link-type="type" href="https://www.w3.org/TR/xml/#NT-Name">Name</a></code> production an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code> exception will be thrown.</p> - <p>If one of the following conditions is true a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#namespaceerror">NamespaceError</a></code> exception - will be thrown:</p> + <p>If <var>localName</var> does not match the <code><a class="css" data-link-type="type" href="https://www.w3.org/TR/xml/#NT-Name">Name</a></code> production an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code> will be thrown.</p> + <p>If one of the following conditions is true a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#namespaceerror">NamespaceError</a></code> will be thrown:</p> <ul> <li><var>localName</var> does not match the <code><a class="css" data-link-type="type" href="https://www.w3.org/TR/xml-names/#NT-QName">QName</a></code> production. <li><a data-link-type="dfn" href="#concept-element-namespace-prefix">Namespace prefix</a> is not null and <var>namespace</var> is the empty string. @@ -2578,7 +2718,7 @@ <h3 class="heading settled" data-level="4.5" id="interface-document"><span class <li><var>namespace</var> is the <a data-link-type="dfn" href="#xmlns-namespace">XMLNS namespace</a> and neither <var>qualifiedName</var> nor <a data-link-type="dfn" href="#concept-element-namespace-prefix">namespace prefix</a> is "<code>xmlns</code>". </ul> - <p>When supplied, <var>options</var>’ <code>is</code> member can be used to create a <a data-link-type="dfn" href="https://rawgit.com/w3c/webcomponents/15a203c8393aef0df7223ab1d43406aa11a7e71e/spec/custom/index.html#dfn-type-extension">type extension</a>.</p> + <p>When supplied, <var>options</var>’ <code>is</code> member can be used to create a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/scripting.html#customized-built-in-element">customized built-in element</a>.</p> <dt><code><var>documentFragment</var> = <var>document</var> . <code class="idl"><a data-link-type="idl" href="#dom-document-createdocumentfragment">createDocumentFragment()</a></code></code> <dd>Returns a <code class="idl"><a data-link-type="idl" href="#documentfragment">DocumentFragment</a></code> <a data-link-type="dfn" href="#concept-node">node</a>. <dt><code><var>text</var> = <var>document</var> . <code class="idl"><a data-link-type="idl" href="#dom-document-createtextnode">createTextNode(data)</a></code></code> @@ -2587,8 +2727,8 @@ <h3 class="heading settled" data-level="4.5" id="interface-document"><span class <dd>Returns a <code class="idl"><a data-link-type="idl" href="#comment">Comment</a></code> <a data-link-type="dfn" href="#concept-node">node</a> whose <a data-link-type="dfn" href="#concept-cd-data">data</a> is <var>data</var>. <dt><code><var>processingInstruction</var> = <var>document</var> . <code class="idl"><a data-link-type="idl" href="#dom-document-createprocessinginstruction">createProcessingInstruction(target, data)</a></code></code> <dd> Returns a <code class="idl"><a data-link-type="idl" href="#processinginstruction">ProcessingInstruction</a></code> <a data-link-type="dfn" href="#concept-node">node</a> whose <a data-link-type="dfn" href="#concept-pi-target">target</a> is <var>target</var> and <a data-link-type="dfn" href="#concept-cd-data">data</a> is <var>data</var>. - If <var>target</var> does not match the <code><a class="css" data-link-type="type" href="https://www.w3.org/TR/xml/#NT-Name">Name</a></code> production an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code> exception will be thrown. - If <var>data</var> contains "<code>?></code>" an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code> exception will be thrown. + If <var>target</var> does not match the <code><a class="css" data-link-type="type" href="https://www.w3.org/TR/xml/#NT-Name">Name</a></code> production an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code> will be thrown. + If <var>data</var> contains "<code>?></code>" an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code> will be thrown. </dl> <p>The <dfn data-dfn-type="dfn" data-export="" id="concept-element-interface">element interface<a class="self-link" href="#concept-element-interface"></a></dfn> for any <var>name</var> and <var>namespace</var> is <code class="idl"><a data-link-type="idl" href="#element">Element</a></code>, unless stated otherwise.</p> @@ -2596,17 +2736,18 @@ <h3 class="heading settled" data-level="4.5" id="interface-document"><span class <p>The <dfn class="idl-code" data-dfn-for="Document" data-dfn-type="method" data-export="" data-lt="createElement(localName, options)|createElement(localName)" id="dom-document-createelement"><code>createElement(<var>localName</var>, <var>options</var>)</code><a class="self-link" href="#dom-document-createelement"></a></dfn> method, when invoked, must run these steps:</p> <ol> - <li>If <var>localName</var> does not match the <code><a class="css" data-link-type="type" href="https://www.w3.org/TR/xml/#NT-Name">Name</a></code> production, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code> exception. + <li> + <p>If <var>localName</var> does not match the <code><a class="css" data-link-type="type" href="https://www.w3.org/TR/xml/#NT-Name">Name</a></code> production, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code>. </p> <li>If the <a data-link-type="dfn" href="#context-object">context object</a> is an <a data-link-type="dfn" href="#html-document">HTML document</a>, let <var>localName</var> be <a data-link-type="dfn" href="#converted-to-ascii-lowercase">converted to ASCII lowercase</a>. <li>Let <var>is</var> be the value of <code>is</code> member of <var>options</var>, or null if no such member exists. - <li>Let <var>definition</var> be the result of <a data-link-type="dfn" href="https://rawgit.com/w3c/webcomponents/15a203c8393aef0df7223ab1d43406aa11a7e71e/spec/custom/index.html#dfn-look-up-custom-element-definition">looking up a custom element definition</a>, given the <a data-link-type="dfn" href="#context-object">context object</a>, the <a data-link-type="dfn" href="#html-namespace">HTML namespace</a>, <var>localName</var>, and <var>is</var>. + <li>Let <var>definition</var> be the result of <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/scripting.html#look-up-a-custom-element-definition">looking up a custom element definition</a>, given the <a data-link-type="dfn" href="#context-object">context object</a>, the <a data-link-type="dfn" href="#html-namespace">HTML namespace</a>, <var>localName</var>, and <var>is</var>. <li>If <var>is</var> is non-null and <var>definition</var> is null, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notfounderror">NotFoundError</a></code>. <li>Let <var>namespace</var> be the <a data-link-type="dfn" href="#html-namespace">HTML namespace</a>, if the <a data-link-type="dfn" href="#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-document-content-type">content type</a> is "<code>text/html</code>" or "<code>application/xhtml+xml</code>", and null otherwise. - <li>Let <var>element</var> be the result of <a data-link-type="dfn" href="#concept-create-element">creating an element</a> given the <a data-link-type="dfn" href="#context-object">context object</a>, <var>localName</var>, null, <var>namespace</var>, <var>is</var>, and - with the <var>synchronous custom elements</var> flag set. Rethrow any exceptions. + <li>Let <var>element</var> be the result of <a data-link-type="dfn" href="#concept-create-element">creating an element</a> given the <a data-link-type="dfn" href="#context-object">context object</a>, <var>localName</var>, <var>namespace</var>, null, <var>is</var>, and with + the <var>synchronous custom elements</var> flag set. Rethrow any exceptions. <li>If <var>is</var> is non-null, then <a data-link-type="dfn" href="#concept-element-attributes-set-value">set an attribute value</a> for <var>element</var> using "<code>is</code>" and <var>is</var>. <li>Return <var>element</var>. @@ -2617,10 +2758,10 @@ <h3 class="heading settled" data-level="4.5" id="interface-document"><span class exceptions. <li>Let <var>is</var> be the value of <code>is</code> member of <var>options</var>, or null if no such member exists. - <li>Let <var>definition</var> be the result of <a data-link-type="dfn" href="https://rawgit.com/w3c/webcomponents/15a203c8393aef0df7223ab1d43406aa11a7e71e/spec/custom/index.html#dfn-look-up-custom-element-definition">looking up a custom element definition</a>, given the <a data-link-type="dfn" href="#context-object">context object</a>, <var>namespace</var>, <var>localName</var>, and <var>is</var>. + <li>Let <var>definition</var> be the result of <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/scripting.html#look-up-a-custom-element-definition">looking up a custom element definition</a>, given the <a data-link-type="dfn" href="#context-object">context object</a>, <var>namespace</var>, <var>localName</var>, and <var>is</var>. <li>If <var>is</var> is non-null and <var>definition</var> is null, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notfounderror">NotFoundError</a></code>. <li> - <p>Let <var>element</var> be the result of <a data-link-type="dfn" href="#concept-create-element">creating an element</a> given <var>document</var>, <var>localName</var>, <var>prefix</var>, <var>namespace</var>, <var>is</var>, + <p>Let <var>element</var> be the result of <a data-link-type="dfn" href="#concept-create-element">creating an element</a> given <var>document</var>, <var>localName</var>, <var>namespace</var>, <var>prefix</var>, <var>is</var>, and with the <var>synchronous custom elements</var> flag set. Rethrow any exceptions. </p> <li>If <var>is</var> is non-null, then <a data-link-type="dfn" href="#concept-element-attributes-set-value">set an attribute value</a> for <var>element</var> using "<code>is</code>" and <var>is</var>. @@ -2640,9 +2781,10 @@ <h3 class="heading settled" data-level="4.5" id="interface-document"><span class or that it contains two adjacent hyphens or ends with a hyphen. </p> <p>The <dfn class="idl-code" data-dfn-for="Document" data-dfn-type="method" data-export="" id="dom-document-createprocessinginstruction"><code>createProcessingInstruction(<var>target</var>, <var>data</var>)</code><a class="self-link" href="#dom-document-createprocessinginstruction"></a></dfn> method, when invoked, must run these steps:</p> <ol> - <li>If <var>target</var> does not match the <code><a class="css" data-link-type="type" href="https://www.w3.org/TR/xml/#NT-Name">Name</a></code> production, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code> exception. + <li>If <var>target</var> does not match the <code><a class="css" data-link-type="type" href="https://www.w3.org/TR/xml/#NT-Name">Name</a></code> production, + then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code>. <li>If <var>data</var> contains the string - "<code>?></code>", <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code> exception. + "<code>?></code>", then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code>. <li>Return a new <code class="idl"><a data-link-type="idl" href="#processinginstruction">ProcessingInstruction</a></code> <a data-link-type="dfn" href="#concept-node">node</a>, with <a data-link-type="dfn" href="#concept-pi-target">target</a> set to <var>target</var>, <a data-link-type="dfn" href="#concept-cd-data">data</a> set to <var>data</var>, and <a data-link-type="dfn" href="#concept-node-document">node document</a> set to the <a data-link-type="dfn" href="#context-object">context object</a>. </ol> <p class="note no-backref" role="note">No check is performed that <var>target</var> contains @@ -2653,17 +2795,20 @@ <h3 class="heading settled" data-level="4.5" id="interface-document"><span class <dd> <dd> Returns a copy of <var>node</var>. If <var>deep</var> is true, the copy also includes the <var>node</var>’s <a data-link-type="dfn" href="#concept-tree-descendant">descendants</a>. - <p>If <var>node</var> is a <a data-link-type="dfn" href="#concept-document">document</a> or a <a data-link-type="dfn" href="#concept-shadow-root">shadow root</a>, throws a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code> exception.</p> + <p>If <var>node</var> is a <a data-link-type="dfn" href="#concept-document">document</a> or a <a data-link-type="dfn" href="#concept-shadow-root">shadow root</a>, throws a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code>.</p> <dt><var>node</var> = <var>document</var> . <code class="idl"><a data-link-type="idl" href="#dom-document-adoptnode">adoptNode(node)</a></code> <dd> Moves <var>node</var> from another <a data-link-type="dfn" href="#concept-document">document</a> and returns it. - <p>If <var>node</var> is a <a data-link-type="dfn" href="#concept-document">document</a>, throws a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code> or, if <var>node</var> is a <a data-link-type="dfn" href="#concept-shadow-root">shadow root</a>, throws a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#hierarchyrequesterror">HierarchyRequestError</a></code> exception.</p> + <p>If <var>node</var> is a <a data-link-type="dfn" href="#concept-document">document</a>, throws a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code> or, if <var>node</var> is a <a data-link-type="dfn" href="#concept-shadow-root">shadow root</a>, throws a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#hierarchyrequesterror">HierarchyRequestError</a></code>.</p> </dl> <p>The <dfn class="idl-code" data-dfn-for="Document" data-dfn-type="method" data-export="" data-lt="importNode(node, deep)|importNode(node)" id="dom-document-importnode"><code>importNode(<var>node</var>, <var>deep</var>)</code><a class="self-link" href="#dom-document-importnode"></a></dfn> method, when invoked, must run these steps:</p> <ol> - <li>If <var>node</var> is a <a data-link-type="dfn" href="#concept-document">document</a> or <a data-link-type="dfn" href="#concept-shadow-root">shadow root</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code> exception. - <li>Return a <a data-link-type="dfn" href="#concept-node-clone">clone</a> of <var>node</var>, with <a data-link-type="dfn" href="#context-object">context object</a> and the <i>clone children flag</i> set if <var>deep</var> is true. + <li> + <p>If <var>node</var> is a <a data-link-type="dfn" href="#concept-document">document</a> or <a data-link-type="dfn" href="#concept-shadow-root">shadow root</a>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code>. </p> + <li> + <p>Return a <a data-link-type="dfn" href="#concept-node-clone">clone</a> of <var>node</var>, with <a data-link-type="dfn" href="#context-object">context object</a> and + the <i>clone children flag</i> set if <var>deep</var> is true. </p> </ol> <p><a data-link-type="dfn" href="#other-applicable-specifications">Specifications</a> may define <dfn data-dfn-for="Node" data-dfn-type="dfn" data-export="" id="concept-node-adopt-ext">adopting steps<a class="self-link" href="#concept-node-adopt-ext"></a></dfn> for all or some <a data-link-type="dfn" href="#concept-node">nodes</a>. The algorithm is passed <var>node</var> and <var>oldDocument</var>, as indicated in the <a data-link-type="dfn" href="#concept-node-adopt">adopt</a> algorithm.</p> <p>To <dfn data-dfn-for="Node" data-dfn-type="dfn" data-export="" id="concept-node-adopt">adopt<a class="self-link" href="#concept-node-adopt"></a></dfn> a <var>node</var> into @@ -2685,8 +2830,8 @@ <h3 class="heading settled" data-level="4.5" id="interface-document"><span class <p>The <dfn class="idl-code" data-dfn-for="Document" data-dfn-type="method" data-export="" id="dom-document-adoptnode"><code>adoptNode(<var>node</var>)</code><a class="self-link" href="#dom-document-adoptnode"></a></dfn> method, when invoked, must run these steps:</p> <ol> - <li>If <var>node</var> is a <a data-link-type="dfn" href="#concept-document">document</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code> exception. - <li>If <var>node</var> is a <a data-link-type="dfn" href="#concept-shadow-root">shadow root</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#hierarchyrequesterror">HierarchyRequestError</a></code> exception. + <li>If <var>node</var> is a <a data-link-type="dfn" href="#concept-document">document</a>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code>. + <li>If <var>node</var> is a <a data-link-type="dfn" href="#concept-shadow-root">shadow root</a>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#hierarchyrequesterror">HierarchyRequestError</a></code>. <li><a data-link-type="dfn" href="#concept-node-adopt">Adopt</a> <var>node</var> into the <a data-link-type="dfn" href="#context-object">context object</a>. <li>Return <var>node</var>. </ol> @@ -2694,7 +2839,9 @@ <h3 class="heading settled" data-level="4.5" id="interface-document"><span class <p>The <dfn class="idl-code" data-dfn-for="Document" data-dfn-type="method" data-export="" id="dom-document-createattribute"><code>createAttribute(<var>localName</var>)</code><a class="self-link" href="#dom-document-createattribute"></a></dfn> method, when invoked, must run these steps:</p> <ol> - <li>If <var>localName</var> does not match the <code><a class="css" data-link-type="type" href="https://www.w3.org/TR/xml/#NT-Name">Name</a></code> production in XML, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code> exception. + <li> + <p>If <var>localName</var> does not match the <code><a class="css" data-link-type="type" href="https://www.w3.org/TR/xml/#NT-Name">Name</a></code> production in XML, + then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code>. </p> <li>If the <a data-link-type="dfn" href="#context-object">context object</a> is an <a data-link-type="dfn" href="#html-document">HTML document</a>, let <var>localName</var> be <a data-link-type="dfn" href="#converted-to-ascii-lowercase">converted to ASCII lowercase</a>. <li>Return a new <a data-link-type="dfn" href="#concept-attribute">attribute</a> whose <a data-link-type="dfn" href="#concept-attribute-local-name">local name</a> is <var>localName</var>. </ol> @@ -2709,13 +2856,14 @@ <h3 class="heading settled" data-level="4.5" id="interface-document"><span class </ol> <hr> <p>The <dfn class="idl-code" data-dfn-for="Document" data-dfn-type="method" data-export="" id="dom-document-createevent"><code>createEvent(<var>interface</var>)</code><a class="self-link" href="#dom-document-createevent"></a></dfn> method, when -invoked, must run these steps:</p> +invoked, must run these steps: </p> <ol> - <li>Let <var>constructor</var> be null. <li> - If <var>interface</var> is an <a data-link-type="dfn" href="#ascii-case-insensitive">ASCII case-insensitive</a> match for any of the strings in the - first column in the following table, set <var>constructor</var> to the - interface in the second column on the same row as the matching string: + <p>Let <var>constructor</var> be null. </p> + <li> + <p>If <var>interface</var> is an <a data-link-type="dfn" href="#ascii-case-insensitive">ASCII case-insensitive</a> match for any of the strings in the + first column in the following table, then set <var>constructor</var> to the interface in the + second column on the same row as the matching string: </p> <table> <thead> <tr> @@ -2723,17 +2871,61 @@ <h3 class="heading settled" data-level="4.5" id="interface-document"><span class <th>Interface <td>Notes <tbody> + <tr> + <td>"<code>animationevent</code>" + <td><code class="idl"><a data-link-type="idl" href="https://drafts.csswg.org/css-animations-1/#animationevent">AnimationEvent</a></code> + <td><a data-link-type="biblio" href="#biblio-css3-animations">[CSS3-ANIMATIONS]</a> + <tr> + <td>"<code>beforeunloadevent</code>" + <td><code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/browsers.html#beforeunloadevent">BeforeUnloadEvent</a></code> + <td rowspan="2"><a data-link-type="biblio" href="#biblio-html">[HTML]</a> + <tr> + <td>"<code>closeevent</code>" + <td><code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/comms.html#closeevent">CloseEvent</a></code> + <tr> + <td>"<code>compositionevent</code>" + <td><code class="idl"><a data-link-type="idl">CompositionEvent</a></code> + <td><a data-link-type="biblio" href="#biblio-uievents">[UIEVENTS]</a> <tr> <td>"<code>customevent</code>" <td><code class="idl"><a data-link-type="idl" href="#customevent">CustomEvent</a></code> - <td rowspan="4"> + <td> + <tr> + <td>"<code>devicemotionevent</code>" + <td><code class="idl"><a data-link-type="idl">DeviceMotionEvent</a></code> + <td rowspan="2"><a data-link-type="biblio" href="#biblio-device-orientation">[DEVICE-ORIENTATION]</a> <tr> - <td>"<code>event</code> - <td rowspan="3"><code class="idl"><a data-link-type="idl" href="#event">Event</a></code> + <td>"<code>deviceorientationevent</code>" + <td><code class="idl"><a data-link-type="idl">DeviceOrientationEvent</a></code> + <tr> + <td>"<code>dragevent</code>" + <td><code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/interaction.html#dragevent">DragEvent</a></code> + <td rowspan="2"><a data-link-type="biblio" href="#biblio-html">[HTML]</a> + <tr> + <td>"<code>errorevent</code>" + <td><code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/webappapis.html#errorevent">ErrorEvent</a></code> + <tr> + <td>"<code>event</code>" + <td rowspan="2"><code class="idl"><a data-link-type="idl" href="#event">Event</a></code> + <td rowspan="2"> <tr> <td>"<code>events</code>" <tr> - <td>"<code>htmlevents</code>" + <td>"<code>focusevent</code>" + <td><code class="idl"><a data-link-type="idl">FocusEvent</a></code> + <td><a data-link-type="biblio" href="#biblio-uievents">[UIEVENTS]</a> + <tr> + <td>"<code>hashchangeevent</code>" + <td><code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/browsers.html#hashchangeevent">HashChangeEvent</a></code> + <td><a data-link-type="biblio" href="#biblio-html">[HTML]</a> + <tr> + <td>"<code>htmlevents</code>" + <td><code class="idl"><a data-link-type="idl" href="#event">Event</a></code> + <td> + <tr> + <td>"<code>idbversionchangeevent</code>" + <td><code class="idl"><a data-link-type="idl">IDBVersionChangeEvent</a></code> + <td><a data-link-type="biblio" href="#biblio-indexeddb">[INDEXEDDB]</a> <tr> <td>"<code>keyboardevent</code>" <td><code class="idl"><a data-link-type="idl" href="https://w3c.github.io/uievents/#interface-keyboardevent">KeyboardEvent</a></code> @@ -2748,22 +2940,75 @@ <h3 class="heading settled" data-level="4.5" id="interface-document"><span class <td rowspan="2"><a data-link-type="biblio" href="#biblio-uievents">[UIEVENTS]</a> <tr> <td>"<code>mouseevents</code>" + <tr> + <td>"<code>pagetransitionevent</code>" + <td><code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/browsers.html#pagetransitionevent">PageTransitionEvent</a></code> + <td rowspan="2"><a data-link-type="biblio" href="#biblio-html">[HTML]</a> + <tr> + <td>"<code>popstateevent</code>" + <td><code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/browsers.html#popstateevent">PopStateEvent</a></code> + <tr> + <td>"<code>progressevent</code>" + <td><code class="idl"><a data-link-type="idl">ProgressEvent</a></code> + <td><a data-link-type="biblio" href="#biblio-xhr">[XHR]</a> + <tr> + <td>"<code>storageevent</code>" + <td><code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/webstorage.html#storageevent">StorageEvent</a></code> + <td><a data-link-type="biblio" href="#biblio-html">[HTML]</a> + <tr> + <td>"<code>svgevents</code>" + <td><code class="idl"><a data-link-type="idl" href="#event">Event</a></code> + <td> + <tr> + <td>"<code>svgzoomevent</code>" + <td rowspan="2"><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/SVG/script.html#InterfaceSVGZoomEvent">SVGZoomEvent</a></code> + <td rowspan="2"><a data-link-type="biblio" href="#biblio-svg">[SVG]</a> + <tr> + <td>"<code>svgzoomevents</code>" + <tr> + <td>"<code>textevent</code>" + <td><code class="idl"><a data-link-type="idl">CompositionEvent</a></code> + <td><a data-link-type="biblio" href="#biblio-uievents">[UIEVENTS]</a> <tr> <td>"<code>touchevent</code>" <td><code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/touch-events/#touchevent-interface">TouchEvent</a></code> <td><a data-link-type="biblio" href="#biblio-touch-events">[TOUCH-EVENTS]</a> + <tr> + <td>"<code>trackevent</code>" + <td><code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/embedded-content.html#trackevent">TrackEvent</a></code> + <td><a data-link-type="biblio" href="#biblio-html">[HTML]</a> + <tr> + <td>"<code>transitionevent</code>" + <td><code class="idl"><a data-link-type="idl" href="https://drafts.csswg.org/css-transitions-1/#Events-TransitionEvent">TransitionEvent</a></code> + <td><a data-link-type="biblio" href="#biblio-css3-transitions">[CSS3-TRANSITIONS]</a> <tr> <td>"<code>uievent</code>" <td rowspan="2"><code class="idl"><a data-link-type="idl" href="https://w3c.github.io/uievents/#interface-uievent">UIEvent</a></code> <td rowspan="2"><a data-link-type="biblio" href="#biblio-uievents">[UIEVENTS]</a> <tr> <td>"<code>uievents</code>" + <tr> + <td>"<code>webglcontextevent</code>" + <td><code class="idl"><a data-link-type="idl">WebGLContextEvent</a></code> + <td><a data-link-type="biblio" href="#biblio-webgl">[WEBGL]</a> + <tr> + <td>"<code>wheelevent</code>" + <td><code class="idl"><a data-link-type="idl">WheelEvent</a></code> + <td><a data-link-type="biblio" href="#biblio-uievents">[UIEVENTS]</a> </table> - <li>If <var>constructor</var> is null, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code>. - <li>Let <var>event</var> be the result of <a data-link-type="dfn" href="#concept-event-constructor">invoking</a> the initial - value of <var>constructor</var> with the empty string as argument. - <li>Unset <var>event</var>’s <a data-link-type="dfn" href="#initialized-flag">initialized flag</a>. - <li>Return <var>event</var>. + <li> + <p>If <var>constructor</var> is null, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code>. </p> + <li> + <p>If the initial value of <var>constructor</var> is undefined, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code>. </p> + <p class="note" role="note">Typically user agents disable support for touch events in some configurations, in + which case the initial value of <code class="idl"><a data-link-type="idl" href="https://www.w3.org/TR/touch-events/#touchevent-interface">TouchEvent</a></code> is undefined. </p> + <li> + <p>Let <var>event</var> be the result of <a data-link-type="dfn" href="#concept-event-constructor">invoking</a> the initial + value of <var>constructor</var> with the empty string as argument. </p> + <li> + <p>Unset <var>event</var>’s <a data-link-type="dfn" href="#initialized-flag">initialized flag</a>. </p> + <li> + <p>Return <var>event</var>. </p> </ol> <p class="note" role="note"><a data-link-type="dfn" href="#concept-event">Event</a> constructors ought to be used instead. </p> <hr> @@ -2804,8 +3049,7 @@ <h4 class="heading settled" data-level="4.5.1" id="interface-domimplementation"> <dl class="domintro"> <dt><code><var>doctype</var> = <var>document</var> . <code class="idl"><a data-link-type="idl" href="#dom-document-implementation">implementation</a></code> . <code class="idl"><a data-link-type="idl" href="#dom-domimplementation-createdocumenttype">createDocumentType(qualifiedName, publicId, systemId)</a></code></code> <dd> Returns a <a data-link-type="dfn" href="#concept-doctype">doctype</a>, with the given <var>qualifiedName</var>, <var>publicId</var>, and <var>systemId</var>. If <var>qualifiedName</var> does not - match the <code><a class="css" data-link-type="type" href="https://www.w3.org/TR/xml/#NT-Name">Name</a></code> production, an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code> exception is thrown, and if it does not match the <code><a class="css" data-link-type="type" href="https://www.w3.org/TR/xml-names/#NT-QName">QName</a></code> production, a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#namespaceerror">NamespaceError</a></code> exception - is thrown. + match the <code><a class="css" data-link-type="type" href="https://www.w3.org/TR/xml/#NT-Name">Name</a></code> production, an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code> is thrown, and if it does not match the <code><a class="css" data-link-type="type" href="https://www.w3.org/TR/xml-names/#NT-QName">QName</a></code> production, a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#namespaceerror">NamespaceError</a></code> is thrown. <dt><code><var>doc</var> = <var>document</var> . <code class="idl"><a data-link-type="idl" href="#dom-document-implementation">implementation</a></code> . <a class="idl-code" data-link-type="method" href="#dom-domimplementation-createdocument">createDocument(<var>namespace</var>, <var>qualifiedName</var> [, <var>doctype</var> = null])</a></code> <dd> Returns an <code class="idl"><a data-link-type="idl" href="#xmldocument">XMLDocument</a></code>, with a <a data-link-type="dfn" href="#document-element">document element</a> whose <a data-link-type="dfn" href="#concept-element-local-name">local name</a> is <var>qualifiedName</var> and whose <a data-link-type="dfn" href="#concept-element-namespace">namespace</a> is <var>namespace</var> (unless <var>qualifiedName</var> is the @@ -2844,26 +3088,50 @@ <h4 class="heading settled" data-level="4.5.1" id="interface-domimplementation"> <li> <p><var>document</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#concept-origin">origin</a> is the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#concept-origin">origin</a> of the <a data-link-type="dfn" href="#context-object">context object</a>’s associated <a data-link-type="dfn" href="#concept-document">document</a>. <a data-link-type="biblio" href="#biblio-html">[HTML]</a> </p> + <li> + <p><var>document</var>’s <a data-link-type="dfn" href="#concept-document-content-type">content type</a> is determined by <var>namespace</var>: </p> + <dl class="switch"> + <dt><a data-link-type="dfn" href="#html-namespace">HTML namespace</a> + <dd><code>application/xhtml+xml</code> + <dt><a data-link-type="dfn" href="#svg-namespace">SVG namespace</a> + <dd><code>image/svg+xml</code> + <dt>Any other namespace + <dd><code>application/xml</code> + </dl> <li> <p>Return <var>document</var>. </p> </ol> <p>The <dfn class="idl-code" data-dfn-for="DOMImplementation" data-dfn-type="method" data-export="" data-lt="createHTMLDocument(title)|createHTMLDocument()" id="dom-domimplementation-createhtmldocument"><code>createHTMLDocument(<var>title</var>)</code><a class="self-link" href="#dom-domimplementation-createhtmldocument"></a></dfn> method, when invoked, must run these steps:</p> <ol> - <li>Let <var>doc</var> be a new <a data-link-type="dfn" href="#concept-document">document</a> that is an <a data-link-type="dfn" href="#html-document">HTML document</a>. - <li>Set <var>doc</var>’s <a data-link-type="dfn" href="#concept-document-content-type">content type</a> to "<code>text/html</code>". - <li><a data-link-type="dfn" href="#concept-node-append">Append</a> a new <a data-link-type="dfn" href="#concept-doctype">doctype</a>, with "<code>html</code>" as its <a data-link-type="dfn" href="#concept-doctype-name">name</a> and with its <a data-link-type="dfn" href="#concept-node-document">node document</a> set to <var>doc</var>, to <var>doc</var>. - <li><a data-link-type="dfn" href="#concept-node-append">Append</a> a new <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-html-element">html</a></code> element in the <span>HTML namespace</span>, to <var>doc</var>. - <li><a data-link-type="dfn" href="#concept-node-append">Append</a> a new <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-head-element">head</a></code> element in the <span>HTML namespace</span>, to the <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-html-element">html</a></code> element created earlier. <li> - If the <var>title</var> argument is not omitted: + <p>Let <var>doc</var> be a new <a data-link-type="dfn" href="#concept-document">document</a> that is an <a data-link-type="dfn" href="#html-document">HTML document</a>. </p> + <li> + <p>Set <var>doc</var>’s <a data-link-type="dfn" href="#concept-document-content-type">content type</a> to "<code>text/html</code>". </p> + <li> + <p><a data-link-type="dfn" href="#concept-node-append">Append</a> a new <a data-link-type="dfn" href="#concept-doctype">doctype</a>, with "<code>html</code>" as its <a data-link-type="dfn" href="#concept-doctype-name">name</a> and with its <a data-link-type="dfn" href="#concept-node-document">node document</a> set to <var>doc</var>, to <var>doc</var>. </p> + <li> + <p><a data-link-type="dfn" href="#concept-node-append">Append</a> the result of <a data-link-type="dfn" href="#concept-create-element">creating an element</a> given <var>doc</var>, <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-html-element">html</a></code>, and + the <a data-link-type="dfn" href="#html-namespace">HTML namespace</a>, to <var>doc</var>. </p> + <li> + <p><a data-link-type="dfn" href="#concept-node-append">Append</a> the result of <a data-link-type="dfn" href="#concept-create-element">creating an element</a> given <var>doc</var>, <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-head-element">head</a></code>, and + the <a data-link-type="dfn" href="#html-namespace">HTML namespace</a>, to the <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-html-element">html</a></code> element created earlier. </p> + <li> + <p>If <var>title</var> is given: </p> <ol> - <li><a data-link-type="dfn" href="#concept-node-append">Append</a> a new <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-title-element">title</a></code> element in the <a data-link-type="dfn" href="#html-namespace">HTML namespace</a>, to the <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-head-element">head</a></code> element created earlier. - <li><a data-link-type="dfn" href="#concept-node-append">Append</a> a new <code class="idl"><a data-link-type="idl" href="#text">Text</a></code> <a data-link-type="dfn" href="#concept-node">node</a>, with its <a data-link-type="dfn" href="#concept-cd-data">data</a> set to <var>title</var> (which could be the empty string), to the <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-title-element">title</a></code> element created - earlier. + <li> + <p><a data-link-type="dfn" href="#concept-node-append">Append</a> the result of <a data-link-type="dfn" href="#concept-create-element">creating an element</a> given <var>doc</var>, <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-title-element">title</a></code>, + and the <a data-link-type="dfn" href="#html-namespace">HTML namespace</a>, to the <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-head-element">head</a></code> element created earlier. </p> + <li> + <p><a data-link-type="dfn" href="#concept-node-append">Append</a> a new <code class="idl"><a data-link-type="idl" href="#text">Text</a></code> <a data-link-type="dfn" href="#concept-node">node</a>, with its <a data-link-type="dfn" href="#concept-cd-data">data</a> set to <var>title</var> (which could be the empty string) and its <a data-link-type="dfn" href="#concept-node-document">node document</a> set to <var>doc</var>, to the <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-title-element">title</a></code> element created earlier. </p> </ol> - <li><a data-link-type="dfn" href="#concept-node-append">Append</a> a new <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-body-element">body</a></code> element in the <a data-link-type="dfn" href="#html-namespace">HTML namespace</a>, to the <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-html-element">html</a></code> element created earlier. - <li><var>doc</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#concept-origin">origin</a> is the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#concept-origin">origin</a> of the <a data-link-type="dfn" href="#context-object">context object</a>’s associated <a data-link-type="dfn" href="#concept-document">document</a>. <a data-link-type="biblio" href="#biblio-html">[HTML]</a> - <li>Return <var>doc</var>. + <li> + <p><a data-link-type="dfn" href="#concept-node-append">Append</a> the result of <a data-link-type="dfn" href="#concept-create-element">creating an element</a> given <var>doc</var>, <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-body-element">body</a></code>, and + the <a data-link-type="dfn" href="#html-namespace">HTML namespace</a>, to the <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-html-element">html</a></code> element created earlier.</p> + <li> + <p><var>doc</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#concept-origin">origin</a> is the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#concept-origin">origin</a> of the <a data-link-type="dfn" href="#context-object">context object</a>’s + associated <a data-link-type="dfn" href="#concept-document">document</a>. <a data-link-type="biblio" href="#biblio-html">[HTML]</a> </p> + <li> + <p>Return <var>doc</var>. </p> </ol> <p>The <dfn class="idl-code" data-dfn-for="DOMImplementation" data-dfn-type="method" data-export="" id="dom-domimplementation-hasfeature"><code>hasFeature()</code><a class="self-link" href="#dom-domimplementation-hasfeature"></a></dfn> method, when invoked, must return true.</p> @@ -2924,12 +3192,13 @@ <h3 class="heading settled" data-level="4.8" id="interface-shadowroot"><span cla <p>The <dfn class="idl-code" data-dfn-for="ShadowRoot" data-dfn-type="attribute" data-export="" id="dom-shadowroot-mode"><code>mode</code><a class="self-link" href="#dom-shadowroot-mode"></a></dfn> attribute’s getter must return the <a data-link-type="dfn" href="#context-object">context object</a>’s <a data-link-type="dfn" href="#shadowroot-mode">mode</a>.</p> <p>The <dfn class="idl-code" data-dfn-for="ShadowRoot" data-dfn-type="attribute" data-export="" id="dom-shadowroot-host"><code>host</code><a class="self-link" href="#dom-shadowroot-host"></a></dfn> attribute’s getter must return the <a data-link-type="dfn" href="#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-documentfragment-host">host</a>. </p> <hr> - <p>In <dfn data-dfn-type="dfn" data-export="" id="concept-shadow-including-tree-order">shadow-including tree order<a class="self-link" href="#concept-shadow-including-tree-order"></a></dfn>, is <a data-link-type="dfn" href="#shadow-including-preorder-depth-first-traversal">shadow-including preorder, depth-first traversal</a> of a <a data-link-type="dfn" href="#concept-node-tree">node tree</a>. <dfn data-dfn-type="dfn" data-noexport="" id="shadow-including-preorder-depth-first-traversal">shadow-including preorder, depth-first traversal<a class="self-link" href="#shadow-including-preorder-depth-first-traversal"></a></dfn> of a <a data-link-type="dfn" href="#concept-node-tree">node tree</a> <var>tree</var> is preorder, depth-first traversal of <var>tree</var>, with for each <a data-link-type="dfn" href="#concept-element">element</a> <var>element</var> encountered in <var>tree</var> with a non-null <a data-link-type="dfn" href="#concept-element-shadow-root">shadow root</a>, <a data-link-type="dfn" href="#shadow-including-preorder-depth-first-traversal">shadow-including preorder, depth-first traversal</a> of that <a data-link-type="dfn" href="#concept-element">element</a>’s <a data-link-type="dfn" href="#concept-element-shadow-root">shadow root</a>’s <a data-link-type="dfn" href="#concept-node-tree">node tree</a> just after it is -encountered. </p> + <p>In <dfn data-dfn-type="dfn" data-export="" id="concept-shadow-including-tree-order">shadow-including tree order<a class="self-link" href="#concept-shadow-including-tree-order"></a></dfn>, is <a data-link-type="dfn" href="#shadow-including-preorder-depth-first-traversal">shadow-including preorder, depth-first traversal</a> of a <a data-link-type="dfn" href="#concept-node-tree">node tree</a>. <dfn data-dfn-type="dfn" data-noexport="" id="shadow-including-preorder-depth-first-traversal">shadow-including preorder, depth-first traversal<a class="self-link" href="#shadow-including-preorder-depth-first-traversal"></a></dfn> of a <a data-link-type="dfn" href="#concept-node-tree">node tree</a> <var>tree</var> is preorder, depth-first traversal of <var>tree</var>, with for each <a data-link-type="dfn" href="#element-shadow-host">shadow host</a> encountered in <var>tree</var>, <a data-link-type="dfn" href="#shadow-including-preorder-depth-first-traversal">shadow-including preorder, depth-first traversal</a> of that <a data-link-type="dfn" href="#concept-element">element</a>’s <a data-link-type="dfn" href="#concept-element-shadow-root">shadow root</a>’s <a data-link-type="dfn" href="#concept-node-tree">node tree</a> just after it is encountered. </p> <p>The <dfn data-dfn-type="dfn" data-export="" id="concept-shadow-including-root">shadow-including root<a class="self-link" href="#concept-shadow-including-root"></a></dfn> of an object is its <a data-link-type="dfn" href="#concept-tree-root">root</a>’s <a data-link-type="dfn" href="#concept-documentfragment-host">host</a>’s <a data-link-type="dfn" href="#concept-shadow-including-root">shadow-including root</a>, if the object’s <a data-link-type="dfn" href="#concept-tree-root">root</a> is a <a data-link-type="dfn" href="#concept-shadow-root">shadow root</a>, and its <a data-link-type="dfn" href="#concept-tree-root">root</a> otherwise.</p> <p>An object <var>A</var> is a <dfn data-dfn-type="dfn" data-export="" id="concept-shadow-including-descendant">shadow-including descendant<a class="self-link" href="#concept-shadow-including-descendant"></a></dfn> of an object <var>B</var>, if <var>A</var> is a <a data-link-type="dfn" href="#concept-tree-descendant">descendant</a> of <var>B</var>, or <var>A</var>’s <a data-link-type="dfn" href="#concept-tree-root">root</a> is a <a data-link-type="dfn" href="#concept-shadow-root">shadow root</a> and <var>A</var>’s <a data-link-type="dfn" href="#concept-tree-root">root</a>’s <a data-link-type="dfn" href="#concept-documentfragment-host">host</a> is a <a data-link-type="dfn" href="#concept-shadow-including-inclusive-descendant">shadow-including inclusive descendant</a> of <var>B</var>. </p> <p>A <dfn data-dfn-type="dfn" data-export="" id="concept-shadow-including-inclusive-descendant">shadow-including inclusive descendant<a class="self-link" href="#concept-shadow-including-inclusive-descendant"></a></dfn> is an object or one of its <a data-link-type="dfn" href="#concept-shadow-including-descendant">shadow-including descendants</a>. </p> + <p>An object <var>A</var> is a <dfn data-dfn-type="dfn" data-export="" id="concept-shadow-including-ancestor">shadow-including ancestor<a class="self-link" href="#concept-shadow-including-ancestor"></a></dfn> of an object <var>B</var>, if and only if <var>B</var> is a <a data-link-type="dfn" href="#concept-shadow-including-descendant">shadow-including descendant</a> of <var>A</var>. </p> + <p>A <dfn data-dfn-type="dfn" data-export="" id="concept-shadow-including-inclusive-ancestor">shadow-including inclusive ancestor<a class="self-link" href="#concept-shadow-including-inclusive-ancestor"></a></dfn> is an object or one of its <a data-link-type="dfn" href="#concept-shadow-including-ancestor">shadow-including ancestors</a>. </p> <hr> <p class="XXX">For now you can find more information about this object in <a href="https://w3c.github.io/webcomponents/spec/shadow/">Shadow DOM</a>. The DOM Standard will be updated over time to cover more details. </p> @@ -2941,28 +3210,28 @@ <h3 class="heading settled" data-level="4.9" id="interface-element"><span class= readonly attribute DOMString <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="DOMString " href="#dom-element-localname">localName</a>; readonly attribute DOMString <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="DOMString " href="#dom-element-tagname">tagName</a>; - attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-element-id">id</a>; - attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-element-classname">className</a>; - [SameObject, PutForwards=<a class="idl-code" data-link-type="attribute" href="#dom-domtokenlist-value">value</a>] readonly attribute <a data-link-type="idl-name" href="#domtokenlist">DOMTokenList</a> <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="DOMTokenList " href="#dom-element-classlist">classList</a>; - attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-element-slot">slot</a>; + [CEReactions] attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-element-id">id</a>; + [CEReactions] attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-element-classname">className</a>; + [CEReactions, SameObject, PutForwards=<a class="idl-code" data-link-type="attribute" href="#dom-domtokenlist-value">value</a>] readonly attribute <a data-link-type="idl-name" href="#domtokenlist">DOMTokenList</a> <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="DOMTokenList " href="#dom-element-classlist">classList</a>; + [CEReactions] attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-element-slot">slot</a>; boolean <a class="idl-code" data-link-type="method" href="#dom-element-hasattributes">hasAttributes</a>(); [SameObject] readonly attribute <a data-link-type="idl-name" href="#namednodemap">NamedNodeMap</a> <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="NamedNodeMap " href="#dom-element-attributes">attributes</a>; sequence<DOMString> <a class="idl-code" data-link-type="method" href="#dom-element-getattributenames">getAttributeNames</a>(); DOMString? <a class="idl-code" data-link-type="method" href="#dom-element-getattribute">getAttribute</a>(DOMString <dfn class="idl-code" data-dfn-for="Element/getAttribute(qualifiedName)" data-dfn-type="argument" data-export="" id="dom-element-getattribute-qualifiedname-qualifiedname">qualifiedName<a class="self-link" href="#dom-element-getattribute-qualifiedname-qualifiedname"></a></dfn>); DOMString? <a class="idl-code" data-link-type="method" href="#dom-element-getattributens">getAttributeNS</a>(DOMString? <dfn class="idl-code" data-dfn-for="Element/getAttributeNS(namespace, localName)" data-dfn-type="argument" data-export="" id="dom-element-getattributens-namespace-localname-namespace">namespace<a class="self-link" href="#dom-element-getattributens-namespace-localname-namespace"></a></dfn>, DOMString <dfn class="idl-code" data-dfn-for="Element/getAttributeNS(namespace, localName)" data-dfn-type="argument" data-export="" id="dom-element-getattributens-namespace-localname-localname">localName<a class="self-link" href="#dom-element-getattributens-namespace-localname-localname"></a></dfn>); - void <a class="idl-code" data-link-type="method" href="#dom-element-setattribute">setAttribute</a>(DOMString <dfn class="idl-code" data-dfn-for="Element/setAttribute(qualifiedName, value)" data-dfn-type="argument" data-export="" id="dom-element-setattribute-qualifiedname-value-qualifiedname">qualifiedName<a class="self-link" href="#dom-element-setattribute-qualifiedname-value-qualifiedname"></a></dfn>, DOMString <dfn class="idl-code" data-dfn-for="Element/setAttribute(qualifiedName, value)" data-dfn-type="argument" data-export="" id="dom-element-setattribute-qualifiedname-value-value">value<a class="self-link" href="#dom-element-setattribute-qualifiedname-value-value"></a></dfn>); - void <a class="idl-code" data-link-type="method" href="#dom-element-setattributens">setAttributeNS</a>(DOMString? <dfn class="idl-code" data-dfn-for="Element/setAttributeNS(namespace, qualifiedName, value)" data-dfn-type="argument" data-export="" id="dom-element-setattributens-namespace-qualifiedname-value-namespace">namespace<a class="self-link" href="#dom-element-setattributens-namespace-qualifiedname-value-namespace"></a></dfn>, DOMString <dfn class="idl-code" data-dfn-for="Element/setAttributeNS(namespace, qualifiedName, value)" data-dfn-type="argument" data-export="" id="dom-element-setattributens-namespace-qualifiedname-value-qualifiedname">qualifiedName<a class="self-link" href="#dom-element-setattributens-namespace-qualifiedname-value-qualifiedname"></a></dfn>, DOMString <dfn class="idl-code" data-dfn-for="Element/setAttributeNS(namespace, qualifiedName, value)" data-dfn-type="argument" data-export="" id="dom-element-setattributens-namespace-qualifiedname-value-value">value<a class="self-link" href="#dom-element-setattributens-namespace-qualifiedname-value-value"></a></dfn>); - void <a class="idl-code" data-link-type="method" href="#dom-element-removeattribute">removeAttribute</a>(DOMString <dfn class="idl-code" data-dfn-for="Element/removeAttribute(qualifiedName)" data-dfn-type="argument" data-export="" id="dom-element-removeattribute-qualifiedname-qualifiedname">qualifiedName<a class="self-link" href="#dom-element-removeattribute-qualifiedname-qualifiedname"></a></dfn>); - void <a class="idl-code" data-link-type="method" href="#dom-element-removeattributens">removeAttributeNS</a>(DOMString? <dfn class="idl-code" data-dfn-for="Element/removeAttributeNS(namespace, localName)" data-dfn-type="argument" data-export="" id="dom-element-removeattributens-namespace-localname-namespace">namespace<a class="self-link" href="#dom-element-removeattributens-namespace-localname-namespace"></a></dfn>, DOMString <dfn class="idl-code" data-dfn-for="Element/removeAttributeNS(namespace, localName)" data-dfn-type="argument" data-export="" id="dom-element-removeattributens-namespace-localname-localname">localName<a class="self-link" href="#dom-element-removeattributens-namespace-localname-localname"></a></dfn>); + [CEReactions] void <a class="idl-code" data-link-type="method" href="#dom-element-setattribute">setAttribute</a>(DOMString <dfn class="idl-code" data-dfn-for="Element/setAttribute(qualifiedName, value)" data-dfn-type="argument" data-export="" id="dom-element-setattribute-qualifiedname-value-qualifiedname">qualifiedName<a class="self-link" href="#dom-element-setattribute-qualifiedname-value-qualifiedname"></a></dfn>, DOMString <dfn class="idl-code" data-dfn-for="Element/setAttribute(qualifiedName, value)" data-dfn-type="argument" data-export="" id="dom-element-setattribute-qualifiedname-value-value">value<a class="self-link" href="#dom-element-setattribute-qualifiedname-value-value"></a></dfn>); + [CEReactions] void <a class="idl-code" data-link-type="method" href="#dom-element-setattributens">setAttributeNS</a>(DOMString? <dfn class="idl-code" data-dfn-for="Element/setAttributeNS(namespace, qualifiedName, value)" data-dfn-type="argument" data-export="" id="dom-element-setattributens-namespace-qualifiedname-value-namespace">namespace<a class="self-link" href="#dom-element-setattributens-namespace-qualifiedname-value-namespace"></a></dfn>, DOMString <dfn class="idl-code" data-dfn-for="Element/setAttributeNS(namespace, qualifiedName, value)" data-dfn-type="argument" data-export="" id="dom-element-setattributens-namespace-qualifiedname-value-qualifiedname">qualifiedName<a class="self-link" href="#dom-element-setattributens-namespace-qualifiedname-value-qualifiedname"></a></dfn>, DOMString <dfn class="idl-code" data-dfn-for="Element/setAttributeNS(namespace, qualifiedName, value)" data-dfn-type="argument" data-export="" id="dom-element-setattributens-namespace-qualifiedname-value-value">value<a class="self-link" href="#dom-element-setattributens-namespace-qualifiedname-value-value"></a></dfn>); + [CEReactions] void <a class="idl-code" data-link-type="method" href="#dom-element-removeattribute">removeAttribute</a>(DOMString <dfn class="idl-code" data-dfn-for="Element/removeAttribute(qualifiedName)" data-dfn-type="argument" data-export="" id="dom-element-removeattribute-qualifiedname-qualifiedname">qualifiedName<a class="self-link" href="#dom-element-removeattribute-qualifiedname-qualifiedname"></a></dfn>); + [CEReactions] void <a class="idl-code" data-link-type="method" href="#dom-element-removeattributens">removeAttributeNS</a>(DOMString? <dfn class="idl-code" data-dfn-for="Element/removeAttributeNS(namespace, localName)" data-dfn-type="argument" data-export="" id="dom-element-removeattributens-namespace-localname-namespace">namespace<a class="self-link" href="#dom-element-removeattributens-namespace-localname-namespace"></a></dfn>, DOMString <dfn class="idl-code" data-dfn-for="Element/removeAttributeNS(namespace, localName)" data-dfn-type="argument" data-export="" id="dom-element-removeattributens-namespace-localname-localname">localName<a class="self-link" href="#dom-element-removeattributens-namespace-localname-localname"></a></dfn>); boolean <a class="idl-code" data-link-type="method" href="#dom-element-hasattribute">hasAttribute</a>(DOMString <dfn class="idl-code" data-dfn-for="Element/hasAttribute(qualifiedName)" data-dfn-type="argument" data-export="" id="dom-element-hasattribute-qualifiedname-qualifiedname">qualifiedName<a class="self-link" href="#dom-element-hasattribute-qualifiedname-qualifiedname"></a></dfn>); boolean <a class="idl-code" data-link-type="method" href="#dom-element-hasattributens">hasAttributeNS</a>(DOMString? <dfn class="idl-code" data-dfn-for="Element/hasAttributeNS(namespace, localName)" data-dfn-type="argument" data-export="" id="dom-element-hasattributens-namespace-localname-namespace">namespace<a class="self-link" href="#dom-element-hasattributens-namespace-localname-namespace"></a></dfn>, DOMString <dfn class="idl-code" data-dfn-for="Element/hasAttributeNS(namespace, localName)" data-dfn-type="argument" data-export="" id="dom-element-hasattributens-namespace-localname-localname">localName<a class="self-link" href="#dom-element-hasattributens-namespace-localname-localname"></a></dfn>); <a data-link-type="idl-name" href="#attr">Attr</a>? <a class="idl-code" data-link-type="method" href="#dom-element-getattributenode">getAttributeNode</a>(DOMString <dfn class="idl-code" data-dfn-for="Element/getAttributeNode(qualifiedName)" data-dfn-type="argument" data-export="" id="dom-element-getattributenode-qualifiedname-qualifiedname">qualifiedName<a class="self-link" href="#dom-element-getattributenode-qualifiedname-qualifiedname"></a></dfn>); <a data-link-type="idl-name" href="#attr">Attr</a>? <a class="idl-code" data-link-type="method" href="#dom-element-getattributenodens">getAttributeNodeNS</a>(DOMString? <dfn class="idl-code" data-dfn-for="Element/getAttributeNodeNS(namespace, localName)" data-dfn-type="argument" data-export="" id="dom-element-getattributenodens-namespace-localname-namespace">namespace<a class="self-link" href="#dom-element-getattributenodens-namespace-localname-namespace"></a></dfn>, DOMString <dfn class="idl-code" data-dfn-for="Element/getAttributeNodeNS(namespace, localName)" data-dfn-type="argument" data-export="" id="dom-element-getattributenodens-namespace-localname-localname">localName<a class="self-link" href="#dom-element-getattributenodens-namespace-localname-localname"></a></dfn>); - <a data-link-type="idl-name" href="#attr">Attr</a>? <a class="idl-code" data-link-type="method" href="#dom-element-setattributenode">setAttributeNode</a>(<a data-link-type="idl-name" href="#attr">Attr</a> <dfn class="idl-code" data-dfn-for="Element/setAttributeNode(attr)" data-dfn-type="argument" data-export="" id="dom-element-setattributenode-attr-attr">attr<a class="self-link" href="#dom-element-setattributenode-attr-attr"></a></dfn>); - <a data-link-type="idl-name" href="#attr">Attr</a>? <a class="idl-code" data-link-type="method" href="#dom-element-setattributenodens">setAttributeNodeNS</a>(<a data-link-type="idl-name" href="#attr">Attr</a> <dfn class="idl-code" data-dfn-for="Element/setAttributeNodeNS(attr)" data-dfn-type="argument" data-export="" id="dom-element-setattributenodens-attr-attr">attr<a class="self-link" href="#dom-element-setattributenodens-attr-attr"></a></dfn>); - <a data-link-type="idl-name" href="#attr">Attr</a> <a class="idl-code" data-link-type="method" href="#dom-element-removeattributenode">removeAttributeNode</a>(<a data-link-type="idl-name" href="#attr">Attr</a> <dfn class="idl-code" data-dfn-for="Element/removeAttributeNode(attr)" data-dfn-type="argument" data-export="" id="dom-element-removeattributenode-attr-attr">attr<a class="self-link" href="#dom-element-removeattributenode-attr-attr"></a></dfn>); + [CEReactions] <a data-link-type="idl-name" href="#attr">Attr</a>? <a class="idl-code" data-link-type="method" href="#dom-element-setattributenode">setAttributeNode</a>(<a data-link-type="idl-name" href="#attr">Attr</a> <dfn class="idl-code" data-dfn-for="Element/setAttributeNode(attr)" data-dfn-type="argument" data-export="" id="dom-element-setattributenode-attr-attr">attr<a class="self-link" href="#dom-element-setattributenode-attr-attr"></a></dfn>); + [CEReactions] <a data-link-type="idl-name" href="#attr">Attr</a>? <a class="idl-code" data-link-type="method" href="#dom-element-setattributenodens">setAttributeNodeNS</a>(<a data-link-type="idl-name" href="#attr">Attr</a> <dfn class="idl-code" data-dfn-for="Element/setAttributeNodeNS(attr)" data-dfn-type="argument" data-export="" id="dom-element-setattributenodens-attr-attr">attr<a class="self-link" href="#dom-element-setattributenodens-attr-attr"></a></dfn>); + [CEReactions] <a data-link-type="idl-name" href="#attr">Attr</a> <a class="idl-code" data-link-type="method" href="#dom-element-removeattributenode">removeAttributeNode</a>(<a data-link-type="idl-name" href="#attr">Attr</a> <dfn class="idl-code" data-dfn-for="Element/removeAttributeNode(attr)" data-dfn-type="argument" data-export="" id="dom-element-removeattributenode-attr-attr">attr<a class="self-link" href="#dom-element-removeattributenode-attr-attr"></a></dfn>); <a data-link-type="idl-name" href="#shadowroot">ShadowRoot</a> <a class="idl-code" data-link-type="method" href="#dom-element-attachshadow">attachShadow</a>(<a data-link-type="idl-name" href="#dictdef-shadowrootinit">ShadowRootInit</a> <dfn class="idl-code" data-dfn-for="Element/attachShadow(init)" data-dfn-type="argument" data-export="" id="dom-element-attachshadow-init-init">init<a class="self-link" href="#dom-element-attachshadow-init-init"></a></dfn>); readonly attribute <a data-link-type="idl-name" href="#shadowroot">ShadowRoot</a>? <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="ShadowRoot? " href="#dom-element-shadowroot">shadowRoot</a>; @@ -2975,8 +3244,8 @@ <h3 class="heading settled" data-level="4.9" id="interface-element"><span class= <a data-link-type="idl-name" href="#htmlcollection">HTMLCollection</a> <a class="idl-code" data-link-type="method" href="#dom-element-getelementsbytagnamens">getElementsByTagNameNS</a>(DOMString? <dfn class="idl-code" data-dfn-for="Element/getElementsByTagNameNS(namespace, localName)" data-dfn-type="argument" data-export="" id="dom-element-getelementsbytagnamens-namespace-localname-namespace">namespace<a class="self-link" href="#dom-element-getelementsbytagnamens-namespace-localname-namespace"></a></dfn>, DOMString <dfn class="idl-code" data-dfn-for="Element/getElementsByTagNameNS(namespace, localName)" data-dfn-type="argument" data-export="" id="dom-element-getelementsbytagnamens-namespace-localname-localname">localName<a class="self-link" href="#dom-element-getelementsbytagnamens-namespace-localname-localname"></a></dfn>); <a data-link-type="idl-name" href="#htmlcollection">HTMLCollection</a> <a class="idl-code" data-link-type="method" href="#dom-element-getelementsbyclassname">getElementsByClassName</a>(DOMString <dfn class="idl-code" data-dfn-for="Element/getElementsByClassName(classNames)" data-dfn-type="argument" data-export="" id="dom-element-getelementsbyclassname-classnames-classnames">classNames<a class="self-link" href="#dom-element-getelementsbyclassname-classnames-classnames"></a></dfn>); - <a data-link-type="idl-name" href="#element">Element</a>? <a class="idl-code" data-link-type="method" href="#dom-element-insertadjacentelement">insertAdjacentElement</a>(DOMString <dfn class="idl-code" data-dfn-for="Element/insertAdjacentElement(where, element)" data-dfn-type="argument" data-export="" id="dom-element-insertadjacentelement-where-element-where">where<a class="self-link" href="#dom-element-insertadjacentelement-where-element-where"></a></dfn>, <a data-link-type="idl-name" href="#element">Element</a> <dfn class="idl-code" data-dfn-for="Element/insertAdjacentElement(where, element)" data-dfn-type="argument" data-export="" id="dom-element-insertadjacentelement-where-element-element">element<a class="self-link" href="#dom-element-insertadjacentelement-where-element-element"></a></dfn>); // historical - void <a class="idl-code" data-link-type="method" href="#dom-element-insertadjacenttext">insertAdjacentText</a>(DOMString <dfn class="idl-code" data-dfn-for="Element/insertAdjacentText(where, data)" data-dfn-type="argument" data-export="" id="dom-element-insertadjacenttext-where-data-where">where<a class="self-link" href="#dom-element-insertadjacenttext-where-data-where"></a></dfn>, DOMString <dfn class="idl-code" data-dfn-for="Element/insertAdjacentText(where, data)" data-dfn-type="argument" data-export="" id="dom-element-insertadjacenttext-where-data-data">data<a class="self-link" href="#dom-element-insertadjacenttext-where-data-data"></a></dfn>); // historical + [CEReactions] <a data-link-type="idl-name" href="#element">Element</a>? <a class="idl-code" data-link-type="method" href="#dom-element-insertadjacentelement">insertAdjacentElement</a>(DOMString <dfn class="idl-code" data-dfn-for="Element/insertAdjacentElement(where, element)" data-dfn-type="argument" data-export="" id="dom-element-insertadjacentelement-where-element-where">where<a class="self-link" href="#dom-element-insertadjacentelement-where-element-where"></a></dfn>, <a data-link-type="idl-name" href="#element">Element</a> <dfn class="idl-code" data-dfn-for="Element/insertAdjacentElement(where, element)" data-dfn-type="argument" data-export="" id="dom-element-insertadjacentelement-where-element-element">element<a class="self-link" href="#dom-element-insertadjacentelement-where-element-element"></a></dfn>); // historical + [CEReactions] void <a class="idl-code" data-link-type="method" href="#dom-element-insertadjacenttext">insertAdjacentText</a>(DOMString <dfn class="idl-code" data-dfn-for="Element/insertAdjacentText(where, data)" data-dfn-type="argument" data-export="" id="dom-element-insertadjacenttext-where-data-where">where<a class="self-link" href="#dom-element-insertadjacenttext-where-data-where"></a></dfn>, DOMString <dfn class="idl-code" data-dfn-for="Element/insertAdjacentText(where, data)" data-dfn-type="argument" data-export="" id="dom-element-insertadjacenttext-where-data-data">data<a class="self-link" href="#dom-element-insertadjacenttext-where-data-data"></a></dfn>); // historical }; dictionary <dfn class="idl-code" data-dfn-type="dictionary" data-export="" id="dictdef-shadowrootinit">ShadowRootInit<a class="self-link" href="#dictdef-shadowrootinit"></a></dfn> { @@ -2988,7 +3257,7 @@ <h3 class="heading settled" data-level="4.9" id="interface-element"><span class= initialized. </p> <p>An <a data-link-type="dfn" href="#concept-element">element</a>’s <a data-link-type="dfn" href="#concept-element-custom-element-state">custom element state</a> is one of "<code>undefined</code>", "<code>uncustomized</code>", or "<code>custom</code>". An <a data-link-type="dfn" href="#concept-element">element</a> whose <a data-link-type="dfn" href="#concept-element-custom-element-state">custom element state</a> is "<code>uncustomized</code>" or "<code>custom</code>" is said to be <dfn data-dfn-for="Element" data-dfn-type="dfn" data-export="" id="concept-element-defined">defined<a class="self-link" href="#concept-element-defined"></a></dfn>. An <a data-link-type="dfn" href="#concept-element">element</a> whose <a data-link-type="dfn" href="#concept-element-custom-element-state">custom element state</a> is "<code>custom</code>", is said to be <dfn data-dfn-for="Element" data-dfn-type="dfn" data-export="" id="concept-element-custom">custom<a class="self-link" href="#concept-element-custom"></a></dfn>. </p> - <p class="note" role="note">Whether or not an element is <a data-link-type="dfn" href="#concept-element-defined">defined</a> is used to determine the behavior of the <a class="css" data-link-type="maybe" href="https://rawgit.com/w3c/webcomponents/15a203c8393aef0df7223ab1d43406aa11a7e71e/spec/custom/index.html#dfn-defined">:defined</a> pseudo-class. Whether or not an element is <a data-link-type="dfn" href="#concept-element-custom">custom</a> is used to determine the + <p class="note" role="note">Whether or not an element is <a data-link-type="dfn" href="#concept-element-defined">defined</a> is used to determine the behavior of the <a class="css" data-link-type="maybe" href="https://html.spec.whatwg.org/multipage/scripting.html#selector-defined">:defined</a> pseudo-class. Whether or not an element is <a data-link-type="dfn" href="#concept-element-custom">custom</a> is used to determine the behavior of the <a href="#mutation-algorithms">mutation algorithms</a>.</p> <div class="example" id="example-f7401fd0"> <a class="self-link" href="#example-f7401fd0"></a> @@ -3019,19 +3288,23 @@ <h3 class="heading settled" data-level="4.9" id="interface-element"><span class= <span class="nt"><sw-rey></sw-rey></span> <span class="nt"><p</span> <span class="na">is=</span><span class="s">"sw-finn"</span><span class="nt">></p></span></code></pre> </div> - <p><a data-link-type="dfn" href="#concept-element">Elements</a> also have an associated <dfn data-dfn-for="Element" data-dfn-type="dfn" data-export="" id="concept-element-shadow-root">shadow root<a class="self-link" href="#concept-element-shadow-root"></a></dfn> (null or a <a data-link-type="dfn" href="#concept-shadow-root">shadow root</a>). It is null unless otherwise stated. </p> - <p>An <a data-link-type="dfn" href="#concept-element">element</a>’s <dfn data-dfn-for="Element" data-dfn-type="dfn" data-noexport="" id="concept-element-qualified-name">qualified name<a class="self-link" href="#concept-element-qualified-name"></a></dfn> is its <a data-link-type="dfn" href="#concept-element-local-name">local name</a> if its <a data-link-type="dfn" href="#concept-element-namespace-prefix">namespace prefix</a> is null, and its <a data-link-type="dfn" href="#concept-element-namespace-prefix">namespace prefix</a>, followed by "<code>:</code>", followed by its <a data-link-type="dfn" href="#concept-element-local-name">local name</a>, otherwise. </p> + <p><a data-link-type="dfn" href="#concept-element">Elements</a> also have an associated <dfn data-dfn-for="Element" data-dfn-type="dfn" data-export="" id="concept-element-shadow-root">shadow root<a class="self-link" href="#concept-element-shadow-root"></a></dfn> (null or a <a data-link-type="dfn" href="#concept-shadow-root">shadow root</a>). It is null unless otherwise stated. An <a data-link-type="dfn" href="#concept-element">element</a> is a <dfn data-dfn-for="Element" data-dfn-type="dfn" data-export="" id="element-shadow-host">shadow host<a class="self-link" href="#element-shadow-host"></a></dfn> if its <a data-link-type="dfn" href="#concept-element-shadow-root">shadow root</a> is non-null. </p> + <p>An <a data-link-type="dfn" href="#concept-element">element</a>’s <dfn data-dfn-for="Element" data-dfn-type="dfn" data-export="" id="concept-element-qualified-name">qualified name<a class="self-link" href="#concept-element-qualified-name"></a></dfn> is its <a data-link-type="dfn" href="#concept-element-local-name">local name</a> if its <a data-link-type="dfn" href="#concept-element-namespace-prefix">namespace prefix</a> is null, and its <a data-link-type="dfn" href="#concept-element-namespace-prefix">namespace prefix</a>, followed by "<code>:</code>", followed by its <a data-link-type="dfn" href="#concept-element-local-name">local name</a>, otherwise. </p> <p class="note" role="note">User agents could have this as an internal slot as an optimization, but are not required to do so. The standard has this concept for readability. </p> <p>To <dfn data-dfn-type="dfn" data-export="" data-lt="create an element|creating an element" id="concept-create-element">create an element<a class="self-link" href="#concept-create-element"></a></dfn>, -given a <var>document</var>, <var>localName</var>, <var>prefix</var>, <var>namespace</var>, <var>is</var>, and optional <var>synchronous custom elements flag</var>, run these steps: </p> +given a <var>document</var>, <var>localName</var>, <var>namespace</var>, and optional <var>prefix</var>, <var>is</var>, and <var>synchronous custom elements flag</var>, run these steps: </p> <ol> + <li> + <p>If <var>prefix</var> was not given, let <var>prefix</var> be null. </p> + <li> + <p>If <var>is</var> was not given, let <var>is</var> be null. </p> <li> <p>Let <var>result</var> be null. </p> <li> - <p>Let <var>definition</var> be the result of <a data-link-type="dfn" href="https://rawgit.com/w3c/webcomponents/15a203c8393aef0df7223ab1d43406aa11a7e71e/spec/custom/index.html#dfn-look-up-custom-element-definition">looking up a custom element definition</a> given <var>document</var>, <var>namespace</var>, <var>localName</var>, and <var>is</var>. </p> + <p>Let <var>definition</var> be the result of <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/scripting.html#look-up-a-custom-element-definition">looking up a custom element definition</a> given <var>document</var>, <var>namespace</var>, <var>localName</var>, and <var>is</var>. </p> <li> - <p>If <var>definition</var> is non-null, and <var>definition</var>’s <a data-link-type="dfn" href="https://rawgit.com/w3c/webcomponents/15a203c8393aef0df7223ab1d43406aa11a7e71e/spec/custom/index.html#dfn-element-definition-name">name</a> is not equal to its <a data-link-type="dfn" href="https://rawgit.com/w3c/webcomponents/15a203c8393aef0df7223ab1d43406aa11a7e71e/spec/custom/index.html#dfn-element-definition-local-name">local name</a> (i.e., <var>definition</var> represents a <a data-link-type="dfn" href="https://rawgit.com/w3c/webcomponents/15a203c8393aef0df7223ab1d43406aa11a7e71e/spec/custom/index.html#dfn-type-extension">type extension</a>), then: </p> + <p>If <var>definition</var> is non-null, and <var>definition</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/scripting.html#concept-custom-element-definition-name">name</a> is not equal to its <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/scripting.html#concept-custom-element-definition-local-name">local name</a> (i.e., <var>definition</var> represents a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/scripting.html#customized-built-in-element">customized built-in element</a>), then: </p> <ol> <li> <p>Let <var>interface</var> be the <a data-link-type="dfn" href="#concept-element-interface">element interface</a> for <var>localName</var> and the <a data-link-type="dfn" href="#html-namespace">HTML namespace</a>. </p> @@ -3040,9 +3313,9 @@ <h3 class="heading settled" data-level="4.9" id="interface-element"><span class= with no attributes, <a data-link-type="dfn" href="#concept-element-namespace">namespace</a> set to the <a data-link-type="dfn" href="#html-namespace">HTML namespace</a>, <a data-link-type="dfn" href="#concept-element-namespace-prefix">namespace prefix</a> set to <var>prefix</var>, <a data-link-type="dfn" href="#concept-element-local-name">local name</a> set to <var>localName</var>, <a data-link-type="dfn" href="#concept-element-custom-element-state">custom element state</a> set to "<code>undefined</code>", and <a data-link-type="dfn" href="#concept-node-document">node document</a> set to <var>document</var>. </p> <li> - <p>If the <var>synchronous custom elements flag</var> is set, <a data-link-type="dfn" href="https://rawgit.com/w3c/webcomponents/15a203c8393aef0df7223ab1d43406aa11a7e71e/spec/custom/index.html#dfn-upgrade-a-custom-element">upgrade</a> <var>element</var> using <var>definition</var>. </p> + <p>If the <var>synchronous custom elements flag</var> is set, <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/scripting.html#concept-upgrade-an-element">upgrade</a> <var>element</var> using <var>definition</var>. </p> <li> - <p>Otherwise, <a data-link-type="dfn" href="https://rawgit.com/w3c/webcomponents/15a203c8393aef0df7223ab1d43406aa11a7e71e/spec/custom/index.html#dfn-enqueue-upgrade">enqueue a custom element upgrade reaction</a> given <var>result</var> and <var>definition</var>. </p> + <p>Otherwise, <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/scripting.html#enqueue-a-custom-element-upgrade-reaction">enqueue a custom element upgrade reaction</a> given <var>result</var> and <var>definition</var>. </p> </ol> <li> <p>Otherwise, if <var>definition</var> is non-null, then: </p> @@ -3051,26 +3324,27 @@ <h3 class="heading settled" data-level="4.9" id="interface-element"><span class= <p>If the <var>synchronous custom elements flag</var> is set: </p> <ol> <li> - <p>Let <var>C</var> be <var>definition</var>’s <a data-link-type="dfn" href="https://rawgit.com/w3c/webcomponents/15a203c8393aef0df7223ab1d43406aa11a7e71e/spec/custom/index.html#dfn-element-definition-constructor">constructor</a>. </p> + <p>Let <var>C</var> be <var>definition</var>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/scripting.html#concept-custom-element-definition-constructor">constructor</a>. </p> <li> <p>Set <var>result</var> to <a data-link-type="abstract-op" href="https://tc39.github.io/ecma262/#sec-construct">Construct</a>(<var>C</var>). Rethrow any exceptions. </p> <li> - <p>If <var>result</var> does not implement the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/dom.html#htmlelement">HTMLElement</a></code> interface, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror">TypeError</a></code> exception. </p> + <p>If <var>result</var> does not implement the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/dom.html#htmlelement">HTMLElement</a></code> interface, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code>TypeError</code>. </p> <p class="note" role="note">This is meant to be a brand check to ensure that the object was allocated by the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/dom.html#htmlelement">HTMLElement</a></code> constructor. See <a href="https://github.com/heycam/webidl/issues/97">webidl #97</a> about making this more precise. </p> <li> - <p>If <var>result</var>’s <a data-link-type="dfn" href="#concept-element-attribute">attribute list</a> is not empty, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code> exception. </p> + <p>If <var>result</var>’s <a data-link-type="dfn" href="#concept-element-attribute">attribute list</a> is not empty, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code>. </p> <li> - <p>If <var>result</var> has <a data-link-type="dfn" href="#concept-tree-child">children</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code> exception. </p> + <p>If <var>result</var> has <a data-link-type="dfn" href="#concept-tree-child">children</a>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code>. </p> <li> - <p>If <var>result</var>’s <a data-link-type="dfn" href="#concept-tree-parent">parent</a> is not null, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code> exception. </p> + <p>If <var>result</var>’s <a data-link-type="dfn" href="#concept-tree-parent">parent</a> is not null, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code>. </p> <li> - <p>If <var>result</var>’s <a data-link-type="dfn" href="#concept-node-document">node document</a> is not <var>document</var>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code> exception. </p> + <p>If <var>result</var>’s <a data-link-type="dfn" href="#concept-node-document">node document</a> is not <var>document</var>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code>. </p> <li> - <p>If <var>result</var>’s <a data-link-type="dfn" href="#concept-element-namespace">namespace</a> is not the <a data-link-type="dfn" href="#html-namespace">HTML namespace</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code> exception. </p> + <p>If <var>result</var>’s <a data-link-type="dfn" href="#concept-element-namespace">namespace</a> is not the <a data-link-type="dfn" href="#html-namespace">HTML namespace</a>, + then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code>. </p> <li> - <p>If <var>result</var>’s <a data-link-type="dfn" href="#concept-element-local-name">local name</a> is not equal to <var>localName</var>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code> exception. </p> + <p>If <var>result</var>’s <a data-link-type="dfn" href="#concept-element-local-name">local name</a> is not equal to <var>localName</var>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code>. </p> <li> <p>Set <var>result</var>’s <a data-link-type="dfn" href="#concept-element-namespace-prefix">namespace prefix</a> to <var>prefix</var>. </p> <li> @@ -3083,7 +3357,7 @@ <h3 class="heading settled" data-level="4.9" id="interface-element"><span class= <p>Set <var>result</var> to a new <a data-link-type="dfn" href="#concept-element">element</a> that implements the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/dom.html#htmlelement">HTMLElement</a></code> interface, with no attributes, <a data-link-type="dfn" href="#concept-element-namespace">namespace</a> set to the <a data-link-type="dfn" href="#html-namespace">HTML namespace</a>, <a data-link-type="dfn" href="#concept-element-namespace-prefix">namespace prefix</a> set to <var>prefix</var>, <a data-link-type="dfn" href="#concept-element-local-name">local name</a> set to <var>localName</var>, <a data-link-type="dfn" href="#concept-element-custom-element-state">custom element state</a> set to "<code>undefined</code>", and <a data-link-type="dfn" href="#concept-node-document">node document</a> set to <var>document</var>. </p> <li> - <p><a data-link-type="dfn" href="https://rawgit.com/w3c/webcomponents/15a203c8393aef0df7223ab1d43406aa11a7e71e/spec/custom/index.html#dfn-enqueue-upgrade">Enqueue a custom element upgrade reaction</a> given <var>result</var> and <var>definition</var>. </p> + <p><a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/scripting.html#enqueue-a-custom-element-upgrade-reaction">Enqueue a custom element upgrade reaction</a> given <var>result</var> and <var>definition</var>. </p> </ol> </ol> <li> @@ -3096,22 +3370,22 @@ <h3 class="heading settled" data-level="4.9" id="interface-element"><span class= with no attributes, <a data-link-type="dfn" href="#concept-element-namespace">namespace</a> set to <var>namespace</var>, <a data-link-type="dfn" href="#concept-element-namespace-prefix">namespace prefix</a> set to <var>prefix</var>, <a data-link-type="dfn" href="#concept-element-local-name">local name</a> set to <var>localName</var>, <a data-link-type="dfn" href="#concept-element-custom-element-state">custom element state</a> set to "<code>uncustomized</code>", and <a data-link-type="dfn" href="#concept-node-document">node document</a> set to <var>document</var>. </p> <li> - <p>If <var>document</var> has a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#concept-document-bc">browsing context</a>, and <var>namespace</var> is the <a data-link-type="dfn" href="#html-namespace">HTML namespace</a>, and either <var>localName</var> is a <a data-link-type="dfn" href="https://rawgit.com/w3c/webcomponents/15a203c8393aef0df7223ab1d43406aa11a7e71e/spec/custom/index.html#dfn-valid-custom-element-name">valid custom element name</a> or <var>is</var> is is non-null, set <var>result</var>’s <a data-link-type="dfn" href="#concept-element-custom-element-state">custom element state</a> to "<code>undefined</code>". </p> + <p>If <var>document</var> has a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#concept-document-bc">browsing context</a>, and <var>namespace</var> is the <a data-link-type="dfn" href="#html-namespace">HTML namespace</a>, and either <var>localName</var> is a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/scripting.html#valid-custom-element-name">valid custom element name</a> or <var>is</var> is is non-null, set <var>result</var>’s <a data-link-type="dfn" href="#concept-element-custom-element-state">custom element state</a> to "<code>undefined</code>". </p> </ol> <li> <p>Return <var>result</var>. </p> </ol> <p><a data-link-type="dfn" href="#concept-element">Elements</a> also have an ordered <dfn data-dfn-for="Element" data-dfn-type="dfn" data-export="" id="concept-element-attribute">attribute list<a class="self-link" href="#concept-element-attribute"></a></dfn> exposed through a <code class="idl"><a data-link-type="idl" href="#namednodemap">NamedNodeMap</a></code>. Unless explicitly given when an <a data-link-type="dfn" href="#concept-element">element</a> is created, its <a data-link-type="dfn" href="#concept-element-attribute">attribute list</a> is empty. An <a data-link-type="dfn" href="#concept-element">element</a> <dfn data-dfn-type="dfn" data-export="" data-lt="has an attribute" id="concept-element-attribute-has">has<a class="self-link" href="#concept-element-attribute-has"></a></dfn> an <a data-link-type="dfn" href="#concept-attribute">attribute</a> <var>A</var> if <var>A</var> is in its <a data-link-type="dfn" href="#concept-element-attribute">attribute list</a>.</p> - <p>This specification uses and <a data-link-type="dfn" href="#other-applicable-specifications">applicable specifications</a> can use the hooks an <dfn data-dfn-type="dfn" data-export="" id="attribute-is-set">attribute is set<a class="self-link" href="#attribute-is-set"></a></dfn>, an <dfn data-dfn-type="dfn" data-export="" id="attribute-is-changed">attribute is changed<a class="self-link" href="#attribute-is-changed"></a></dfn>, an <dfn data-dfn-type="dfn" data-export="" id="attribute-is-added">attribute is added<a class="self-link" href="#attribute-is-added"></a></dfn>, and an <dfn data-dfn-type="dfn" data-export="" id="attribute-is-removed">attribute is removed<a class="self-link" href="#attribute-is-removed"></a></dfn>, for -further processing of the <a data-link-type="dfn" href="#concept-attribute">attribute</a>’s <a data-link-type="dfn" href="#concept-attribute-value">value</a>.</p> + <p>This and <a data-link-type="dfn" href="#other-applicable-specifications">other specifications</a> may define <dfn data-dfn-type="dfn" data-noexport="" id="concept-element-attributes-change-ext">attribute change steps<a class="self-link" href="#concept-element-attributes-change-ext"></a></dfn> for <a data-link-type="dfn" href="#concept-element">elements</a>. The algorithm is passed <var>element</var>, <var>localName</var>, <var>oldValue</var>, <var>value</var>, and <var>namespace</var>.</p> <p>To <dfn data-dfn-type="dfn" data-export="" data-lt="change an attribute" id="concept-element-attributes-change">change<a class="self-link" href="#concept-element-attributes-change"></a></dfn> an <a data-link-type="dfn" href="#concept-attribute">attribute</a> <var>attribute</var> from an <a data-link-type="dfn" href="#concept-element">element</a> <var>element</var> to <var>value</var>, run these steps:</p> <ol> <li><a data-link-type="dfn" href="#queue-a-mutation-record">Queue a mutation record</a> of "<code>attributes</code>" for <var>element</var> with name <var>attribute</var>’s <a data-link-type="dfn" href="#concept-attribute-local-name">local name</a>, namespace <var>attribute</var>’s <a data-link-type="dfn" href="#concept-attribute-namespace">namespace</a>, and oldValue <var>attribute</var>’s <a data-link-type="dfn" href="#concept-attribute-value">value</a>. - <li>If <var>element</var> is <a data-link-type="dfn" href="#concept-element-custom">custom</a>, then <a data-link-type="dfn" href="https://rawgit.com/w3c/webcomponents/15a203c8393aef0df7223ab1d43406aa11a7e71e/spec/custom/index.html#dfn-enqueue-lifecycle-callback">enqueue a custom element callback reaction</a> with <var>element</var>, callback name "<code>attributeChangedCallback</code>", and an argument + <li>If <var>element</var> is <a data-link-type="dfn" href="#concept-element-custom">custom</a>, then <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/scripting.html#enqueue-a-custom-element-callback-reaction">enqueue a custom element callback reaction</a> with <var>element</var>, callback name "<code>attributeChangedCallback</code>", and an argument list containing <var>attribute</var>’s <a data-link-type="dfn" href="#concept-attribute-local-name">local name</a>, <var>attribute</var>’s <a data-link-type="dfn" href="#concept-attribute-value">value</a>, <var>value</var>, and <var>attribute</var>’s <a data-link-type="dfn" href="#concept-attribute-namespace">namespace</a>. + <li> + <p>Run the <a data-link-type="dfn" href="#concept-element-attributes-change-ext">attribute change steps</a> with <var>element</var>, <var>attribute</var>’s <a data-link-type="dfn" href="#concept-attribute-local-name">local name</a>, <var>attribute</var>’s <a data-link-type="dfn" href="#concept-attribute-value">value</a>, <var>value</var>, and <var>attribute</var>’s <a data-link-type="dfn" href="#concept-attribute-namespace">namespace</a>. </p> <li>Set <var>attribute</var>’s <a data-link-type="dfn" href="#concept-attribute-value">value</a> to <var>value</var>. - <li>An <a data-link-type="dfn" href="#attribute-is-set">attribute is set</a> and an <a data-link-type="dfn" href="#attribute-is-changed">attribute is changed</a>. </ol> <p>To <dfn data-dfn-type="dfn" data-export="" data-lt="append an attribute" id="concept-element-attributes-append">append<a class="self-link" href="#concept-element-attributes-append"></a></dfn> an <a data-link-type="dfn" href="#concept-attribute">attribute</a> <var>attribute</var> to an <a data-link-type="dfn" href="#concept-element">element</a> <var>element</var>, @@ -3120,22 +3394,24 @@ <h3 class="heading settled" data-level="4.9" id="interface-element"><span class= <li><a data-link-type="dfn" href="#queue-a-mutation-record">Queue a mutation record</a> of "<code>attributes</code>" for <var>element</var> with name <var>attribute</var>’s <a data-link-type="dfn" href="#concept-attribute-local-name">local name</a>, namespace <var>attribute</var>’s <a data-link-type="dfn" href="#concept-attribute-namespace">namespace</a>, and oldValue null. - <li>If <var>element</var> is <a data-link-type="dfn" href="#concept-element-custom">custom</a>, then <a data-link-type="dfn" href="https://rawgit.com/w3c/webcomponents/15a203c8393aef0df7223ab1d43406aa11a7e71e/spec/custom/index.html#dfn-enqueue-lifecycle-callback">enqueue a custom element callback reaction</a> with <var>element</var>, callback name "<code>attributeChangedCallback</code>", and an argument + <li>If <var>element</var> is <a data-link-type="dfn" href="#concept-element-custom">custom</a>, then <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/scripting.html#enqueue-a-custom-element-callback-reaction">enqueue a custom element callback reaction</a> with <var>element</var>, callback name "<code>attributeChangedCallback</code>", and an argument list containing <var>attribute</var>’s <a data-link-type="dfn" href="#concept-attribute-local-name">local name</a>, null, <var>attribute</var>’s <a data-link-type="dfn" href="#concept-attribute-value">value</a>, and <var>attribute</var>’s <a data-link-type="dfn" href="#concept-attribute-namespace">namespace</a>. + <li> + <p>Run the <a data-link-type="dfn" href="#concept-element-attributes-change-ext">attribute change steps</a> with <var>element</var>, <var>attribute</var>’s <a data-link-type="dfn" href="#concept-attribute-local-name">local name</a>, null, <var>attribute</var>’s <a data-link-type="dfn" href="#concept-attribute-value">value</a>, and <var>attribute</var>’s <a data-link-type="dfn" href="#concept-attribute-namespace">namespace</a>. </p> <li>Append the <var>attribute</var> to the <var>element</var>’s <a data-link-type="dfn" href="#concept-element-attribute">attribute list</a>. <li>Set <var>attribute</var>’s <a data-link-type="dfn" href="#concept-attribute-element">element</a> to <var>element</var>. - <li>An <a data-link-type="dfn" href="#attribute-is-set">attribute is set</a> and an <a data-link-type="dfn" href="#attribute-is-added">attribute is added</a>. </ol> <p>To <dfn data-dfn-type="dfn" data-export="" data-lt="remove an attribute" id="concept-element-attributes-remove">remove<a class="self-link" href="#concept-element-attributes-remove"></a></dfn> an <a data-link-type="dfn" href="#concept-attribute">attribute</a> <var>attribute</var> from an <a data-link-type="dfn" href="#concept-element">element</a> <var>element</var>, run these steps:</p> <ol> <li><a data-link-type="dfn" href="#queue-a-mutation-record">Queue a mutation record</a> of "<code>attributes</code>" for <var>element</var> with name <var>attribute</var>’s <a data-link-type="dfn" href="#concept-attribute-local-name">local name</a>, namespace <var>attribute</var>’s <a data-link-type="dfn" href="#concept-attribute-namespace">namespace</a>, and oldValue <var>attribute</var>’s <a data-link-type="dfn" href="#concept-attribute-value">value</a>. - <li>If <var>element</var> is <a data-link-type="dfn" href="#concept-element-custom">custom</a>, then <a data-link-type="dfn" href="https://rawgit.com/w3c/webcomponents/15a203c8393aef0df7223ab1d43406aa11a7e71e/spec/custom/index.html#dfn-enqueue-lifecycle-callback">enqueue a custom element callback reaction</a> with <var>element</var>, callback name "<code>attributeChangedCallback</code>", and an argument + <li>If <var>element</var> is <a data-link-type="dfn" href="#concept-element-custom">custom</a>, then <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/scripting.html#enqueue-a-custom-element-callback-reaction">enqueue a custom element callback reaction</a> with <var>element</var>, callback name "<code>attributeChangedCallback</code>", and an argument list containing <var>attribute</var>’s <a data-link-type="dfn" href="#concept-attribute-local-name">local name</a>, <var>attribute</var>’s <a data-link-type="dfn" href="#concept-attribute-value">value</a>, null, and <var>attribute</var>’s <a data-link-type="dfn" href="#concept-attribute-namespace">namespace</a>. + <li> + <p>Run the <a data-link-type="dfn" href="#concept-element-attributes-change-ext">attribute change steps</a> with <var>element</var>, <var>attribute</var>’s <a data-link-type="dfn" href="#concept-attribute-local-name">local name</a>, <var>attribute</var>’s <a data-link-type="dfn" href="#concept-attribute-value">value</a>, null, and <var>attribute</var>’s <a data-link-type="dfn" href="#concept-attribute-namespace">namespace</a>. </p> <li>Remove <var>attribute</var> from the <var>element</var>’s <a data-link-type="dfn" href="#concept-element-attribute">attribute list</a>. <li>Set <var>attribute</var>’s <a data-link-type="dfn" href="#concept-attribute-element">element</a> to null. - <li>An <a data-link-type="dfn" href="#attribute-is-removed">attribute is removed</a>. </ol> <p>To <dfn data-dfn-type="dfn" data-export="" data-lt="replace an attribute" id="concept-element-attributes-replace">replace<a class="self-link" href="#concept-element-attributes-replace"></a></dfn> an <a data-link-type="dfn" href="#concept-attribute">attribute</a> <var>oldAttr</var> by an <a data-link-type="dfn" href="#concept-attribute">attribute</a> <var>newAttr</var> in an <a data-link-type="dfn" href="#concept-element">element</a> <var>element</var>, run these steps:</p> <ol> @@ -3143,16 +3419,16 @@ <h3 class="heading settled" data-level="4.9" id="interface-element"><span class= <p><a data-link-type="dfn" href="#queue-a-mutation-record">Queue a mutation record</a> of "<code>attributes</code>" for <var>element</var> with name <var>oldAttr</var>’s <a data-link-type="dfn" href="#concept-attribute-local-name">local name</a>, namespace <var>oldAttr</var>’s <a data-link-type="dfn" href="#concept-attribute-namespace">namespace</a>, and oldValue <var>oldAttr</var>’s <a data-link-type="dfn" href="#concept-attribute-value">value</a>. </p> - <li>If <var>element</var> is <a data-link-type="dfn" href="#concept-element-custom">custom</a>, then <a data-link-type="dfn" href="https://rawgit.com/w3c/webcomponents/15a203c8393aef0df7223ab1d43406aa11a7e71e/spec/custom/index.html#dfn-enqueue-lifecycle-callback">enqueue a custom element callback reaction</a> with <var>element</var>, callback name "<code>attributeChangedCallback</code>", and an argument + <li>If <var>element</var> is <a data-link-type="dfn" href="#concept-element-custom">custom</a>, then <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/scripting.html#enqueue-a-custom-element-callback-reaction">enqueue a custom element callback reaction</a> with <var>element</var>, callback name "<code>attributeChangedCallback</code>", and an argument list containing <var>oldAttr</var>’s <a data-link-type="dfn" href="#concept-attribute-local-name">local name</a>, <var>oldAttr</var>’s <a data-link-type="dfn" href="#concept-attribute-value">value</a>, <var>newAttr</var>’s <a data-link-type="dfn" href="#concept-attribute-value">value</a>, and <var>oldAttr</var>’s <a data-link-type="dfn" href="#concept-attribute-namespace">namespace</a>. + <li> + <p>Run the <a data-link-type="dfn" href="#concept-element-attributes-change-ext">attribute change steps</a> with <var>element</var>, <var>oldAttr</var>’s <a data-link-type="dfn" href="#concept-attribute-local-name">local name</a>, <var>oldAttr</var>’s <a data-link-type="dfn" href="#concept-attribute-value">value</a>, <var>newAttr</var>’s <a data-link-type="dfn" href="#concept-attribute-value">value</a>, and <var>oldAttr</var>’s <a data-link-type="dfn" href="#concept-attribute-namespace">namespace</a>. </p> <li> <p>Replace <var>oldAttr</var> by <var>newAttr</var> in the <var>element</var>’s <a data-link-type="dfn" href="#concept-element-attribute">attribute list</a>. </p> <li> <p>Set <var>oldAttr</var>’s <a data-link-type="dfn" href="#concept-attribute-element">element</a> to null. </p> <li> <p>Set <var>newAttr</var>’s <a data-link-type="dfn" href="#concept-attribute-element">element</a> to <var>element</var>. </p> - <li> - <p>An <a data-link-type="dfn" href="#attribute-is-set">attribute is set</a> and an <a data-link-type="dfn" href="#attribute-is-changed">attribute is changed</a>. </p> </ol> <hr> <p>To <dfn data-dfn-type="dfn" data-export="" id="concept-element-attributes-get-by-name">get an attribute by name<a class="self-link" href="#concept-element-attributes-get-by-name"></a></dfn> given a <var>qualifiedName</var> and <a data-link-type="dfn" href="#concept-element">element</a> <var>element</var>, run these steps:</p> @@ -3223,10 +3499,14 @@ <h3 class="heading settled" data-level="4.9" id="interface-element"><span class= <p class="note" role="note">Historically <a data-link-type="dfn" href="#concept-element">elements</a> could have multiple identifiers e.g., by using the HTML <code>id</code> <a data-link-type="dfn" href="#concept-attribute">attribute</a> and a DTD. This specification makes <a data-link-type="dfn" href="#concept-id">ID</a> a concept of the DOM and allows for only one per <a data-link-type="dfn" href="#concept-element">element</a>, given by an <a data-link-type="dfn" href="#concept-named-attribute"><code>id</code> attribute</a>. </p> - <p>When an <a data-link-type="dfn" href="#concept-element">element</a> is created that <a data-link-type="dfn" href="#concept-element-attribute-has">has</a> an <a data-link-type="dfn" href="#concept-named-attribute"><code>id</code> attribute</a> whose <a data-link-type="dfn" href="#concept-attribute-value">value</a> is not the empty string or -when an <a data-link-type="dfn" href="#concept-element">element</a>’s <a data-link-type="dfn" href="#concept-named-attribute"><code>id</code> attribute</a> is <a data-link-type="dfn" href="#attribute-is-set">set</a> to a <a data-link-type="dfn" href="#concept-attribute-value">value</a> other than the empty -string, set the <a data-link-type="dfn" href="#concept-element">element</a>’s <a data-link-type="dfn" href="#concept-id">ID</a> to the new <a data-link-type="dfn" href="#concept-attribute-value">value</a>.</p> - <p>When an <a data-link-type="dfn" href="#concept-element">element</a>’s <a data-link-type="dfn" href="#concept-named-attribute"><code>id</code> attribute</a> is <a data-link-type="dfn" href="#attribute-is-removed">removed</a> or <a data-link-type="dfn" href="#attribute-is-set">set</a> to the empty string, unset the <a data-link-type="dfn" href="#concept-element">element</a>’s <a data-link-type="dfn" href="#concept-id">ID</a>.</p> + <p>Use these <a data-link-type="dfn" href="#concept-element-attributes-change-ext">attribute change steps</a> to update an <a data-link-type="dfn" href="#concept-element">element</a>’s <a data-link-type="dfn" href="#concept-id">ID</a>: </p> + <ol> + <li> + <p>If <var>localName</var> is <code>id</code>, <var>namespace</var> is null, and <var>value</var> is null or the empty string, then unset <var>element</var>’s <a data-link-type="dfn" href="#concept-id">ID</a>. </p> + <li> + <p>Otherwise, if <var>localName</var> is <code>id</code>, <var>namespace</var> is null, then + set <var>element</var>’s <a data-link-type="dfn" href="#concept-id">ID</a> to <var>value</var>. </p> + </ol> <p class="note no-backref" role="note">While this specification defines requirements for <code>class</code>, <code>id</code>, and <code>slot</code> <a data-link-type="dfn" href="#concept-attribute">attributes</a> on any <a data-link-type="dfn" href="#concept-element">element</a>, it makes no claims as to whether using them is conforming or not. </p> <hr> @@ -3312,7 +3592,7 @@ <h3 class="heading settled" data-level="4.9" id="interface-element"><span class= <ol> <li> <p>If <var>qualifiedName</var> does not match the <code><a class="css" data-link-type="type" href="https://www.w3.org/TR/xml/#NT-Name">Name</a></code> production in - XML, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code> exception. </p> + XML, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code>. </p> <li> <p>If the <a data-link-type="dfn" href="#context-object">context object</a> is in the <a data-link-type="dfn" href="#html-namespace">HTML namespace</a> and its <a data-link-type="dfn" href="#concept-node-document">node document</a> is an <a data-link-type="dfn" href="#html-document">HTML document</a>, let <var>qualifiedName</var> be <a data-link-type="dfn" href="#converted-to-ascii-lowercase">converted to ASCII lowercase</a>. </p> @@ -3357,9 +3637,12 @@ <h3 class="heading settled" data-level="4.9" id="interface-element"><span class= invoked, must return the result of <a data-link-type="dfn" href="#concept-element-attributes-set">setting an attribute</a> given <var>attr</var> and the <a data-link-type="dfn" href="#context-object">context object</a>. Rethrow any exceptions.</p> <p>The <dfn class="idl-code" data-dfn-for="Element" data-dfn-type="method" data-export="" id="dom-element-removeattributenode"><code>removeAttributeNode(<var>attr</var>)</code><a class="self-link" href="#dom-element-removeattributenode"></a></dfn> method, when invoked, must run these steps:</p> <ol> - <li>If <var>attr</var> is not in <a data-link-type="dfn" href="#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-element-attribute">attribute list</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notfounderror">NotFoundError</a></code> exception. - <li><a data-link-type="dfn" href="#concept-element-attributes-remove">Remove</a> <var>attr</var> from <a data-link-type="dfn" href="#context-object">context object</a>. - <li>Return <var>attr</var>. + <li> + <p>If <var>attr</var> is not in <a data-link-type="dfn" href="#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-element-attribute">attribute list</a>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notfounderror">NotFoundError</a></code>. </p> + <li> + <p><a data-link-type="dfn" href="#concept-element-attributes-remove">Remove</a> <var>attr</var> from <a data-link-type="dfn" href="#context-object">context object</a>. </p> + <li> + <p>Return <var>attr</var>. </p> </ol> <hr> <dl class="domintro"> @@ -3374,7 +3657,9 @@ <h3 class="heading settled" data-level="4.9" id="interface-element"><span class= invoked, must run these steps: </p> <ol> <li> - <p>If <a data-link-type="dfn" href="#context-object">context object</a> is not a <span class="XXX">custom element</span>, and is not an <a data-link-type="dfn" href="#concept-element">element</a> whose <a data-link-type="dfn" href="#concept-element-namespace">namespace</a> is the <a data-link-type="dfn" href="#html-namespace">HTML namespace</a> and <a data-link-type="dfn" href="#concept-element-local-name">local name</a> is + <p>If <a data-link-type="dfn" href="#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-element-namespace">namespace</a> is <em>not</em> the <a data-link-type="dfn" href="#html-namespace">HTML namespace</a>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code>. </p> + <li> + <p>If <a data-link-type="dfn" href="#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-element-local-name">local name</a> is <em>not</em> a <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/scripting.html#valid-custom-element-name">valid custom element name</a>, "<code>article</code>", "<code>aside</code>", "<code>blockquote</code>", @@ -3391,9 +3676,9 @@ <h3 class="heading settled" data-level="4.9" id="interface-element"><span class= "<code>nav</code>", "<code>p</code>", "<code>section</code>", or - "<code>span</code>", then throw a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code> exception. </p> + "<code>span</code>", then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code>. </p> <li> - <p>If <a data-link-type="dfn" href="#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-element-shadow-root">shadow root</a> is non-null, then throw an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror">InvalidStateError</a></code> exception. </p> + <p>If <a data-link-type="dfn" href="#context-object">context object</a> is a <a data-link-type="dfn" href="#element-shadow-host">shadow host</a>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror">InvalidStateError</a></code>. </p> <li> <p>Let <var>shadow</var> be a new <a data-link-type="dfn" href="#concept-shadow-root">shadow root</a> whose <a data-link-type="dfn" href="#concept-node-document">node document</a> is <a data-link-type="dfn" href="#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-node-document">node document</a>, <a data-link-type="dfn" href="#concept-documentfragment-host">host</a> is <a data-link-type="dfn" href="#context-object">context object</a>, and <a data-link-type="dfn" href="#shadowroot-mode">mode</a> is <var>init</var>’s <code class="idl"><a data-link-type="idl" href="#dom-shadowrootinit-mode">mode</a></code>. </p> <li> @@ -3459,13 +3744,13 @@ <h3 class="heading settled" data-level="4.9" id="interface-element"><span class= <p>Return the result of <a data-link-type="dfn" href="#concept-node-pre-insert">pre-inserting</a> <var>node</var> into <var>element</var>’s <a data-link-type="dfn" href="#concept-tree-parent">parent</a> before <var>element</var>’s <a data-link-type="dfn" href="#concept-tree-next-sibling">next sibling</a>. Rethrow any exceptions. </p> <dt>Otherwise <dd> - <p>Throw a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#syntaxerror">SyntaxError</a></code> exception. </p> + <p><a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">Throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#syntaxerror">SyntaxError</a></code>. </p> </dl> <p>The <dfn class="idl-code" data-dfn-for="Element" data-dfn-type="method" data-export="" id="dom-element-insertadjacentelement"><code>insertAdjacentElement(<var>where</var>, <var>element</var>)</code><a class="self-link" href="#dom-element-insertadjacentelement"></a></dfn> method, when invoked, must return the result of running <a data-link-type="dfn" href="#insert-adjacent">insert adjacent</a>, given <a data-link-type="dfn" href="#context-object">context object</a>, <var>where</var>, and <var>element</var>. Rethrow any exceptions. </p> <p>The <dfn class="idl-code" data-dfn-for="Element" data-dfn-type="method" data-export="" id="dom-element-insertadjacenttext"><code>insertAdjacentText(<var>where</var>, <var>data</var>)</code><a class="self-link" href="#dom-element-insertadjacenttext"></a></dfn> method, when invoked, must run these steps: </p> <ol> <li> - <p>Let <var>text</var> be a new <code>Text</code> object whose <a data-link-type="dfn" href="#concept-cd-data">data</a> is <var>data</var>. </p> + <p>Let <var>text</var> be a new <code class="idl"><a data-link-type="idl" href="#text">Text</a></code> <a data-link-type="dfn" href="#concept-node">node</a> whose <a data-link-type="dfn" href="#concept-cd-data">data</a> is <var>data</var> and <a data-link-type="dfn" href="#concept-node-document">node document</a> is <a data-link-type="dfn" href="#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-node-document">node document</a>. </p> <li> <p>Run <a data-link-type="dfn" href="#insert-adjacent">insert adjacent</a>, given <a data-link-type="dfn" href="#context-object">context object</a>, <var>where</var>, and <var>text</var>. Rethrow any exceptions. </p> </ol> @@ -3477,10 +3762,10 @@ <h4 class="heading settled" data-level="4.9.1" id="interface-namednodemap"><span getter <a data-link-type="idl-name" href="#attr">Attr</a>? <a class="idl-code" data-link-type="method" href="#dom-namednodemap-item">item</a>(unsigned long <dfn class="idl-code" data-dfn-for="NamedNodeMap/item(index)" data-dfn-type="argument" data-export="" id="dom-namednodemap-item-index-index">index<a class="self-link" href="#dom-namednodemap-item-index-index"></a></dfn>); getter <a data-link-type="idl-name" href="#attr">Attr</a>? <a class="idl-code" data-link-type="method" href="#dom-namednodemap-getnameditem">getNamedItem</a>(DOMString <dfn class="idl-code" data-dfn-for="NamedNodeMap/getNamedItem(qualifiedName)" data-dfn-type="argument" data-export="" id="dom-namednodemap-getnameditem-qualifiedname-qualifiedname">qualifiedName<a class="self-link" href="#dom-namednodemap-getnameditem-qualifiedname-qualifiedname"></a></dfn>); <a data-link-type="idl-name" href="#attr">Attr</a>? <a class="idl-code" data-link-type="method" href="#dom-namednodemap-getnameditemns">getNamedItemNS</a>(DOMString? <dfn class="idl-code" data-dfn-for="NamedNodeMap/getNamedItemNS(namespace, localName)" data-dfn-type="argument" data-export="" id="dom-namednodemap-getnameditemns-namespace-localname-namespace">namespace<a class="self-link" href="#dom-namednodemap-getnameditemns-namespace-localname-namespace"></a></dfn>, DOMString <dfn class="idl-code" data-dfn-for="NamedNodeMap/getNamedItemNS(namespace, localName)" data-dfn-type="argument" data-export="" id="dom-namednodemap-getnameditemns-namespace-localname-localname">localName<a class="self-link" href="#dom-namednodemap-getnameditemns-namespace-localname-localname"></a></dfn>); - <a data-link-type="idl-name" href="#attr">Attr</a>? <a class="idl-code" data-link-type="method" href="#dom-namednodemap-setnameditem">setNamedItem</a>(<a data-link-type="idl-name" href="#attr">Attr</a> <dfn class="idl-code" data-dfn-for="NamedNodeMap/setNamedItem(attr)" data-dfn-type="argument" data-export="" id="dom-namednodemap-setnameditem-attr-attr">attr<a class="self-link" href="#dom-namednodemap-setnameditem-attr-attr"></a></dfn>); - <a data-link-type="idl-name" href="#attr">Attr</a>? <a class="idl-code" data-link-type="method" href="#dom-namednodemap-setnameditemns">setNamedItemNS</a>(<a data-link-type="idl-name" href="#attr">Attr</a> <dfn class="idl-code" data-dfn-for="NamedNodeMap/setNamedItemNS(attr)" data-dfn-type="argument" data-export="" id="dom-namednodemap-setnameditemns-attr-attr">attr<a class="self-link" href="#dom-namednodemap-setnameditemns-attr-attr"></a></dfn>); - <a data-link-type="idl-name" href="#attr">Attr</a> <a class="idl-code" data-link-type="method" href="#dom-namednodemap-removenameditem">removeNamedItem</a>(DOMString <dfn class="idl-code" data-dfn-for="NamedNodeMap/removeNamedItem(qualifiedName)" data-dfn-type="argument" data-export="" id="dom-namednodemap-removenameditem-qualifiedname-qualifiedname">qualifiedName<a class="self-link" href="#dom-namednodemap-removenameditem-qualifiedname-qualifiedname"></a></dfn>); - <a data-link-type="idl-name" href="#attr">Attr</a> <a class="idl-code" data-link-type="method" href="#dom-namednodemap-removenameditemns">removeNamedItemNS</a>(DOMString? <dfn class="idl-code" data-dfn-for="NamedNodeMap/removeNamedItemNS(namespace, localName)" data-dfn-type="argument" data-export="" id="dom-namednodemap-removenameditemns-namespace-localname-namespace">namespace<a class="self-link" href="#dom-namednodemap-removenameditemns-namespace-localname-namespace"></a></dfn>, DOMString <dfn class="idl-code" data-dfn-for="NamedNodeMap/removeNamedItemNS(namespace, localName)" data-dfn-type="argument" data-export="" id="dom-namednodemap-removenameditemns-namespace-localname-localname">localName<a class="self-link" href="#dom-namednodemap-removenameditemns-namespace-localname-localname"></a></dfn>); + [CEReactions] <a data-link-type="idl-name" href="#attr">Attr</a>? <a class="idl-code" data-link-type="method" href="#dom-namednodemap-setnameditem">setNamedItem</a>(<a data-link-type="idl-name" href="#attr">Attr</a> <dfn class="idl-code" data-dfn-for="NamedNodeMap/setNamedItem(attr)" data-dfn-type="argument" data-export="" id="dom-namednodemap-setnameditem-attr-attr">attr<a class="self-link" href="#dom-namednodemap-setnameditem-attr-attr"></a></dfn>); + [CEReactions] <a data-link-type="idl-name" href="#attr">Attr</a>? <a class="idl-code" data-link-type="method" href="#dom-namednodemap-setnameditemns">setNamedItemNS</a>(<a data-link-type="idl-name" href="#attr">Attr</a> <dfn class="idl-code" data-dfn-for="NamedNodeMap/setNamedItemNS(attr)" data-dfn-type="argument" data-export="" id="dom-namednodemap-setnameditemns-attr-attr">attr<a class="self-link" href="#dom-namednodemap-setnameditemns-attr-attr"></a></dfn>); + [CEReactions] <a data-link-type="idl-name" href="#attr">Attr</a> <a class="idl-code" data-link-type="method" href="#dom-namednodemap-removenameditem">removeNamedItem</a>(DOMString <dfn class="idl-code" data-dfn-for="NamedNodeMap/removeNamedItem(qualifiedName)" data-dfn-type="argument" data-export="" id="dom-namednodemap-removenameditem-qualifiedname-qualifiedname">qualifiedName<a class="self-link" href="#dom-namednodemap-removenameditem-qualifiedname-qualifiedname"></a></dfn>); + [CEReactions] <a data-link-type="idl-name" href="#attr">Attr</a> <a class="idl-code" data-link-type="method" href="#dom-namednodemap-removenameditemns">removeNamedItemNS</a>(DOMString? <dfn class="idl-code" data-dfn-for="NamedNodeMap/removeNamedItemNS(namespace, localName)" data-dfn-type="argument" data-export="" id="dom-namednodemap-removenameditemns-namespace-localname-namespace">namespace<a class="self-link" href="#dom-namednodemap-removenameditemns-namespace-localname-namespace"></a></dfn>, DOMString <dfn class="idl-code" data-dfn-for="NamedNodeMap/removeNamedItemNS(namespace, localName)" data-dfn-type="argument" data-export="" id="dom-namednodemap-removenameditemns-namespace-localname-localname">localName<a class="self-link" href="#dom-namednodemap-removenameditemns-namespace-localname-localname"></a></dfn>); }; </pre> <p>A <code class="idl"><a data-link-type="idl" href="#namednodemap">NamedNodeMap</a></code> has an associated <dfn data-dfn-for="NamedNodeMap" data-dfn-type="dfn" data-export="" id="concept-namednodemap-element">element<a class="self-link" href="#concept-namednodemap-element"></a></dfn> (an <a data-link-type="dfn" href="#concept-element">element</a>).</p> @@ -3524,7 +3809,7 @@ <h4 class="heading settled" data-level="4.9.1" id="interface-namednodemap"><span <li> <p>Let <var>attr</var> be the result of <a data-link-type="dfn" href="#concept-element-attributes-remove-by-name">removing an attribute</a> given <var>qualifiedName</var> and <a data-link-type="dfn" href="#concept-namednodemap-element">element</a>. </p> <li> - <p>If <var>attr</var> is null, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notfounderror">NotFoundError</a></code> exception. </p> + <p>If <var>attr</var> is null, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notfounderror">NotFoundError</a></code>. </p> <li> <p>Return <var>attr</var>. </p> </ol> @@ -3533,7 +3818,7 @@ <h4 class="heading settled" data-level="4.9.1" id="interface-namednodemap"><span <li> <p>Let <var>attr</var> be the result of <a data-link-type="dfn" href="#concept-element-attributes-remove-by-namespace">removing an attribute</a> given <var>namespace</var>, <var>localName</var>, and <a data-link-type="dfn" href="#concept-namednodemap-element">element</a>. </p> <li> - <p>If <var>attr</var> is null, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notfounderror">NotFoundError</a></code> exception. </p> + <p>If <var>attr</var> is null, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notfounderror">NotFoundError</a></code>. </p> <li> <p>Return <var>attr</var>. </p> </ol> @@ -3545,9 +3830,9 @@ <h4 class="heading settled" data-level="4.9.2" id="interface-attr"><span class=" readonly attribute DOMString <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="DOMString " href="#dom-attr-localname">localName</a>; readonly attribute DOMString <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="DOMString " href="#dom-attr-name">name</a>; readonly attribute DOMString <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="DOMString " href="#dom-attr-nodename">nodeName</a>; // historical alias of .name - attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-attr-value">value</a>; - [TreatNullAs=<a data-link-type="idl-name">EmptyString</a>] attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-attr-nodevalue">nodeValue</a>; // historical alias of .value - [TreatNullAs=<a data-link-type="idl-name">EmptyString</a>] attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-attr-textcontent">textContent</a>; // historical alias of .value + [CEReactions] attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-attr-value">value</a>; + [CEReactions, TreatNullAs=<a data-link-type="idl-name">EmptyString</a>] attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-attr-nodevalue">nodeValue</a>; // historical alias of .value + [CEReactions, TreatNullAs=<a data-link-type="idl-name">EmptyString</a>] attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-attr-textcontent">textContent</a>; // historical alias of .value readonly attribute <a data-link-type="idl-name" href="#element">Element</a>? <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="Element? " href="#dom-attr-ownerelement">ownerElement</a>; @@ -3557,7 +3842,7 @@ <h4 class="heading settled" data-level="4.9.2" id="interface-attr"><span class=" to as <em>content attributes</em> to avoid confusion with IDL attributes.</p> <p><a data-link-type="dfn" href="#concept-attribute">Attributes</a> have a <dfn data-dfn-for="Attr" data-dfn-type="dfn" data-export="" id="concept-attribute-namespace">namespace<a class="self-link" href="#concept-attribute-namespace"></a></dfn> (null or a non-empty string), <dfn data-dfn-for="Attr" data-dfn-type="dfn" data-export="" id="concept-attribute-namespace-prefix">namespace prefix<a class="self-link" href="#concept-attribute-namespace-prefix"></a></dfn> (null or a non-empty string), <dfn data-dfn-for="Attr" data-dfn-type="dfn" data-export="" id="concept-attribute-local-name">local name<a class="self-link" href="#concept-attribute-local-name"></a></dfn> (a non-empty string), <dfn data-dfn-for="Attr" data-dfn-type="dfn" data-export="" id="concept-attribute-value">value<a class="self-link" href="#concept-attribute-value"></a></dfn> (a string), and <dfn data-dfn-for="Attr" data-dfn-type="dfn" data-export="" id="concept-attribute-element">element<a class="self-link" href="#concept-attribute-element"></a></dfn> (null or an <a data-link-type="dfn" href="#concept-element">element</a>).</p> <p class="note no-backref" role="note">If designed today they would just have a name and value. ☹ </p> - <p>An <a data-link-type="dfn" href="#concept-attribute">attribute</a>’s <dfn data-dfn-for="Attr" data-dfn-type="dfn" data-noexport="" id="concept-attribute-qualified-name">qualified name<a class="self-link" href="#concept-attribute-qualified-name"></a></dfn> is its <a data-link-type="dfn" href="#concept-attribute-local-name">local name</a> if its <a data-link-type="dfn" href="#concept-attribute-namespace-prefix">namespace prefix</a> is null, and its <a data-link-type="dfn" href="#concept-attribute-namespace-prefix">namespace prefix</a>, followed by "<code>:</code>", followed by its <a data-link-type="dfn" href="#concept-attribute-local-name">local name</a>, otherwise. </p> + <p>An <a data-link-type="dfn" href="#concept-attribute">attribute</a>’s <dfn data-dfn-for="Attr" data-dfn-type="dfn" data-export="" id="concept-attribute-qualified-name">qualified name<a class="self-link" href="#concept-attribute-qualified-name"></a></dfn> is its <a data-link-type="dfn" href="#concept-attribute-local-name">local name</a> if its <a data-link-type="dfn" href="#concept-attribute-namespace-prefix">namespace prefix</a> is null, and its <a data-link-type="dfn" href="#concept-attribute-namespace-prefix">namespace prefix</a>, followed by "<code>:</code>", followed by its <a data-link-type="dfn" href="#concept-attribute-local-name">local name</a>, otherwise. </p> <p class="note" role="note">User agents could have this as an internal slot as an optimization, but are not required to do so. The standard has this concept for readability. </p> <p>When an <a data-link-type="dfn" href="#concept-attribute">attribute</a> is created, its <a data-link-type="dfn" href="#concept-attribute-local-name">local name</a> is given. Unless explicitly @@ -3600,7 +3885,7 @@ <h3 class="heading settled" data-level="4.10" id="interface-characterdata"><span <p>To <dfn data-dfn-for="CharacterData, Text, Comment, ProcessingInstruction" data-dfn-type="dfn" data-export="" id="concept-cd-replace">replace data<a class="self-link" href="#concept-cd-replace"></a></dfn> of node <var>node</var> with offset <var>offset</var>, count <var>count</var>, and data <var>data</var>, run these steps:</p> <ol> <li>Let <var>length</var> be <var>node</var>’s <code class="idl"><a data-link-type="idl" href="#dom-characterdata-length">length</a></code> attribute value. - <li>If <var>offset</var> is greater than <var>length</var>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#indexsizeerror">IndexSizeError</a></code> exception. + <li>If <var>offset</var> is greater than <var>length</var>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#indexsizeerror">IndexSizeError</a></code>. <li>If <var>offset</var> plus <var>count</var> is greater than <var>length</var> let <var>count</var> be <var>length</var> minus <var>offset</var>. <li><a data-link-type="dfn" href="#queue-a-mutation-record">Queue a mutation record</a> of "<code>characterData</code>" @@ -3617,7 +3902,7 @@ <h3 class="heading settled" data-level="4.10" id="interface-characterdata"><span <p>To <dfn data-dfn-for="CharacterData, Text, Comment, ProcessingInstruction" data-dfn-type="dfn" data-export="" id="concept-cd-substring">substring data<a class="self-link" href="#concept-cd-substring"></a></dfn> with node <var>node</var>, offset <var>offset</var>, and count <var>count</var>, run these steps:</p> <ol> <li>Let <var>length</var> be <var>node</var>’s <code class="idl"><a data-link-type="idl" href="#dom-characterdata-length">length</a></code> attribute value. - <li>If <var>offset</var> is greater than <var>length</var>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#indexsizeerror">IndexSizeError</a></code> exception. + <li>If <var>offset</var> is greater than <var>length</var>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#indexsizeerror">IndexSizeError</a></code>. <li>If <var>offset</var> plus <var>count</var> is greater than <var>length</var>, return a string whose value is the <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-code-unit">code units</a> from the <var>offset</var><sup>th</sup> <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-code-unit">code unit</a> to the end of <var>node</var>’s <a data-link-type="dfn" href="#concept-cd-data">data</a>, and then terminate these steps. @@ -3652,7 +3937,7 @@ <h3 class="heading settled" data-level="4.11" id="interface-text"><span class="s <p>To <dfn data-dfn-type="dfn" data-export="" data-lt="split a Text node" id="concept-text-split">split<a class="self-link" href="#concept-text-split"></a></dfn> a <code class="idl"><a data-link-type="idl" href="#text">Text</a></code> <a data-link-type="dfn" href="#concept-node">node</a> <var>node</var> with offset <var>offset</var>, run these steps:</p> <ol> <li>Let <var>length</var> be <var>node</var>’s <code class="idl"><a data-link-type="idl" href="#dom-characterdata-length">length</a></code> attribute value. - <li>If <var>offset</var> is greater than <var>length</var>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#indexsizeerror">IndexSizeError</a></code> exception. + <li>If <var>offset</var> is greater than <var>length</var>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#indexsizeerror">IndexSizeError</a></code>. <li>Let <var>count</var> be <var>length</var> minus <var>offset</var>. <li>Let <var>new data</var> be the result of <a data-link-type="dfn" href="#concept-cd-substring">substringing data</a> with node <var>node</var>, offset <var>offset</var>, and count <var>count</var>. <li>Let <var>new node</var> be a new <code class="idl"><a data-link-type="idl" href="#text">Text</a></code> <a data-link-type="dfn" href="#concept-node">node</a>, with the same <a data-link-type="dfn" href="#concept-node-document">node document</a> as <var>node</var>. Set <var>new node</var>’s <a data-link-type="dfn" href="#concept-cd-data">data</a> to <var>new data</var>. @@ -3767,11 +4052,11 @@ <h3 class="heading settled" data-level="5.2" id="interface-range"><span class="s const unsigned short <dfn class="idl-code" data-dfn-for="Range" data-dfn-type="const" data-export="" id="dom-range-end_to_start">END_TO_START<a class="self-link" href="#dom-range-end_to_start"></a></dfn> = 3; short <a class="idl-code" data-link-type="method" href="#dom-range-compareboundarypoints">compareBoundaryPoints</a>(unsigned short <dfn class="idl-code" data-dfn-for="Range/compareBoundaryPoints(how, sourceRange)" data-dfn-type="argument" data-export="" id="dom-range-compareboundarypoints-how-sourcerange-how">how<a class="self-link" href="#dom-range-compareboundarypoints-how-sourcerange-how"></a></dfn>, <a data-link-type="idl-name" href="#range">Range</a> <dfn class="idl-code" data-dfn-for="Range/compareBoundaryPoints(how, sourceRange)" data-dfn-type="argument" data-export="" id="dom-range-compareboundarypoints-how-sourcerange-sourcerange">sourceRange<a class="self-link" href="#dom-range-compareboundarypoints-how-sourcerange-sourcerange"></a></dfn>); - void <a class="idl-code" data-link-type="method" href="#dom-range-deletecontents">deleteContents</a>(); - [NewObject] <a data-link-type="idl-name" href="#documentfragment">DocumentFragment</a> <a class="idl-code" data-link-type="method" href="#dom-range-extractcontents">extractContents</a>(); - [NewObject] <a data-link-type="idl-name" href="#documentfragment">DocumentFragment</a> <a class="idl-code" data-link-type="method" href="#dom-range-clonecontents">cloneContents</a>(); - void <a class="idl-code" data-link-type="method" href="#dom-range-insertnode">insertNode</a>(<a data-link-type="idl-name" href="#node">Node</a> <dfn class="idl-code" data-dfn-for="Range/insertNode(node)" data-dfn-type="argument" data-export="" id="dom-range-insertnode-node-node">node<a class="self-link" href="#dom-range-insertnode-node-node"></a></dfn>); - void <a class="idl-code" data-link-type="method" href="#dom-range-surroundcontents">surroundContents</a>(<a data-link-type="idl-name" href="#node">Node</a> <dfn class="idl-code" data-dfn-for="Range/surroundContents(newParent)" data-dfn-type="argument" data-export="" id="dom-range-surroundcontents-newparent-newparent">newParent<a class="self-link" href="#dom-range-surroundcontents-newparent-newparent"></a></dfn>); + [CEReactions] void <a class="idl-code" data-link-type="method" href="#dom-range-deletecontents">deleteContents</a>(); + [CEReactions, NewObject] <a data-link-type="idl-name" href="#documentfragment">DocumentFragment</a> <a class="idl-code" data-link-type="method" href="#dom-range-extractcontents">extractContents</a>(); + [CEReactions, NewObject] <a data-link-type="idl-name" href="#documentfragment">DocumentFragment</a> <a class="idl-code" data-link-type="method" href="#dom-range-clonecontents">cloneContents</a>(); + [CEReactions] void <a class="idl-code" data-link-type="method" href="#dom-range-insertnode">insertNode</a>(<a data-link-type="idl-name" href="#node">Node</a> <dfn class="idl-code" data-dfn-for="Range/insertNode(node)" data-dfn-type="argument" data-export="" id="dom-range-insertnode-node-node">node<a class="self-link" href="#dom-range-insertnode-node-node"></a></dfn>); + [CEReactions] void <a class="idl-code" data-link-type="method" href="#dom-range-surroundcontents">surroundContents</a>(<a data-link-type="idl-name" href="#node">Node</a> <dfn class="idl-code" data-dfn-for="Range/surroundContents(newParent)" data-dfn-type="argument" data-export="" id="dom-range-surroundcontents-newparent-newparent">newParent<a class="self-link" href="#dom-range-surroundcontents-newparent-newparent"></a></dfn>); [NewObject] <a data-link-type="idl-name" href="#range">Range</a> <a class="idl-code" data-link-type="method" href="#dom-range-clonerange">cloneRange</a>(); void <a class="idl-code" data-link-type="method" href="#dom-range-detach">detach</a>(); @@ -3884,8 +4169,8 @@ <h3 class="heading settled" data-level="5.2" id="interface-range"><span class="s <hr> <p>To <dfn data-dfn-for="Range" data-dfn-type="dfn" data-export="" data-lt="set the start|set the end" id="concept-range-bp-set">set the start or end<a class="self-link" href="#concept-range-bp-set"></a></dfn> of a <var>range</var> to a <a data-link-type="dfn" href="#concept-range-bp">boundary point</a> (<var>node</var>, <var>offset</var>), run these steps:</p> <ol> - <li>If <var>node</var> is a <a data-link-type="dfn" href="#concept-doctype">doctype</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidnodetypeerror">InvalidNodeTypeError</a></code> exception. - <li>If <var>offset</var> is greater than <var>node</var>’s <a data-link-type="dfn" href="#concept-node-length">length</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#indexsizeerror">IndexSizeError</a></code> exception. + <li>If <var>node</var> is a <a data-link-type="dfn" href="#concept-doctype">doctype</a>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidnodetypeerror">InvalidNodeTypeError</a></code>. + <li>If <var>offset</var> is greater than <var>node</var>’s <a data-link-type="dfn" href="#concept-node-length">length</a>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#indexsizeerror">IndexSizeError</a></code>. <li>Let <var>bp</var> be the <a data-link-type="dfn" href="#concept-range-bp">boundary point</a> (<var>node</var>, <var>offset</var>). <li> <dl class="switch"> @@ -3910,25 +4195,25 @@ <h3 class="heading settled" data-level="5.2" id="interface-range"><span class="s <p>The <dfn class="idl-code" data-dfn-for="Range" data-dfn-type="method" data-export="" id="dom-range-setstartbefore">setStartBefore(<var>node</var>)<a class="self-link" href="#dom-range-setstartbefore"></a></dfn> method must run these steps:</p> <ol> <li>Let <var>parent</var> be <var>node</var>’s <a data-link-type="dfn" href="#concept-tree-parent">parent</a>. - <li>If <var>parent</var> is null, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidnodetypeerror">InvalidNodeTypeError</a></code> exception. + <li>If <var>parent</var> is null, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidnodetypeerror">InvalidNodeTypeError</a></code>. <li><a data-link-type="dfn" href="#concept-range-bp-set">Set the start</a> of the <a data-link-type="dfn" href="#context-object">context object</a> to <a data-link-type="dfn" href="#concept-range-bp">boundary point</a> (<var>parent</var>, <var>node</var>’s <a data-link-type="dfn" href="#concept-tree-index">index</a>). </ol> <p>The <dfn class="idl-code" data-dfn-for="Range" data-dfn-type="method" data-export="" id="dom-range-setstartafter">setStartAfter(<var>node</var>)<a class="self-link" href="#dom-range-setstartafter"></a></dfn> method must run these steps:</p> <ol> <li>Let <var>parent</var> be <var>node</var>’s <a data-link-type="dfn" href="#concept-tree-parent">parent</a>. - <li>If <var>parent</var> is null, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidnodetypeerror">InvalidNodeTypeError</a></code> exception. + <li>If <var>parent</var> is null, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidnodetypeerror">InvalidNodeTypeError</a></code>. <li><a data-link-type="dfn" href="#concept-range-bp-set">Set the start</a> of the <a data-link-type="dfn" href="#context-object">context object</a> to <a data-link-type="dfn" href="#concept-range-bp">boundary point</a> (<var>parent</var>, <var>node</var>’s <a data-link-type="dfn" href="#concept-tree-index">index</a> plus one). </ol> <p>The <dfn class="idl-code" data-dfn-for="Range" data-dfn-type="method" data-export="" id="dom-range-setendbefore">setEndBefore(<var>node</var>)<a class="self-link" href="#dom-range-setendbefore"></a></dfn> method must run these steps:</p> <ol> <li>Let <var>parent</var> be <var>node</var>’s <a data-link-type="dfn" href="#concept-tree-parent">parent</a>. - <li>If <var>parent</var> is null, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidnodetypeerror">InvalidNodeTypeError</a></code> exception. + <li>If <var>parent</var> is null, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidnodetypeerror">InvalidNodeTypeError</a></code>. <li><a data-link-type="dfn" href="#concept-range-bp-set">Set the end</a> of the <a data-link-type="dfn" href="#context-object">context object</a> to <a data-link-type="dfn" href="#concept-range-bp">boundary point</a> (<var>parent</var>, <var>node</var>’s <a data-link-type="dfn" href="#concept-tree-index">index</a>). </ol> <p>The <dfn class="idl-code" data-dfn-for="Range" data-dfn-type="method" data-export="" id="dom-range-setendafter">setEndAfter(<var>node</var>)<a class="self-link" href="#dom-range-setendafter"></a></dfn> method must run these steps:</p> <ol> <li>Let <var>parent</var> be <var>node</var>’s <a data-link-type="dfn" href="#concept-tree-parent">parent</a>. - <li>If <var>parent</var> is null, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidnodetypeerror">InvalidNodeTypeError</a></code> exception. + <li>If <var>parent</var> is null, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidnodetypeerror">InvalidNodeTypeError</a></code>. <li><a data-link-type="dfn" href="#concept-range-bp-set">Set the end</a> of the <a data-link-type="dfn" href="#context-object">context object</a> to <a data-link-type="dfn" href="#concept-range-bp">boundary point</a> (<var>parent</var>, <var>node</var>’s <a data-link-type="dfn" href="#concept-tree-index">index</a> plus one). </ol> <p>The <dfn class="idl-code" data-dfn-for="Range" data-dfn-type="method" data-export="" data-lt="collapse(toStart)|collapse()" id="dom-range-collapse"><code>collapse(<var>toStart</var>)</code><a class="self-link" href="#dom-range-collapse"></a></dfn> method, when @@ -3953,15 +4238,15 @@ <h3 class="heading settled" data-level="5.2" id="interface-range"><span class="s <p>The <dfn class="idl-code" data-dfn-for="Range" data-dfn-type="method" data-export="" id="dom-range-compareboundarypoints">compareBoundaryPoints(<var>how</var>, <var>sourceRange</var>)<a class="self-link" href="#dom-range-compareboundarypoints"></a></dfn> method must run these steps:</p> <ol> <li> - If <var>how</var> is not one of - <ul> + <p>If <var>how</var> is not one of </p> + <ul class="brief"> <li><code class="idl"><a data-link-type="idl" href="#dom-range-start_to_start">START_TO_START</a></code>, <li><code class="idl"><a data-link-type="idl" href="#dom-range-start_to_end">START_TO_END</a></code>, <li><code class="idl"><a data-link-type="idl" href="#dom-range-end_to_end">END_TO_END</a></code>, and <li><code class="idl"><a data-link-type="idl" href="#dom-range-end_to_start">END_TO_START</a></code>, </ul> - <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code> exception. - <li>If <a data-link-type="dfn" href="#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-range-root">root</a> is not the same as <var>sourceRange</var>’s <a data-link-type="dfn" href="#concept-range-root">root</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#wrongdocumenterror">WrongDocumentError</a></code> exception. + <p>then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a></code>. </p> + <li>If <a data-link-type="dfn" href="#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-range-root">root</a> is not the same as <var>sourceRange</var>’s <a data-link-type="dfn" href="#concept-range-root">root</a>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#wrongdocumenterror">WrongDocumentError</a></code>. <li> If <var>how</var> is: <dl class="switch"> @@ -4045,7 +4330,7 @@ <h3 class="heading settled" data-level="5.2" id="interface-range"><span class="s it has to be an <a data-link-type="dfn" href="#concept-tree-inclusive-ancestor">inclusive ancestor</a> of <var>original end node</var>. The other case is similar. Also, notice that the two <a data-link-type="dfn" href="#concept-tree-child">children</a> will never be equal if both are defined. </p> <li>Let <var>contained children</var> be a list of all <a data-link-type="dfn" href="#concept-tree-child">children</a> of <var>common ancestor</var> that are <a data-link-type="dfn" href="#contained">contained</a> in <var>range</var>, in <a data-link-type="dfn" href="#concept-tree-order">tree order</a>. <li> - If any member of <var>contained children</var> is a <a data-link-type="dfn" href="#concept-doctype">doctype</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#hierarchyrequesterror">HierarchyRequestError</a></code> exception. + <p>If any member of <var>contained children</var> is a <a data-link-type="dfn" href="#concept-doctype">doctype</a>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#hierarchyrequesterror">HierarchyRequestError</a></code>. </p> <p class="note no-backref" role="note">We do not have to worry about the first or last partially contained node, because a <a data-link-type="dfn" href="#concept-doctype">doctype</a> can never be partially contained. It cannot be a boundary point of a range, and it @@ -4135,7 +4420,7 @@ <h3 class="heading settled" data-level="5.2" id="interface-range"><span class="s it has to be an <a data-link-type="dfn" href="#concept-tree-inclusive-ancestor">inclusive ancestor</a> of <var>original end node</var>. The other case is similar. Also, notice that the two <a data-link-type="dfn" href="#concept-tree-child">children</a> will never be equal if both are defined. </p> <li>Let <var>contained children</var> be a list of all <a data-link-type="dfn" href="#concept-tree-child">children</a> of <var>common ancestor</var> that are <a data-link-type="dfn" href="#contained">contained</a> in <var>range</var>, in <a data-link-type="dfn" href="#concept-tree-order">tree order</a>. <li> - If any member of <var>contained children</var> is a <a data-link-type="dfn" href="#concept-doctype">doctype</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#hierarchyrequesterror">HierarchyRequestError</a></code> exception. + <p>If any member of <var>contained children</var> is a <a data-link-type="dfn" href="#concept-doctype">doctype</a>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#hierarchyrequesterror">HierarchyRequestError</a></code>. </p> <p class="note no-backref" role="note">We do not have to worry about the first or last partially contained node, because a <a data-link-type="dfn" href="#concept-doctype">doctype</a> can never be partially contained. It cannot be a boundary point of a range, and it @@ -4192,7 +4477,7 @@ <h3 class="heading settled" data-level="5.2" id="interface-range"><span class="s <p>The <dfn class="idl-code" data-dfn-for="Range" data-dfn-type="method" data-export="" id="dom-range-clonecontents">cloneContents()<a class="self-link" href="#dom-range-clonecontents"></a></dfn> method must return the result of <a data-link-type="dfn" href="#concept-range-clone">cloning the contents</a> of <a data-link-type="dfn" href="#context-object">context object</a>.</p> <p>To <dfn data-dfn-for="Range" data-dfn-type="dfn" data-export="" id="concept-range-insert">insert<a class="self-link" href="#concept-range-insert"></a></dfn> a <a data-link-type="dfn" href="#concept-node">node</a> <var>node</var> into a <a data-link-type="dfn" href="#concept-range">range</a> <var>range</var>, run these steps:</p> <ol> - <li>If <var>range</var>’s <a data-link-type="dfn" href="#concept-range-start-node">start node</a> is a <code class="idl"><a data-link-type="idl" href="#processinginstruction">ProcessingInstruction</a></code> or <code class="idl"><a data-link-type="idl" href="#comment">Comment</a></code> <a data-link-type="dfn" href="#concept-node">node</a>, is a <code class="idl"><a data-link-type="idl" href="#text">Text</a></code> <a data-link-type="dfn" href="#concept-node">node</a> whose <a data-link-type="dfn" href="#concept-tree-parent">parent</a> is null, or is <var>node</var>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#hierarchyrequesterror">HierarchyRequestError</a></code> exception. + <li>If <var>range</var>’s <a data-link-type="dfn" href="#concept-range-start-node">start node</a> is a <code class="idl"><a data-link-type="idl" href="#processinginstruction">ProcessingInstruction</a></code> or <code class="idl"><a data-link-type="idl" href="#comment">Comment</a></code> <a data-link-type="dfn" href="#concept-node">node</a>, is a <code class="idl"><a data-link-type="idl" href="#text">Text</a></code> <a data-link-type="dfn" href="#concept-node">node</a> whose <a data-link-type="dfn" href="#concept-tree-parent">parent</a> is null, or is <var>node</var>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#hierarchyrequesterror">HierarchyRequestError</a></code>. <li>Let <var>referenceNode</var> be null. <li>If <var>range</var>’s <a data-link-type="dfn" href="#concept-range-start-node">start node</a> is a <code class="idl"><a data-link-type="idl" href="#text">Text</a></code> <a data-link-type="dfn" href="#concept-node">node</a>, set <var>referenceNode</var> to that <code class="idl"><a data-link-type="idl" href="#text">Text</a></code> <a data-link-type="dfn" href="#concept-node">node</a>. @@ -4215,8 +4500,10 @@ <h3 class="heading settled" data-level="5.2" id="interface-range"><span class="s <p>The <dfn class="idl-code" data-dfn-for="Range" data-dfn-type="method" data-export="" id="dom-range-insertnode">insertNode(<var>node</var>)<a class="self-link" href="#dom-range-insertnode"></a></dfn> method must <a data-link-type="dfn" href="#concept-range-insert">insert</a> <var>node</var> into <a data-link-type="dfn" href="#context-object">context object</a>.</p> <p>The <dfn class="idl-code" data-dfn-for="Range" data-dfn-type="method" data-export="" id="dom-range-surroundcontents">surroundContents(<var>newParent</var>)<a class="self-link" href="#dom-range-surroundcontents"></a></dfn> method must run these steps:</p> <ol> - <li>If a non-<code class="idl"><a data-link-type="idl" href="#text">Text</a></code> <a data-link-type="dfn" href="#concept-node">node</a> is <a data-link-type="dfn" href="#partially-contained">partially contained</a> in the <a data-link-type="dfn" href="#context-object">context object</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror">InvalidStateError</a></code> exception. - <li>If <var>newParent</var> is a <code class="idl"><a data-link-type="idl" href="#document">Document</a></code>, <code class="idl"><a data-link-type="idl" href="#documenttype">DocumentType</a></code>, or <code class="idl"><a data-link-type="idl" href="#documentfragment">DocumentFragment</a></code> <a data-link-type="dfn" href="#concept-node">node</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidnodetypeerror">InvalidNodeTypeError</a></code> exception. + <li>If a non-<code class="idl"><a data-link-type="idl" href="#text">Text</a></code> <a data-link-type="dfn" href="#concept-node">node</a> is <a data-link-type="dfn" href="#partially-contained">partially contained</a> in the <a data-link-type="dfn" href="#context-object">context object</a>, + then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidstateerror">InvalidStateError</a></code>. + <li>If <var>newParent</var> is a <code class="idl"><a data-link-type="idl" href="#document">Document</a></code>, <code class="idl"><a data-link-type="idl" href="#documenttype">DocumentType</a></code>, or <code class="idl"><a data-link-type="idl" href="#documentfragment">DocumentFragment</a></code> <a data-link-type="dfn" href="#concept-node">node</a>, + then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidnodetypeerror">InvalidNodeTypeError</a></code>. <li>Let <var>fragment</var> be the result of <a data-link-type="dfn" href="#concept-range-extract">extracting</a> <a data-link-type="dfn" href="#context-object">context object</a>. <li>If <var>newParent</var> has <a data-link-type="dfn" href="#concept-tree-child">children</a>, <a data-link-type="dfn" href="#concept-node-replace-all">replace all</a> with null within <var>newParent</var>. <li><a data-link-type="dfn" href="#concept-range-insert">Insert</a> <var>newParent</var> into <a data-link-type="dfn" href="#context-object">context object</a>. @@ -4241,17 +4528,16 @@ <h3 class="heading settled" data-level="5.2" id="interface-range"><span class="s <ol> <li>If <var>node</var>’s <a data-link-type="dfn" href="#concept-tree-root">root</a> is different from the <a data-link-type="dfn" href="#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-range-root">root</a>, return false. - <li>If <var>node</var> is a <a data-link-type="dfn" href="#concept-doctype">doctype</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidnodetypeerror">InvalidNodeTypeError</a></code> exception. - <li>If <var>offset</var> is greater than <var>node</var>’s <a data-link-type="dfn" href="#concept-node-length">length</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#indexsizeerror">IndexSizeError</a></code> exception. + <li>If <var>node</var> is a <a data-link-type="dfn" href="#concept-doctype">doctype</a>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidnodetypeerror">InvalidNodeTypeError</a></code>. + <li>If <var>offset</var> is greater than <var>node</var>’s <a data-link-type="dfn" href="#concept-node-length">length</a>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#indexsizeerror">IndexSizeError</a></code>. <li>If (<var>node</var>, <var>offset</var>) is <a data-link-type="dfn" href="#concept-range-bp-before">before</a> <a data-link-type="dfn" href="#concept-range-start">start</a> or <a data-link-type="dfn" href="#concept-range-bp-after">after</a> <a data-link-type="dfn" href="#concept-range-end">end</a>, return false. <li>Return true. </ol> <p>The <dfn class="idl-code" data-dfn-for="Range" data-dfn-type="method" data-export="" id="dom-range-comparepoint">comparePoint(<var>node</var>, <var>offset</var>)<a class="self-link" href="#dom-range-comparepoint"></a></dfn> method must run these steps:</p> <ol> - <li>If <var>node</var>’s <a data-link-type="dfn" href="#concept-tree-root">root</a> is - different from the <a data-link-type="dfn" href="#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-range-root">root</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#wrongdocumenterror">WrongDocumentError</a></code> exception. - <li>If <var>node</var> is a <a data-link-type="dfn" href="#concept-doctype">doctype</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidnodetypeerror">InvalidNodeTypeError</a></code> exception. - <li>If <var>offset</var> is greater than <var>node</var>’s <a data-link-type="dfn" href="#concept-node-length">length</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#indexsizeerror">IndexSizeError</a></code> exception. + <li>If <var>node</var>’s <a data-link-type="dfn" href="#concept-tree-root">root</a> is different from the <a data-link-type="dfn" href="#context-object">context object</a>’s <a data-link-type="dfn" href="#concept-range-root">root</a>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#wrongdocumenterror">WrongDocumentError</a></code>. + <li>If <var>node</var> is a <a data-link-type="dfn" href="#concept-doctype">doctype</a>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidnodetypeerror">InvalidNodeTypeError</a></code>. + <li>If <var>offset</var> is greater than <var>node</var>’s <a data-link-type="dfn" href="#concept-node-length">length</a>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#indexsizeerror">IndexSizeError</a></code>. <li>If (<var>node</var>, <var>offset</var>) is <a data-link-type="dfn" href="#concept-range-bp-before">before</a> <a data-link-type="dfn" href="#concept-range-start">start</a>, return −1. <li>If (<var>node</var>, <var>offset</var>) is <a data-link-type="dfn" href="#concept-range-bp-after">after</a> <a data-link-type="dfn" href="#concept-range-end">end</a>, return 1. <li>Return 0. @@ -4337,8 +4623,7 @@ <h3 class="heading settled" data-level="6.1" id="interface-nodeiterator"><span c <p class="note no-backref" role="note">Steps are not terminated here. </p> </ol> <li> - <p>Set <var>nodeIterator</var>’s <code class="idl"><a data-link-type="idl" href="#dom-nodeiterator-referencenode">referenceNode</a></code> attribute to the <a data-link-type="dfn" href="#concept-tree-inclusive-descendant">inclusive descendant</a> of <var>toBeRemovedNode</var>’s <a data-link-type="dfn" href="#concept-tree-previous-sibling">previous sibling</a> that - appears last in <a data-link-type="dfn" href="#concept-tree-order">tree order</a>, if <var>toBeRemovedNode</var>’s <a data-link-type="dfn" href="#concept-tree-previous-sibling">previous sibling</a> is non-null, and to <var>toBeRemovedNode</var>’s <a data-link-type="dfn" href="#concept-tree-parent">parent</a> otherwise. </p> + <p>Set <var>nodeIterator</var>’s <code class="idl"><a data-link-type="idl" href="#dom-nodeiterator-referencenode">referenceNode</a></code> attribute to <var>toBeRemovedNode</var>’s <a data-link-type="dfn" href="#concept-tree-parent">parent</a>, if <var>toBeRemovedNode</var>’s <a data-link-type="dfn" href="#concept-tree-previous-sibling">previous sibling</a> is null, and to the <a data-link-type="dfn" href="#concept-tree-inclusive-descendant">inclusive descendant</a> of <var>toBeRemovedNode</var>’s <a data-link-type="dfn" href="#concept-tree-previous-sibling">previous sibling</a> that appears last in <a data-link-type="dfn" href="#concept-tree-order">tree order</a> otherwise. </p> </ol> <hr> <p>The <dfn class="idl-code" data-dfn-for="NodeIterator" data-dfn-type="attribute" data-export="" id="dom-nodeiterator-root">root<a class="self-link" href="#dom-nodeiterator-root"></a></dfn> attribute @@ -4356,11 +4641,11 @@ <h3 class="heading settled" data-level="6.1" id="interface-nodeiterator"><span c <li> <dl class="switch"> <dt>If <var>direction</var> is next - <dd> If <var>before node</var> is false, let <var>node</var> be the first <a data-link-type="dfn" href="#concept-node">node</a> <a data-link-type="dfn" href="#concept-tree-following">following</a> <var>node</var> in the <span>iterator collection</span>. If + <dd> If <var>before node</var> is false, let <var>node</var> be the first <a data-link-type="dfn" href="#concept-node">node</a> <a data-link-type="dfn" href="#concept-tree-following">following</a> <var>node</var> in the <a data-link-type="dfn" href="#iterator-collection">iterator collection</a>. If there is no such <a data-link-type="dfn" href="#concept-node">node</a> return null. If <var>before node</var> is true, set it to false. <dt>If <var>direction</var> is previous - <dd> If <var>before node</var> is true, let <var>node</var> be the first <a data-link-type="dfn" href="#concept-node">node</a> <a data-link-type="dfn" href="#concept-tree-preceding">preceding</a> <var>node</var> in the <span>iterator collection</span>. If + <dd> If <var>before node</var> is true, let <var>node</var> be the first <a data-link-type="dfn" href="#concept-node">node</a> <a data-link-type="dfn" href="#concept-tree-preceding">preceding</a> <var>node</var> in the <a data-link-type="dfn" href="#iterator-collection">iterator collection</a>. If there is no such <a data-link-type="dfn" href="#concept-node">node</a> return null. If <var>before node</var> is false, set it to true. </dl> @@ -4588,12 +4873,12 @@ <h3 class="heading settled" data-level="7.1" id="interface-domtokenlist"><span c readonly attribute unsigned long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="unsigned long " href="#dom-domtokenlist-length">length</a>; getter DOMString? <a class="idl-code" data-link-type="method" href="#dom-domtokenlist-item">item</a>(unsigned long <dfn class="idl-code" data-dfn-for="DOMTokenList/item(index)" data-dfn-type="argument" data-export="" id="dom-domtokenlist-item-index-index">index<a class="self-link" href="#dom-domtokenlist-item-index-index"></a></dfn>); boolean <a class="idl-code" data-link-type="method" href="#dom-domtokenlist-contains">contains</a>(DOMString <dfn class="idl-code" data-dfn-for="DOMTokenList/contains(token)" data-dfn-type="argument" data-export="" id="dom-domtokenlist-contains-token-token">token<a class="self-link" href="#dom-domtokenlist-contains-token-token"></a></dfn>); - void <a class="idl-code" data-link-type="method" href="#dom-domtokenlist-add">add</a>(DOMString... <dfn class="idl-code" data-dfn-for="DOMTokenList/add(tokens...), DOMTokenList/add(tokens)" data-dfn-type="argument" data-export="" id="dom-domtokenlist-add-tokens-tokens">tokens<a class="self-link" href="#dom-domtokenlist-add-tokens-tokens"></a></dfn>); - void <a class="idl-code" data-link-type="method" href="#dom-domtokenlist-remove">remove</a>(DOMString... <dfn class="idl-code" data-dfn-for="DOMTokenList/remove(tokens...), DOMTokenList/remove(tokens)" data-dfn-type="argument" data-export="" id="dom-domtokenlist-remove-tokens-tokens">tokens<a class="self-link" href="#dom-domtokenlist-remove-tokens-tokens"></a></dfn>); - boolean <a class="idl-code" data-link-type="method" href="#dom-domtokenlist-toggle">toggle</a>(DOMString <dfn class="idl-code" data-dfn-for="DOMTokenList/toggle(token, force), DOMTokenList/toggle(token)" data-dfn-type="argument" data-export="" id="dom-domtokenlist-toggle-token-force-token">token<a class="self-link" href="#dom-domtokenlist-toggle-token-force-token"></a></dfn>, optional boolean <dfn class="idl-code" data-dfn-for="DOMTokenList/toggle(token, force), DOMTokenList/toggle(token)" data-dfn-type="argument" data-export="" id="dom-domtokenlist-toggle-token-force-force">force<a class="self-link" href="#dom-domtokenlist-toggle-token-force-force"></a></dfn>); - void <a class="idl-code" data-link-type="method" href="#dom-domtokenlist-replace">replace</a>(DOMString <dfn class="idl-code" data-dfn-for="DOMTokenList/replace(token, newToken)" data-dfn-type="argument" data-export="" id="dom-domtokenlist-replace-token-newtoken-token">token<a class="self-link" href="#dom-domtokenlist-replace-token-newtoken-token"></a></dfn>, DOMString <dfn class="idl-code" data-dfn-for="DOMTokenList/replace(token, newToken)" data-dfn-type="argument" data-export="" id="dom-domtokenlist-replace-token-newtoken-newtoken">newToken<a class="self-link" href="#dom-domtokenlist-replace-token-newtoken-newtoken"></a></dfn>); + [CEReactions] void <a class="idl-code" data-link-type="method" href="#dom-domtokenlist-add">add</a>(DOMString... <dfn class="idl-code" data-dfn-for="DOMTokenList/add(tokens...), DOMTokenList/add(tokens)" data-dfn-type="argument" data-export="" id="dom-domtokenlist-add-tokens-tokens">tokens<a class="self-link" href="#dom-domtokenlist-add-tokens-tokens"></a></dfn>); + [CEReactions] void <a class="idl-code" data-link-type="method" href="#dom-domtokenlist-remove">remove</a>(DOMString... <dfn class="idl-code" data-dfn-for="DOMTokenList/remove(tokens...), DOMTokenList/remove(tokens)" data-dfn-type="argument" data-export="" id="dom-domtokenlist-remove-tokens-tokens">tokens<a class="self-link" href="#dom-domtokenlist-remove-tokens-tokens"></a></dfn>); + [CEReactions] boolean <a class="idl-code" data-link-type="method" href="#dom-domtokenlist-toggle">toggle</a>(DOMString <dfn class="idl-code" data-dfn-for="DOMTokenList/toggle(token, force), DOMTokenList/toggle(token)" data-dfn-type="argument" data-export="" id="dom-domtokenlist-toggle-token-force-token">token<a class="self-link" href="#dom-domtokenlist-toggle-token-force-token"></a></dfn>, optional boolean <dfn class="idl-code" data-dfn-for="DOMTokenList/toggle(token, force), DOMTokenList/toggle(token)" data-dfn-type="argument" data-export="" id="dom-domtokenlist-toggle-token-force-force">force<a class="self-link" href="#dom-domtokenlist-toggle-token-force-force"></a></dfn>); + [CEReactions] void <a class="idl-code" data-link-type="method" href="#dom-domtokenlist-replace">replace</a>(DOMString <dfn class="idl-code" data-dfn-for="DOMTokenList/replace(token, newToken)" data-dfn-type="argument" data-export="" id="dom-domtokenlist-replace-token-newtoken-token">token<a class="self-link" href="#dom-domtokenlist-replace-token-newtoken-token"></a></dfn>, DOMString <dfn class="idl-code" data-dfn-for="DOMTokenList/replace(token, newToken)" data-dfn-type="argument" data-export="" id="dom-domtokenlist-replace-token-newtoken-newtoken">newToken<a class="self-link" href="#dom-domtokenlist-replace-token-newtoken-newtoken"></a></dfn>); boolean <a class="idl-code" data-link-type="method" href="#dom-domtokenlist-supports">supports</a>(DOMString <dfn class="idl-code" data-dfn-for="DOMTokenList/supports(token)" data-dfn-type="argument" data-export="" id="dom-domtokenlist-supports-token-token">token<a class="self-link" href="#dom-domtokenlist-supports-token-token"></a></dfn>); - attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-domtokenlist-value">value</a>; + [CEReactions] attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-domtokenlist-value">value</a>; <a data-link-type="dfn" href="#dom-domtokenlist-stringifier">stringifier</a>; iterable<DOMString>; }; @@ -4617,9 +4902,25 @@ <h3 class="heading settled" data-level="7.1" id="interface-domtokenlist"><span c to <a data-link-type="dfn" href="#concept-element-attributes-set-value">set an attribute value</a> for the associated <a data-link-type="dfn" href="#concept-element">element</a> using associated <a data-link-type="dfn" href="#concept-attribute">attribute</a>’s <a data-link-type="dfn" href="#concept-attribute-local-name">local name</a> and the result of running the <a data-link-type="dfn" href="#concept-ordered-set-serializer">ordered set serializer</a> for <a data-link-type="dfn" href="#concept-dtl-tokens">tokens</a>. </p> <p>A <code class="idl"><a data-link-type="idl" href="#domtokenlist">DOMTokenList</a></code> object’s <dfn data-dfn-for="DOMTokenList" data-dfn-type="dfn" data-noexport="" id="concept-dtl-serialize">serialize steps<a class="self-link" href="#concept-dtl-serialize"></a></dfn> are to return the result of running <a data-link-type="dfn" href="#concept-element-attributes-get-value">get an attribute value</a> given the associated <a data-link-type="dfn" href="#concept-element">element</a> and the associated <a data-link-type="dfn" href="#concept-attribute">attribute</a>’s <a data-link-type="dfn" href="#concept-attribute-local-name">local name</a>.</p> <hr> - <p>When a <code class="idl"><a data-link-type="idl" href="#domtokenlist">DOMTokenList</a></code> object is created and its associated <a data-link-type="dfn" href="#concept-element">element</a> <a data-link-type="dfn" href="#concept-element-attribute-has">has</a> an <a data-link-type="dfn" href="#concept-named-attribute"><var>associated attribute’s local name</var> attribute</a> or -associated <a data-link-type="dfn" href="#concept-element">element</a>’s <a data-link-type="dfn" href="#concept-named-attribute"><var>associated attribute’s local name</var> attribute</a> is <a data-link-type="dfn" href="#attribute-is-set">set</a>, set <a data-link-type="dfn" href="#concept-dtl-tokens">tokens</a> to the new <a data-link-type="dfn" href="#concept-attribute-value">value</a>, <a data-link-type="dfn" href="#concept-ordered-set-parser">parsed</a>. </p> - <p>When an associated <a data-link-type="dfn" href="#concept-element">element</a>’s <a data-link-type="dfn" href="#concept-named-attribute"><var>associated attribute’s local name</var> attribute</a> is <a data-link-type="dfn" href="#attribute-is-removed">removed</a>, set <a data-link-type="dfn" href="#concept-dtl-tokens">tokens</a> to the empty set. </p> + <p>A <code class="idl"><a data-link-type="idl" href="#domtokenlist">DOMTokenList</a></code> object has these <a data-link-type="dfn" href="#concept-element-attributes-change-ext">attribute change steps</a> for its associated <a data-link-type="dfn" href="#concept-element">element</a>: </p> + <ol> + <li> + <p>If <var>localName</var> is associated attribute’s <a data-link-type="dfn" href="#concept-attribute-local-name">local name</a>, <var>namespace</var> is null, and <var>value</var> is null, then set <a data-link-type="dfn" href="#concept-dtl-tokens">tokens</a> to the empty + set. </p> + <li> + <p>Otherwise, <var>localName</var> is associated attribute’s <a data-link-type="dfn" href="#concept-attribute-local-name">local name</a>, <var>namespace</var> is null, then set <a data-link-type="dfn" href="#concept-dtl-tokens">tokens</a> to <var>value</var>, <a data-link-type="dfn" href="#concept-ordered-set-parser">parsed</a>. </p> + </ol> + <p>When a <code class="idl"><a data-link-type="idl" href="#domtokenlist">DOMTokenList</a></code> object is created, run these substeps: </p> + <ol> + <li> + <p>Let <var>element</var> be associated <a data-link-type="dfn" href="#concept-element">element</a>. </p> + <li> + <p>Let <var>localName</var> be associated attribute’s <a data-link-type="dfn" href="#concept-attribute-local-name">local name</a>. </p> + <li> + <p>Let <var>value</var> be the result of <a data-link-type="dfn" href="#concept-element-attributes-get-by-namespace">getting an attribute</a> given null, <var>localName</var>, and <var>element</var>. </p> + <li> + <p>Run the <a data-link-type="dfn" href="#concept-element-attributes-change-ext">attribute change steps</a> for <var>element</var>, <var>localName</var>, <var>value</var>, <var>value</var>, and null. </p> + </ol> <dl class="domintro"> <dt><code><var>tokenlist</var> . <code class="idl"><a data-link-type="idl" href="#dom-domtokenlist-length">length</a></code></code> <dd> @@ -4634,31 +4935,31 @@ <h3 class="heading settled" data-level="7.1" id="interface-domtokenlist"><span c <dt><code><var>tokenlist</var> . <a data-link-type="functionish" href="#dom-domtokenlist-add">add(<var>tokens</var>…)</a></code> <dd> <p>Adds all arguments passed, except those already present. </p> - <p>Throws a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#syntaxerror">SyntaxError</a></code> exception if one of the arguments is the empty string. </p> - <p>Throws an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code> exception if one of the arguments contains any <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#ascii-whitespace">ASCII whitespace</a>. </p> + <p>Throws a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#syntaxerror">SyntaxError</a></code> if one of the arguments is the empty string. </p> + <p>Throws an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code> if one of the arguments contains any <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#ascii-whitespace">ASCII whitespace</a>. </p> <dt><code><var>tokenlist</var> . <a data-link-type="functionish" href="#dom-domtokenlist-remove">remove(<var>tokens</var>…)</a></code> <dd> <p>Removes arguments passed, if they are present. </p> - <p>Throws a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#syntaxerror">SyntaxError</a></code> exception if one of the arguments is the empty string. </p> - <p>Throws an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code> exception if one of the arguments contains any <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#ascii-whitespace">ASCII whitespace</a>. </p> + <p>Throws a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#syntaxerror">SyntaxError</a></code> if one of the arguments is the empty string. </p> + <p>Throws an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code> if one of the arguments contains any <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#ascii-whitespace">ASCII whitespace</a>. </p> <dt><code><var>tokenlist</var> . <a class="idl-code" data-link-type="method" href="#dom-domtokenlist-toggle">toggle(<var>token</var> [, <var>force</var>])</a></code> <dd> <p>If <var>force</var> is not given, "toggles" <var>token</var>, removing it if it’s present and adding it if it’s not present. If <var>force</var> is true, adds <var>token</var> (same as <code class="idl"><a data-link-type="idl" href="#dom-domtokenlist-add">add()</a></code>). If <var>force</var> is false, removes <var>token</var> (same as <code class="idl"><a data-link-type="idl" href="#dom-domtokenlist-remove">remove()</a></code>). </p> <p>Returns true if <var>token</var> is now present, and false otherwise. </p> - <p>Throws a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#syntaxerror">SyntaxError</a></code> exception if <var>token</var> is empty. </p> - <p>Throws an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code> exception if <var>token</var> contains any spaces. </p> + <p>Throws a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#syntaxerror">SyntaxError</a></code> if <var>token</var> is empty. </p> + <p>Throws an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code> if <var>token</var> contains any spaces. </p> <dt><code><var>tokenlist</var> . <a class="idl-code" data-link-type="method" href="#dom-domtokenlist-replace">replace(<var>token</var>, <var>newToken</var>)</a></code> <dd> <p>Replaces <var>token</var> with <var>newToken</var>. </p> - <p>Throws a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#syntaxerror">SyntaxError</a></code> exception if one of the arguments is the empty string. </p> - <p>Throws an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code> exception if one of the arguments contains any <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#ascii-whitespace">ASCII whitespace</a>. </p> + <p>Throws a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#syntaxerror">SyntaxError</a></code> if one of the arguments is the empty string. </p> + <p>Throws an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code> if one of the arguments contains any <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#ascii-whitespace">ASCII whitespace</a>. </p> <dt><code><var>tokenlist</var> . <a class="idl-code" data-link-type="method" href="#dom-domtokenlist-supports">supports(<var>token</var>)</a></code> <dd> <p>Returns true if <var>token</var> is in the associated attribute’s supported tokens. Returns false otherwise. </p> - <p>Throws a <code>TypeError</code> exception if the associated attribute has no supported tokens defined. </p> + <p>Throws a <code>TypeError</code> if the associated attribute has no supported tokens defined. </p> <dt><code><var>tokenlist</var> . <code class="idl"><a data-link-type="idl" href="#dom-domtokenlist-value">value</a></code></code> <dd> <p>Returns the associated set as string. </p> @@ -4685,9 +4986,9 @@ <h3 class="heading settled" data-level="7.1" id="interface-domtokenlist"><span c <p>For each <var>token</var> in <var>tokens</var>, run these substeps: </p> <ol> <li> - <p>If <var>token</var> is the empty string, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#syntaxerror">SyntaxError</a></code> exception. </p> + <p>If <var>token</var> is the empty string, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#syntaxerror">SyntaxError</a></code>. </p> <li> - <p>If <var>token</var> contains any <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#ascii-whitespace">ASCII whitespace</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code> exception. </p> + <p>If <var>token</var> contains any <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#ascii-whitespace">ASCII whitespace</a>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code>. </p> </ol> <li> <p>For each <var>token</var> in <var>tokens</var>, in given order, that is not in <a data-link-type="dfn" href="#concept-dtl-tokens">tokens</a>, append <var>token</var> to <a data-link-type="dfn" href="#concept-dtl-tokens">tokens</a>. </p> @@ -4700,9 +5001,9 @@ <h3 class="heading settled" data-level="7.1" id="interface-domtokenlist"><span c <p>For each <var>token</var> in <var>tokens</var>, run these substeps: </p> <ol> <li> - <p>If <var>token</var> is the empty string, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#syntaxerror">SyntaxError</a></code> exception. </p> + <p>If <var>token</var> is the empty string, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#syntaxerror">SyntaxError</a></code>. </p> <li> - <p>If <var>token</var> contains any <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#ascii-whitespace">ASCII whitespace</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code> exception. </p> + <p>If <var>token</var> contains any <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#ascii-whitespace">ASCII whitespace</a>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code>. </p> </ol> <li> <p>For each <var>token</var> in <var>tokens</var>, remove <var>token</var> from <a data-link-type="dfn" href="#concept-dtl-tokens">tokens</a>. </p> @@ -4712,9 +5013,9 @@ <h3 class="heading settled" data-level="7.1" id="interface-domtokenlist"><span c <p>The <dfn class="idl-code" data-dfn-for="DOMTokenList" data-dfn-type="method" data-export="" data-lt="toggle(token, force)|toggle(token)" id="dom-domtokenlist-toggle"><code>toggle(<var>token</var>, <var>force</var>)</code><a class="self-link" href="#dom-domtokenlist-toggle"></a></dfn> method, when invoked, must run these steps: </p> <ol> <li> - <p>If <var>token</var> is the empty string, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#syntaxerror">SyntaxError</a></code> exception. </p> + <p>If <var>token</var> is the empty string, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#syntaxerror">SyntaxError</a></code>. </p> <li> - <p>If <var>token</var> contains any <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#ascii-whitespace">ASCII whitespace</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code> exception. </p> + <p>If <var>token</var> contains any <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#ascii-whitespace">ASCII whitespace</a>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code>. </p> <li> <p>If <var>token</var> is in <a data-link-type="dfn" href="#concept-dtl-tokens">tokens</a>, run these substeps: </p> <ol> @@ -4736,9 +5037,9 @@ <h3 class="heading settled" data-level="7.1" id="interface-domtokenlist"><span c <p>The <dfn class="idl-code" data-dfn-for="DOMTokenList" data-dfn-type="method" data-export="" id="dom-domtokenlist-replace"><code>replace(<var>token</var>, <var>newToken</var>)</code><a class="self-link" href="#dom-domtokenlist-replace"></a></dfn> method, when invoked, must run these steps: </p> <ol> <li> - <p>If either <var>token</var> or <var>newToken</var> is the empty string, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#syntaxerror">SyntaxError</a></code> exception. </p> + <p>If either <var>token</var> or <var>newToken</var> is the empty string, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#syntaxerror">SyntaxError</a></code>. </p> <li> - <p>If either <var>token</var> or <var>newToken</var> contains any <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#ascii-whitespace">ASCII whitespace</a>, <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code> exception. </p> + <p>If either <var>token</var> or <var>newToken</var> contains any <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#ascii-whitespace">ASCII whitespace</a>, then <a data-link-type="dfn" href="https://heycam.github.io/webidl/#dfn-throw">throw</a> an <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a></code>. </p> <li> <p>If <var>token</var> is not in <a data-link-type="dfn" href="#concept-dtl-tokens">tokens</a>, terminate these steps. </p> <li> @@ -4778,7 +5079,7 @@ <h3 class="heading settled" data-level="8.1" id="dom-events-changes"><span class </ul> <h3 class="heading settled" data-level="8.2" id="dom-core-changes"><span class="secno">8.2. </span><span class="content">DOM Core</span><a class="self-link" href="#dom-core-changes"></a></h3> <p>These are the changes made to the features described in <cite>DOM Level 3 Core</cite>.</p> - <p><code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-DOMString">DOMString</a></code>, <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#dfn-domexception">DOMException</a></code>, and <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#common-domtimestamp">DOMTimeStamp</a></code> are now defined in Web IDL.</p> + <p><code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-DOMString">DOMString</a></code>, <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#dfn-DOMException">DOMException</a></code>, and <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#common-domtimestamp">DOMTimeStamp</a></code> are now defined in Web IDL.</p> <p><code class="idl"><a data-link-type="idl" href="#node">Node</a></code> now inherits from <code class="idl"><a data-link-type="idl" href="#eventtarget">EventTarget</a></code>.</p> <p><a data-link-type="dfn" href="#concept-node">Nodes</a> are implicitly <a data-link-type="dfn" href="#concept-node-adopt">adopted</a> across <a data-link-type="dfn" href="#concept-document">document</a> boundaries.</p> <p><a data-link-type="dfn" href="#concept-doctype">Doctypes</a> now always have a <a data-link-type="dfn" href="#concept-node-document">node document</a> and can be moved @@ -4898,6 +5199,7 @@ <h2 class="no-num heading settled" id="acks"><span class="content">Acknowledgmen <p>With that, many thanks to Adam Klein, Adrian Bateman, +Aleksey Shvayka, Alex Komoroske, Alex Russell, Anthony Ramine, @@ -4952,6 +5254,7 @@ <h2 class="no-num heading settled" id="acks"><span class="content">Acknowledgmen James Graham, James Greene, James Robinson, +Jeffrey Yasskin, Jens Lindström, Jesse McCarthy, João Eiras, @@ -4997,7 +5300,7 @@ <h2 class="no-num heading settled" id="acks"><span class="content">Acknowledgmen Ryosuke Niwa, Sam Dutton, Samuel Giles, -Sebastian Mayr, <i>senolv</i>, +Sebastian Mayr, Seo Sanghyeon, Sergey G. Grekhov, Shiki Okasaka, @@ -5012,6 +5315,7 @@ <h2 class="no-num heading settled" id="acks"><span class="content">Acknowledgmen Tobie Langel, Tom Pixley, Travis Leithead, <i>triple-underscore</i>, +Veli Şenol, Vidur Apparao, Warren He, Yehuda Katz, @@ -5036,6 +5340,7 @@ <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="c <li><a href="#dom-nodefilter-acceptnode">acceptNode(node)</a><span>, in §6.3</span> <li><a href="#dom-domtokenlist-add">add()</a><span>, in §7.1</span> <li><a href="#dom-mutationrecord-addednodes">addedNodes</a><span>, in §4.3.3</span> + <li><a href="#dictdef-addeventlisteneroptions">AddEventListenerOptions</a><span>, in §3.6</span> <li><a href="#dom-eventtarget-addeventlistener">addEventListener(type, callback)</a><span>, in §3.6</span> <li><a href="#dom-eventtarget-addeventlistener">addEventListener(type, callback, options)</a><span>, in §3.6</span> <li><a href="#dom-domtokenlist-add">add(tokens)</a><span>, in §7.1</span> @@ -5054,16 +5359,19 @@ <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="c <li><a href="#dom-parentnode-append">append(nodes...)</a><span>, in §4.2.6</span> <li><a href="#ascii-case-insensitive">ASCII case-insensitive</a><span>, in §2.2</span> <li><a href="#ascii-case-insensitive">ASCII case-insensitively</a><span>, in §2.2</span> + <li><a href="#assign-a-slot">assign a slot</a><span>, in §4.2.2.4</span> + <li><a href="#slotable-assigned">assigned</a><span>, in §4.2.2.2</span> + <li><a href="#slot-assigned-nodes">assigned nodes</a><span>, in §4.2.2.1</span> + <li><a href="#slotable-assigned-slot">assigned slot</a><span>, in §4.2.2.2</span> <li><a href="#dom-slotable-assignedslot">assignedSlot</a><span>, in §4.2.9</span> + <li><a href="#assign-slotables">assign slotables</a><span>, in §4.2.2.4</span> + <li><a href="#assign-slotables-for-a-tree">assign slotables for a tree</a><span>, in §4.2.2.4</span> <li><a href="#dom-element-attachshadow">attachShadow(init)</a><span>, in §4.9</span> <li><a href="#dom-event-at_target">AT_TARGET</a><span>, in §3.2</span> <li><a href="#attr">Attr</a><span>, in §4.9.2</span> <li><a href="#concept-attribute">attribute</a><span>, in §4.9.2</span> + <li><a href="#concept-element-attributes-change-ext">attribute change steps</a><span>, in §4.9</span> <li><a href="#dom-mutationobserverinit-attributefilter">attributeFilter</a><span>, in §4.3.1</span> - <li><a href="#attribute-is-added">attribute is added</a><span>, in §4.9</span> - <li><a href="#attribute-is-changed">attribute is changed</a><span>, in §4.9</span> - <li><a href="#attribute-is-removed">attribute is removed</a><span>, in §4.9</span> - <li><a href="#attribute-is-set">attribute is set</a><span>, in §4.9</span> <li> attribute list <ul> @@ -5230,9 +5538,9 @@ <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="c <li><a href="#dom-document-doctype">attribute for Document</a><span>, in §4.5</span> <li><a href="#concept-doctype">definition of</a><span>, in §4.6</span> </ul> - <li><a href="#dom-document-document">Document()</a><span>, in §4.5</span> <li><a href="#document">Document</a><span>, in §4.5</span> <li><a href="#concept-document">document</a><span>, in §4.5</span> + <li><a href="#dom-document-document">Document()</a><span>, in §4.5</span> <li><a href="#dom-document-documentelement">documentElement</a><span>, in §4.5</span> <li><a href="#document-element">document element</a><span>, in §4.2.1</span> <li><a href="#documentfragment">DocumentFragment</a><span>, in §4.7</span> @@ -5316,7 +5624,10 @@ <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="c <li><a href="#dom-nodefilter-filter_reject">FILTER_REJECT</a><span>, in §6.3</span> <li><a href="#dom-nodefilter-filter_skip">FILTER_SKIP</a><span>, in §6.3</span> <li><a href="#find-a-slot">find a slot</a><span>, in §4.2.2.3</span> - <li><a href="#find-distributed-slotables">find distributed slotables</a><span>, in §4.2.2.3</span> + <li><a href="#find-flattened-slotables">find flattened slotables</a><span>, in §4.2.2.3</span> + <li><a href="#find-a-slot">finding a slot</a><span>, in §4.2.2.3</span> + <li><a href="#find-flattened-slotables">finding flattened slotables</a><span>, in §4.2.2.3</span> + <li><a href="#find-slotables">finding slotables</a><span>, in §4.2.2.3</span> <li><a href="#find-slotables">find slotables</a><span>, in §4.2.2.3</span> <li><a href="#concept-event-fire">fire an event</a><span>, in §3.9</span> <li><a href="#dom-treewalker-firstchild">firstChild()</a><span>, in §6.2</span> @@ -5324,6 +5635,7 @@ <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="c <li><a href="#concept-tree-first-child">first child</a><span>, in §2.1</span> <li><a href="#dom-parentnode-firstelementchild">firstElementChild</a><span>, in §4.2.6</span> <li><a href="#concept-flatten-options">flatten</a><span>, in §3.6</span> + <li><a href="#event-flatten-more">flatten more</a><span>, in §3.6</span> <li><a href="#concept-tree-following">following</a><span>, in §2.1</span> <li><a href="#concept-element-attributes-get-by-name">get an attribute by name</a><span>, in §4.9</span> <li><a href="#concept-element-attributes-get-by-namespace">get an attribute by namespace and local name</a><span>, in §4.9</span> @@ -5358,7 +5670,6 @@ <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="c <li><a href="#dom-node-getfeature">method for Node</a><span>, in §8.2</span> <li><a href="#dom-domimplementation-getfeature">method for DOMImplementation</a><span>, in §8.2</span> </ul> - <li><a href="#slotable-get-name">get name</a><span>, in §4.2.2.2</span> <li><a href="#dom-namednodemap-getnameditemns">getNamedItemNS(namespace, localName)</a><span>, in §4.9.1</span> <li><a href="#dom-namednodemap-getnameditem">getNamedItem(qualifiedName)</a><span>, in §4.9.1</span> <li><a href="#get-the-parent">get the parent</a><span>, in §3.6</span> @@ -5500,6 +5811,7 @@ <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="c name <ul> <li><a href="#slot-name">dfn for slot</a><span>, in §4.2.2.1</span> + <li><a href="#slotable-name">dfn for slotable</a><span>, in §4.2.2.2</span> <li><a href="#concept-doctype-name">dfn for DocumentType</a><span>, in §4.6</span> <li><a href="#dom-documenttype-name">attribute for DocumentType</a><span>, in §4.6</span> <li><a href="#dom-attr-name">attribute for Attr</a><span>, in §4.9.2</span> @@ -5576,6 +5888,7 @@ <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="c <li><a href="#dom-mutationobserver-observe">observe(target, options)</a><span>, in §4.3.1</span> <li><a href="#concept-range-bp-offset">offset</a><span>, in §5.2</span> <li><a href="#dom-mutationrecord-oldvalue">oldValue</a><span>, in §4.3.3</span> + <li><a href="#dom-addeventlisteneroptions-once">once</a><span>, in §3.6</span> <li><a href="#dom-shadowrootmode-open">"open"</a><span>, in §4.8</span> <li><a href="#concept-ordered-set-parser">ordered set parser</a><span>, in §2.3</span> <li><a href="#concept-ordered-set-serializer">ordered set serializer</a><span>, in §2.3</span> @@ -5591,7 +5904,9 @@ <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="c <li><a href="#dom-treewalker-parentnode">parentNode()</a><span>, in §6.2</span> <li><a href="#partially-contained">partially contained</a><span>, in §5.2</span> <li><a href="#concept-tree-participate">participate</a><span>, in §2.1</span> - <li><a href="#dom-eventlisteneroptions-passive">passive</a><span>, in §3.6</span> + <li><a href="#concept-tree-participate">participate in a tree</a><span>, in §2.1</span> + <li><a href="#concept-tree-participate">participates in a tree</a><span>, in §2.1</span> + <li><a href="#dom-addeventlisteneroptions-passive">passive</a><span>, in §3.6</span> <li><a href="#dom-nodeiterator-pointerbeforereferencenode">pointerBeforeReferenceNode</a><span>, in §6.1</span> <li><a href="#concept-range-bp-position">position</a><span>, in §5.2</span> <li><a href="#concept-tree-preceding">preceding</a><span>, in §2.1</span> @@ -5715,7 +6030,10 @@ <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="c <li><a href="#concept-range-bp-set">set the end</a><span>, in §5.2</span> <li><a href="#concept-range-bp-set">set the start</a><span>, in §5.2</span> <li><a href="#dom-node-setuserdata">setUserData()</a><span>, in §8.2</span> + <li><a href="#element-shadow-host">shadow host</a><span>, in §4.9</span> + <li><a href="#concept-shadow-including-ancestor">shadow-including ancestor</a><span>, in §4.8</span> <li><a href="#concept-shadow-including-descendant">shadow-including descendant</a><span>, in §4.8</span> + <li><a href="#concept-shadow-including-inclusive-ancestor">shadow-including inclusive ancestor</a><span>, in §4.8</span> <li><a href="#concept-shadow-including-inclusive-descendant">shadow-including inclusive descendant</a><span>, in §4.8</span> <li><a href="#shadow-including-preorder-depth-first-traversal">shadow-including preorder, depth-first traversal</a><span>, in §4.8</span> <li><a href="#concept-shadow-including-root">shadow-including root</a><span>, in §4.8</span> @@ -5745,6 +6063,8 @@ <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="c <li><a href="#dom-nodefilter-show_processing_instruction">SHOW_PROCESSING_INSTRUCTION</a><span>, in §6.3</span> <li><a href="#dom-nodefilter-show_text">SHOW_TEXT</a><span>, in §6.3</span> <li><a href="#concept-tree-sibling">sibling</a><span>, in §2.1</span> + <li><a href="#signal-a-slot-change">signal a slot change</a><span>, in §4.2.2.5</span> + <li><a href="#signal-slot-list">signal slot list</a><span>, in §4.2.2.5</span> <li><a href="#skip-ascii-whitespace">skip ASCII whitespace</a><span>, in §2.3</span> <li> slot @@ -5782,6 +6102,7 @@ <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="c <li><a href="#concept-supported-tokens">supported tokens</a><span>, in §7.1</span> <li><a href="#dom-domtokenlist-supports">supports(token)</a><span>, in §7.1</span> <li><a href="#dom-range-surroundcontents">surroundContents(newParent)</a><span>, in §5.2</span> + <li><a href="#svg-namespace">SVG namespace</a><span>, in §2.5</span> <li><a href="#concept-doctype-systemid">system ID</a><span>, in §4.6</span> <li><a href="#dom-documenttype-systemid">systemId</a><span>, in §4.6</span> <li><a href="#dom-element-tagname">tagName</a><span>, in §4.9</span> @@ -5864,7 +6185,16 @@ <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span cla <a data-link-type="biblio">[ECMASCRIPT]</a> defines the following terms: <ul> <li><a href="https://tc39.github.io/ecma262/#sec-construct">Construct</a> - <li><a href="https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror">TypeError</a> + </ul> + <li> + <a data-link-type="biblio">[css-animations-1]</a> defines the following terms: + <ul> + <li><a href="https://drafts.csswg.org/css-animations-1/#animationevent">AnimationEvent</a> + </ul> + <li> + <a data-link-type="biblio">[css-transitions-1]</a> defines the following terms: + <ul> + <li><a href="https://drafts.csswg.org/css-transitions-1/#Events-TransitionEvent">TransitionEvent</a> </ul> <li> <a data-link-type="biblio">[CSSOM-VIEW]</a> defines the following terms: @@ -5875,20 +6205,42 @@ <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span cla <li> <a data-link-type="biblio">[HTML]</a> defines the following terms: <ul> + <li><a href="https://html.spec.whatwg.org/multipage/scripting.html#selector-defined">:defined</a> + <li><a href="https://html.spec.whatwg.org/multipage/browsers.html#beforeunloadevent">BeforeUnloadEvent</a> + <li><a href="https://html.spec.whatwg.org/multipage/comms.html#closeevent">CloseEvent</a> + <li><a href="https://html.spec.whatwg.org/multipage/interaction.html#dragevent">DragEvent</a> + <li><a href="https://html.spec.whatwg.org/multipage/webappapis.html#errorevent">ErrorEvent</a> <li><a href="https://html.spec.whatwg.org/multipage/dom.html#htmlelement">HTMLElement</a> <li><a href="https://html.spec.whatwg.org/multipage/semantics.html#htmlhtmlelement">HTMLHtmlElement</a> + <li><a href="https://html.spec.whatwg.org/multipage/scripting.html#htmlslotelement">HTMLSlotElement</a> + <li><a href="https://html.spec.whatwg.org/multipage/browsers.html#hashchangeevent">HashChangeEvent</a> <li><a href="https://html.spec.whatwg.org/multipage/comms.html#messageevent">MessageEvent</a> + <li><a href="https://html.spec.whatwg.org/multipage/browsers.html#pagetransitionevent">PageTransitionEvent</a> + <li><a href="https://html.spec.whatwg.org/multipage/browsers.html#popstateevent">PopStateEvent</a> + <li><a href="https://html.spec.whatwg.org/multipage/webstorage.html#storageevent">StorageEvent</a> + <li><a href="https://html.spec.whatwg.org/multipage/embedded-content.html#trackevent">TrackEvent</a> <li><a href="https://html.spec.whatwg.org/multipage/browsers.html#window">Window</a> <li><a href="https://html.spec.whatwg.org/multipage/semantics.html#the-body-element">body</a> + <li><a href="https://html.spec.whatwg.org/multipage/scripting.html#concept-custom-element-definition-constructor">constructor</a> + <li><a href="https://html.spec.whatwg.org/multipage/scripting.html#customized-built-in-element">customized built-in element</a> + <li><a href="https://html.spec.whatwg.org/multipage/scripting.html#enqueue-a-custom-element-callback-reaction">enqueue a custom element callback reaction</a> + <li><a href="https://html.spec.whatwg.org/multipage/scripting.html#enqueue-a-custom-element-upgrade-reaction">enqueue a custom element upgrade reaction</a> <li><a href="https://html.spec.whatwg.org/multipage/semantics.html#the-head-element">head</a> <li><a href="https://html.spec.whatwg.org/multipage/semantics.html#the-html-element">html</a> <li><a href="https://html.spec.whatwg.org/multipage/forms.html#the-input-element">input</a> <li><a href="https://html.spec.whatwg.org/multipage/dom.html#dom-xmldocument-load">load(url)</a> + <li><a href="https://html.spec.whatwg.org/multipage/scripting.html#concept-custom-element-definition-local-name">local name</a> + <li><a href="https://html.spec.whatwg.org/multipage/scripting.html#look-up-a-custom-element-definition">look up a custom element definition</a> + <li><a href="https://html.spec.whatwg.org/multipage/scripting.html#concept-custom-element-definition-name">name</a> <li><a href="https://html.spec.whatwg.org/multipage/browsers.html#concept-origin-opaque">opaque origin</a> <li><a href="https://html.spec.whatwg.org/multipage/scripting.html#script">script</a> + <li><a href="https://html.spec.whatwg.org/multipage/scripting.html#the-slot-element">slot</a> <li><a href="https://html.spec.whatwg.org/multipage/scripting.html#the-template-element">template</a> <li><a href="https://html.spec.whatwg.org/multipage/semantics.html#the-title-element">title</a> + <li><a href="https://html.spec.whatwg.org/multipage/scripting.html#concept-try-upgrade">try to upgrade an element</a> <li><a href="https://html.spec.whatwg.org/multipage/browsers.html#unicode-serialisation-of-an-origin">unicode serialisation of an origin</a> + <li><a href="https://html.spec.whatwg.org/multipage/scripting.html#concept-upgrade-an-element">upgrade an element</a> + <li><a href="https://html.spec.whatwg.org/multipage/scripting.html#valid-custom-element-name">valid custom element name</a> </ul> <li> <a data-link-type="biblio">[selectors-4]</a> defines the following terms: @@ -5901,6 +6253,11 @@ <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span cla <li><a href="https://drafts.csswg.org/selectors-4/#scope-filtered">scope-filtered</a> <li><a href="https://drafts.csswg.org/selectors-4/#scoping-root">scoping root</a> </ul> + <li> + <a data-link-type="biblio">[SVG]</a> defines the following terms: + <ul> + <li><a href="https://www.w3.org/TR/SVG/script.html#InterfaceSVGZoomEvent">SVGZoomEvent</a> + </ul> <li> <a data-link-type="biblio">[URL]</a> defines the following terms: <ul> @@ -5910,12 +6267,34 @@ <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span cla <li> <a data-link-type="biblio">[WEBIDL]</a> defines the following terms: <ul> + <li><a href="https://heycam.github.io/webidl/#dfn-DOMException">DOMException</a> <li><a href="https://heycam.github.io/webidl/#idl-DOMString">DOMString</a> + <li><a href="https://heycam.github.io/webidl/#hierarchyrequesterror">HierarchyRequestError</a> + <li><a href="https://heycam.github.io/webidl/#inuseattributeerror">InUseAttributeError</a> + <li><a href="https://heycam.github.io/webidl/#indexsizeerror">IndexSizeError</a> + <li><a href="https://heycam.github.io/webidl/#invalidcharactererror">InvalidCharacterError</a> + <li><a href="https://heycam.github.io/webidl/#invalidnodetypeerror">InvalidNodeTypeError</a> + <li><a href="https://heycam.github.io/webidl/#invalidstateerror">InvalidStateError</a> + <li><a href="https://heycam.github.io/webidl/#namespaceerror">NamespaceError</a> + <li><a href="https://heycam.github.io/webidl/#notfounderror">NotFoundError</a> + <li><a href="https://heycam.github.io/webidl/#notsupportederror">NotSupportedError</a> + <li><a href="https://heycam.github.io/webidl/#syntaxerror">SyntaxError</a> + <li><a href="https://heycam.github.io/webidl/#wrongdocumenterror">WrongDocumentError</a> </ul> </ul> <h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2> <h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3> <dl> + <dt id="biblio-css-animations-1">[CSS-ANIMATIONS-1] + <dd>CSS Animations Module Level 1 URL: <a href="https://drafts.csswg.org/css-animations-1/">https://drafts.csswg.org/css-animations-1/</a> + <dt id="biblio-css-transitions-1">[CSS-TRANSITIONS-1] + <dd>CSS Transitions Module Level 1 URL: <a href="https://drafts.csswg.org/css-transitions-1/">https://drafts.csswg.org/css-transitions-1/</a> + <dt id="biblio-css3-animations">[CSS3-ANIMATIONS] + <dd>Dean Jackson; et al. <a href="http://www.w3.org/TR/css3-animations/">CSS Animations</a>. 19 February 2013. WD. URL: <a href="http://www.w3.org/TR/css3-animations/">http://www.w3.org/TR/css3-animations/</a> + <dt id="biblio-css3-transitions">[CSS3-TRANSITIONS] + <dd>Dean Jackson; et al. <a href="http://dev.w3.org/csswg/css-transitions/">CSS Transitions</a>. 19 November 2013. WD. URL: <a href="http://dev.w3.org/csswg/css-transitions/">http://dev.w3.org/csswg/css-transitions/</a> + <dt id="biblio-device-orientation">[DEVICE-ORIENTATION] + <dd>Stephen Block; Andrei Popescu. <a href="http://www.w3.org/TR/orientation-event/">DeviceOrientation Event Specification</a>. 1 December 2011. LCWD. URL: <a href="http://www.w3.org/TR/orientation-event/">http://www.w3.org/TR/orientation-event/</a> <dt id="biblio-ecmascript">[ECMASCRIPT] <dd><a href="https://tc39.github.io/ecma262/">ECMAScript Language Specification</a>. URL: <a href="https://tc39.github.io/ecma262/">https://tc39.github.io/ecma262/</a> <dt id="biblio-encoding">[ENCODING] @@ -5930,14 +6309,20 @@ <h3 class="no-num no-ref heading settled" id="normative"><span class="content">N <dd>Elika Etemad; Tab Atkins Jr.. <a href="http://www.w3.org/TR/selectors4/">Selectors Level 4</a>. 2 May 2013. WD. URL: <a href="http://www.w3.org/TR/selectors4/">http://www.w3.org/TR/selectors4/</a> <dt id="biblio-service-workers">[SERVICE-WORKERS] <dd>Alex Russell; Jungkee Song; Jake Archibald. <a href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/">Service Workers</a>. 25 June 2015. WD. URL: <a href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/">https://slightlyoff.github.io/ServiceWorker/spec/service_worker/</a> + <dt id="biblio-svg">[SVG] + <dd>Jon Ferraiolo. <a href="http://www.w3.org/TR/SVG/">Scalable Vector Graphics (SVG) 1.0 Specification</a>. 4 September 2001. REC. URL: <a href="http://www.w3.org/TR/SVG/">http://www.w3.org/TR/SVG/</a> <dt id="biblio-touch-events">[TOUCH-EVENTS] <dd>Doug Schepers; et al. <a href="http://dvcs.w3.org/hg/webevents/raw-file/v1/touchevents.html">Touch Events</a>. 10 October 2013. REC. URL: <a href="http://dvcs.w3.org/hg/webevents/raw-file/v1/touchevents.html">http://dvcs.w3.org/hg/webevents/raw-file/v1/touchevents.html</a> <dt id="biblio-uievents">[UIEVENTS] <dd>Gary Kacmarcik; Travis Leithead. <a href="https://w3c.github.io/uievents/">UI Events Specification</a>. 15 December 2015. WD. URL: <a href="https://w3c.github.io/uievents/">https://w3c.github.io/uievents/</a> <dt id="biblio-url">[URL] <dd>Anne van Kesteren; Sam Ruby. <a href="https://url.spec.whatwg.org/">URL Standard</a>. Living Standard. URL: <a href="https://url.spec.whatwg.org/">https://url.spec.whatwg.org/</a> + <dt id="biblio-webgl">[WEBGL] + <dd>Chris Marrin (Apple Inc.). <a href="https://www.khronos.org/registry/webgl/specs/1.0/">WebGL Specification, Version 1.0</a>. 10 February 2011. URL: <a href="https://www.khronos.org/registry/webgl/specs/1.0/">https://www.khronos.org/registry/webgl/specs/1.0/</a> <dt id="biblio-webidl">[WEBIDL] <dd>Cameron McCormack; Boris Zbarsky. <a href="https://heycam.github.io/webidl/">WebIDL Level 1</a>. 8 March 2016. CR. URL: <a href="https://heycam.github.io/webidl/">https://heycam.github.io/webidl/</a> + <dt id="biblio-xhr">[XHR] + <dd>Anne van Kesteren. <a href="https://xhr.spec.whatwg.org/">XMLHttpRequest Standard</a>. Living Standard. URL: <a href="https://xhr.spec.whatwg.org/">https://xhr.spec.whatwg.org/</a> <dt id="biblio-xml">[XML] <dd>Tim Bray; et al. <a href="http://www.w3.org/TR/xml">Extensible Markup Language (XML) 1.0 (Fifth Edition)</a>. 26 November 2008. REC. URL: <a href="http://www.w3.org/TR/xml">http://www.w3.org/TR/xml</a> <dt id="biblio-xml-names">[XML-NAMES] @@ -5955,6 +6340,8 @@ <h3 class="no-num no-ref heading settled" id="informative"><span class="content" <dd>Travis Leithead. <a href="https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html">DOM Parsing and Serialization</a>. 17 June 2014. CR. URL: <a href="https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html">https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html</a> <dt id="biblio-elementtraversal">[ELEMENTTRAVERSAL] <dd>Doug Schepers; Robin Berjon. <a href="http://www.w3.org/TR/ElementTraversal/">Element Traversal Specification</a>. 22 December 2008. REC. URL: <a href="http://www.w3.org/TR/ElementTraversal/">http://www.w3.org/TR/ElementTraversal/</a> + <dt id="biblio-indexeddb">[INDEXEDDB] + <dd>Nikunj Mehta; et al. <a href="http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html">Indexed Database API</a>. 8 January 2015. REC. URL: <a href="http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html">http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html</a> <dt id="biblio-selectors-api2">[SELECTORS-API2] <dd>Lachlan Hunt. <a href="http://dev.w3.org/2006/webapi/selectors-api2/">Selectors API Level 2</a>. 17 October 2013. NOTE. URL: <a href="http://dev.w3.org/2006/webapi/selectors-api2/">http://dev.w3.org/2006/webapi/selectors-api2/</a> <dt id="biblio-uievents-20031107">[UIEVENTS-20031107] @@ -6007,7 +6394,7 @@ <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">I [Exposed=(Window,Worker)] interface <a href="#eventtarget">EventTarget</a> { - void <a class="idl-code" data-link-type="method" href="#dom-eventtarget-addeventlistener">addEventListener</a>(DOMString <a href="#dom-eventtarget-addeventlistener-type-callback-options-type">type</a>, <a data-link-type="idl-name" href="#callbackdef-eventlistener">EventListener</a>? callback, optional (<a data-link-type="idl-name" href="#dictdef-eventlisteneroptions">EventListenerOptions</a> or boolean) <a href="#dom-eventtarget-addeventlistener-type-callback-options-options">options</a>); + void <a class="idl-code" data-link-type="method" href="#dom-eventtarget-addeventlistener">addEventListener</a>(DOMString <a href="#dom-eventtarget-addeventlistener-type-callback-options-type">type</a>, <a data-link-type="idl-name" href="#callbackdef-eventlistener">EventListener</a>? callback, optional (<a data-link-type="idl-name" href="#dictdef-addeventlisteneroptions">AddEventListenerOptions</a> or boolean) <a href="#dom-eventtarget-addeventlistener-type-callback-options-options">options</a>); void <a class="idl-code" data-link-type="method" href="#dom-eventtarget-removeeventlistener">removeEventListener</a>(DOMString <a href="#dom-eventtarget-removeeventlistener-type-callback-options-type">type</a>, <a data-link-type="idl-name" href="#callbackdef-eventlistener">EventListener</a>? callback, optional (<a data-link-type="idl-name" href="#dictdef-eventlisteneroptions">EventListenerOptions</a> or boolean) <a href="#dom-eventtarget-removeeventlistener-type-callback-options-options">options</a>); boolean <a class="idl-code" data-link-type="method" href="#dom-eventtarget-dispatchevent">dispatchEvent</a>(<a data-link-type="idl-name" href="#event">Event</a> <a href="#dom-eventtarget-dispatchevent-event-event">event</a>); }; @@ -6017,8 +6404,12 @@ <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">I }; dictionary <a href="#dictdef-eventlisteneroptions">EventListenerOptions</a> { - boolean <a data-type="boolean " href="#dom-eventlisteneroptions-capture">capture</a>; - boolean <a data-type="boolean " href="#dom-eventlisteneroptions-passive">passive</a>; + boolean <a data-default="false" data-type="boolean " href="#dom-eventlisteneroptions-capture">capture</a> = false; +}; + +dictionary <a href="#dictdef-addeventlisteneroptions">AddEventListenerOptions</a> : <a data-link-type="idl-name" href="#dictdef-eventlisteneroptions">EventListenerOptions</a> { + boolean <a data-default="false" data-type="boolean " href="#dom-addeventlisteneroptions-passive">passive</a> = false; + boolean <a data-default="false" data-type="boolean " href="#dom-addeventlisteneroptions-once">once</a> = false; }; [NoInterfaceObject, @@ -6044,8 +6435,8 @@ <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">I readonly attribute <a data-link-type="idl-name" href="#element">Element</a>? <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="Element? " href="#dom-parentnode-lastelementchild">lastElementChild</a>; readonly attribute unsigned long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="unsigned long " href="#dom-parentnode-childelementcount">childElementCount</a>; - [Unscopable] void <a class="idl-code" data-link-type="method" href="#dom-parentnode-prepend">prepend</a>((<a data-link-type="idl-name" href="#node">Node</a> or DOMString)... <a href="#dom-parentnode-prepend-nodes-nodes">nodes</a>); - [Unscopable] void <a class="idl-code" data-link-type="method" href="#dom-parentnode-append">append</a>((<a data-link-type="idl-name" href="#node">Node</a> or DOMString)... <a href="#dom-parentnode-append-nodes-nodes">nodes</a>); + [CEReactions, Unscopable] void <a class="idl-code" data-link-type="method" href="#dom-parentnode-prepend">prepend</a>((<a data-link-type="idl-name" href="#node">Node</a> or DOMString)... <a href="#dom-parentnode-prepend-nodes-nodes">nodes</a>); + [CEReactions, Unscopable] void <a class="idl-code" data-link-type="method" href="#dom-parentnode-append">append</a>((<a data-link-type="idl-name" href="#node">Node</a> or DOMString)... <a href="#dom-parentnode-append-nodes-nodes">nodes</a>); <a data-link-type="idl-name" href="#element">Element</a>? <a class="idl-code" data-link-type="method" href="#dom-parentnode-queryselector">querySelector</a>(DOMString <a href="#dom-parentnode-queryselector-selectors-selectors">selectors</a>); [NewObject] <a data-link-type="idl-name" href="#nodelist">NodeList</a> <a class="idl-code" data-link-type="method" href="#dom-parentnode-queryselectorall">querySelectorAll</a>(DOMString <a href="#dom-parentnode-queryselectorall-selectors-selectors">selectors</a>); @@ -6066,10 +6457,10 @@ <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">I [NoInterfaceObject, Exposed=Window] interface <a href="#childnode">ChildNode</a> { - [Unscopable] void <a class="idl-code" data-link-type="method" href="#dom-childnode-before">before</a>((<a data-link-type="idl-name" href="#node">Node</a> or DOMString)... <a href="#dom-childnode-before-nodes-nodes">nodes</a>); - [Unscopable] void <a class="idl-code" data-link-type="method" href="#dom-childnode-after">after</a>((<a data-link-type="idl-name" href="#node">Node</a> or DOMString)... <a href="#dom-childnode-after-nodes-nodes">nodes</a>); - [Unscopable] void <a class="idl-code" data-link-type="method" href="#dom-childnode-replacewith">replaceWith</a>((<a data-link-type="idl-name" href="#node">Node</a> or DOMString)... <a href="#dom-childnode-replacewith-nodes-nodes">nodes</a>); - [Unscopable] void <a class="idl-code" data-link-type="method" href="#dom-childnode-remove">remove</a>(); + [CEReactions, Unscopable] void <a class="idl-code" data-link-type="method" href="#dom-childnode-before">before</a>((<a data-link-type="idl-name" href="#node">Node</a> or DOMString)... <a href="#dom-childnode-before-nodes-nodes">nodes</a>); + [CEReactions, Unscopable] void <a class="idl-code" data-link-type="method" href="#dom-childnode-after">after</a>((<a data-link-type="idl-name" href="#node">Node</a> or DOMString)... <a href="#dom-childnode-after-nodes-nodes">nodes</a>); + [CEReactions, Unscopable] void <a class="idl-code" data-link-type="method" href="#dom-childnode-replacewith">replaceWith</a>((<a data-link-type="idl-name" href="#node">Node</a> or DOMString)... <a href="#dom-childnode-replacewith-nodes-nodes">nodes</a>); + [CEReactions, Unscopable] void <a class="idl-code" data-link-type="method" href="#dom-childnode-remove">remove</a>(); }; <a data-link-type="idl-name" href="#documenttype">DocumentType</a> implements <a data-link-type="idl-name" href="#childnode">ChildNode</a>; <a data-link-type="idl-name" href="#element">Element</a> implements <a data-link-type="idl-name" href="#childnode">ChildNode</a>; @@ -6078,7 +6469,7 @@ <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">I [NoInterfaceObject, Exposed=Window] interface <a href="#slotable">Slotable</a> { - readonly attribute <a data-link-type="idl-name">HTMLSlotElement</a>? <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="HTMLSlotElement? " href="#dom-slotable-assignedslot">assignedSlot</a>; + readonly attribute <a data-link-type="idl-name" href="https://html.spec.whatwg.org/multipage/scripting.html#htmlslotelement">HTMLSlotElement</a>? <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="HTMLSlotElement? " href="#dom-slotable-assignedslot">assignedSlot</a>; }; <a data-link-type="idl-name" href="#element">Element</a> implements <a data-link-type="idl-name" href="#slotable">Slotable</a>; <a data-link-type="idl-name" href="#text">Text</a> implements <a data-link-type="idl-name" href="#slotable">Slotable</a>; @@ -6160,11 +6551,11 @@ <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">I readonly attribute <a data-link-type="idl-name" href="#node">Node</a>? <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="Node? " href="#dom-node-previoussibling">previousSibling</a>; readonly attribute <a data-link-type="idl-name" href="#node">Node</a>? <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="Node? " href="#dom-node-nextsibling">nextSibling</a>; - attribute DOMString? <a class="idl-code" data-link-type="attribute" data-type="DOMString? " href="#dom-node-nodevalue">nodeValue</a>; - attribute DOMString? <a class="idl-code" data-link-type="attribute" data-type="DOMString? " href="#dom-node-textcontent">textContent</a>; - void <a class="idl-code" data-link-type="method" href="#dom-node-normalize">normalize</a>(); + [CEReactions] attribute DOMString? <a class="idl-code" data-link-type="attribute" data-type="DOMString? " href="#dom-node-nodevalue">nodeValue</a>; + [CEReactions] attribute DOMString? <a class="idl-code" data-link-type="attribute" data-type="DOMString? " href="#dom-node-textcontent">textContent</a>; + [CEReactions] void <a class="idl-code" data-link-type="method" href="#dom-node-normalize">normalize</a>(); - [NewObject] <a data-link-type="idl-name" href="#node">Node</a> <a class="idl-code" data-link-type="method" href="#dom-node-clonenode">cloneNode</a>(optional boolean <a href="#dom-node-clonenode-deep-deep">deep</a> = false); + [CEReactions, NewObject] <a data-link-type="idl-name" href="#node">Node</a> <a class="idl-code" data-link-type="method" href="#dom-node-clonenode">cloneNode</a>(optional boolean <a href="#dom-node-clonenode-deep-deep">deep</a> = false); boolean <a class="idl-code" data-link-type="method" href="#dom-node-isequalnode">isEqualNode</a>(<a data-link-type="idl-name" href="#node">Node</a>? <a href="#dom-node-isequalnode-othernode-othernode">otherNode</a>); boolean <a class="idl-code" data-link-type="method" href="#dom-node-issamenode">isSameNode</a>(<a data-link-type="idl-name" href="#node">Node</a>? <a href="#dom-node-issamenode-othernode-othernode">otherNode</a>); // historical alias of === @@ -6181,10 +6572,10 @@ <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">I DOMString? <a class="idl-code" data-link-type="method" href="#dom-node-lookupnamespaceuri">lookupNamespaceURI</a>(DOMString? <a href="#dom-node-lookupnamespaceuri-prefix-prefix">prefix</a>); boolean <a class="idl-code" data-link-type="method" href="#dom-node-isdefaultnamespace">isDefaultNamespace</a>(DOMString? <a href="#dom-node-isdefaultnamespace-namespace-namespace">namespace</a>); - <a data-link-type="idl-name" href="#node">Node</a> <a class="idl-code" data-link-type="method" href="#dom-node-insertbefore">insertBefore</a>(<a data-link-type="idl-name" href="#node">Node</a> <a href="#dom-node-insertbefore-node-child-node">node</a>, <a data-link-type="idl-name" href="#node">Node</a>? <a href="#dom-node-insertbefore-node-child-child">child</a>); - <a data-link-type="idl-name" href="#node">Node</a> <a class="idl-code" data-link-type="method" href="#dom-node-appendchild">appendChild</a>(<a data-link-type="idl-name" href="#node">Node</a> <a href="#dom-node-appendchild-node-node">node</a>); - <a data-link-type="idl-name" href="#node">Node</a> <a class="idl-code" data-link-type="method" href="#dom-node-replacechild">replaceChild</a>(<a data-link-type="idl-name" href="#node">Node</a> <a href="#dom-node-replacechild-node-child-node">node</a>, <a data-link-type="idl-name" href="#node">Node</a> <a href="#dom-node-replacechild-node-child-child">child</a>); - <a data-link-type="idl-name" href="#node">Node</a> <a class="idl-code" data-link-type="method" href="#dom-node-removechild">removeChild</a>(<a data-link-type="idl-name" href="#node">Node</a> <a href="#dom-node-removechild-child-child">child</a>); + [CEReactions] <a data-link-type="idl-name" href="#node">Node</a> <a class="idl-code" data-link-type="method" href="#dom-node-insertbefore">insertBefore</a>(<a data-link-type="idl-name" href="#node">Node</a> <a href="#dom-node-insertbefore-node-child-node">node</a>, <a data-link-type="idl-name" href="#node">Node</a>? <a href="#dom-node-insertbefore-node-child-child">child</a>); + [CEReactions] <a data-link-type="idl-name" href="#node">Node</a> <a class="idl-code" data-link-type="method" href="#dom-node-appendchild">appendChild</a>(<a data-link-type="idl-name" href="#node">Node</a> <a href="#dom-node-appendchild-node-node">node</a>); + [CEReactions] <a data-link-type="idl-name" href="#node">Node</a> <a class="idl-code" data-link-type="method" href="#dom-node-replacechild">replaceChild</a>(<a data-link-type="idl-name" href="#node">Node</a> <a href="#dom-node-replacechild-node-child-node">node</a>, <a data-link-type="idl-name" href="#node">Node</a> <a href="#dom-node-replacechild-node-child-child">child</a>); + [CEReactions] <a data-link-type="idl-name" href="#node">Node</a> <a class="idl-code" data-link-type="method" href="#dom-node-removechild">removeChild</a>(<a data-link-type="idl-name" href="#node">Node</a> <a href="#dom-node-removechild-child-child">child</a>); }; [<a class="idl-code" data-link-type="constructor" href="#dom-document-document">Constructor</a>, @@ -6213,8 +6604,8 @@ <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">I [NewObject] <a data-link-type="idl-name" href="#comment">Comment</a> <a class="idl-code" data-link-type="method" href="#dom-document-createcomment">createComment</a>(DOMString <a href="#dom-document-createcomment-data-data">data</a>); [NewObject] <a data-link-type="idl-name" href="#processinginstruction">ProcessingInstruction</a> <a class="idl-code" data-link-type="method" href="#dom-document-createprocessinginstruction">createProcessingInstruction</a>(DOMString <a href="#dom-document-createprocessinginstruction-target-data-target">target</a>, DOMString <a href="#dom-document-createprocessinginstruction-target-data-data">data</a>); - [NewObject] <a data-link-type="idl-name" href="#node">Node</a> <a class="idl-code" data-link-type="method" href="#dom-document-importnode">importNode</a>(<a data-link-type="idl-name" href="#node">Node</a> <a href="#dom-document-importnode-node-deep-node">node</a>, optional boolean <a href="#dom-document-importnode-node-deep-deep">deep</a> = false); - <a data-link-type="idl-name" href="#node">Node</a> <a class="idl-code" data-link-type="method" href="#dom-document-adoptnode">adoptNode</a>(<a data-link-type="idl-name" href="#node">Node</a> <a href="#dom-document-adoptnode-node-node">node</a>); + [CEReactions, NewObject] <a data-link-type="idl-name" href="#node">Node</a> <a class="idl-code" data-link-type="method" href="#dom-document-importnode">importNode</a>(<a data-link-type="idl-name" href="#node">Node</a> <a href="#dom-document-importnode-node-deep-node">node</a>, optional boolean <a href="#dom-document-importnode-node-deep-deep">deep</a> = false); + [CEReactions] <a data-link-type="idl-name" href="#node">Node</a> <a class="idl-code" data-link-type="method" href="#dom-document-adoptnode">adoptNode</a>(<a data-link-type="idl-name" href="#node">Node</a> <a href="#dom-document-adoptnode-node-node">node</a>); [NewObject] <a data-link-type="idl-name" href="#attr">Attr</a> <a class="idl-code" data-link-type="method" href="#dom-document-createattribute">createAttribute</a>(DOMString <a href="#dom-document-createattribute-localname-localname">localName</a>); [NewObject] <a data-link-type="idl-name" href="#attr">Attr</a> <a class="idl-code" data-link-type="method" href="#dom-document-createattributens">createAttributeNS</a>(DOMString? <a href="#dom-document-createattributens-namespace-qualifiedname-namespace">namespace</a>, DOMString <a href="#dom-document-createattributens-namespace-qualifiedname-qualifiedname">qualifiedName</a>); @@ -6271,28 +6662,28 @@ <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">I readonly attribute DOMString <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="DOMString " href="#dom-element-localname">localName</a>; readonly attribute DOMString <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="DOMString " href="#dom-element-tagname">tagName</a>; - attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-element-id">id</a>; - attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-element-classname">className</a>; - [SameObject, PutForwards=<a class="idl-code" data-link-type="attribute" href="#dom-domtokenlist-value">value</a>] readonly attribute <a data-link-type="idl-name" href="#domtokenlist">DOMTokenList</a> <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="DOMTokenList " href="#dom-element-classlist">classList</a>; - attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-element-slot">slot</a>; + [CEReactions] attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-element-id">id</a>; + [CEReactions] attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-element-classname">className</a>; + [CEReactions, SameObject, PutForwards=<a class="idl-code" data-link-type="attribute" href="#dom-domtokenlist-value">value</a>] readonly attribute <a data-link-type="idl-name" href="#domtokenlist">DOMTokenList</a> <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="DOMTokenList " href="#dom-element-classlist">classList</a>; + [CEReactions] attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-element-slot">slot</a>; boolean <a class="idl-code" data-link-type="method" href="#dom-element-hasattributes">hasAttributes</a>(); [SameObject] readonly attribute <a data-link-type="idl-name" href="#namednodemap">NamedNodeMap</a> <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="NamedNodeMap " href="#dom-element-attributes">attributes</a>; sequence<DOMString> <a class="idl-code" data-link-type="method" href="#dom-element-getattributenames">getAttributeNames</a>(); DOMString? <a class="idl-code" data-link-type="method" href="#dom-element-getattribute">getAttribute</a>(DOMString <a href="#dom-element-getattribute-qualifiedname-qualifiedname">qualifiedName</a>); DOMString? <a class="idl-code" data-link-type="method" href="#dom-element-getattributens">getAttributeNS</a>(DOMString? <a href="#dom-element-getattributens-namespace-localname-namespace">namespace</a>, DOMString <a href="#dom-element-getattributens-namespace-localname-localname">localName</a>); - void <a class="idl-code" data-link-type="method" href="#dom-element-setattribute">setAttribute</a>(DOMString <a href="#dom-element-setattribute-qualifiedname-value-qualifiedname">qualifiedName</a>, DOMString <a href="#dom-element-setattribute-qualifiedname-value-value">value</a>); - void <a class="idl-code" data-link-type="method" href="#dom-element-setattributens">setAttributeNS</a>(DOMString? <a href="#dom-element-setattributens-namespace-qualifiedname-value-namespace">namespace</a>, DOMString <a href="#dom-element-setattributens-namespace-qualifiedname-value-qualifiedname">qualifiedName</a>, DOMString <a href="#dom-element-setattributens-namespace-qualifiedname-value-value">value</a>); - void <a class="idl-code" data-link-type="method" href="#dom-element-removeattribute">removeAttribute</a>(DOMString <a href="#dom-element-removeattribute-qualifiedname-qualifiedname">qualifiedName</a>); - void <a class="idl-code" data-link-type="method" href="#dom-element-removeattributens">removeAttributeNS</a>(DOMString? <a href="#dom-element-removeattributens-namespace-localname-namespace">namespace</a>, DOMString <a href="#dom-element-removeattributens-namespace-localname-localname">localName</a>); + [CEReactions] void <a class="idl-code" data-link-type="method" href="#dom-element-setattribute">setAttribute</a>(DOMString <a href="#dom-element-setattribute-qualifiedname-value-qualifiedname">qualifiedName</a>, DOMString <a href="#dom-element-setattribute-qualifiedname-value-value">value</a>); + [CEReactions] void <a class="idl-code" data-link-type="method" href="#dom-element-setattributens">setAttributeNS</a>(DOMString? <a href="#dom-element-setattributens-namespace-qualifiedname-value-namespace">namespace</a>, DOMString <a href="#dom-element-setattributens-namespace-qualifiedname-value-qualifiedname">qualifiedName</a>, DOMString <a href="#dom-element-setattributens-namespace-qualifiedname-value-value">value</a>); + [CEReactions] void <a class="idl-code" data-link-type="method" href="#dom-element-removeattribute">removeAttribute</a>(DOMString <a href="#dom-element-removeattribute-qualifiedname-qualifiedname">qualifiedName</a>); + [CEReactions] void <a class="idl-code" data-link-type="method" href="#dom-element-removeattributens">removeAttributeNS</a>(DOMString? <a href="#dom-element-removeattributens-namespace-localname-namespace">namespace</a>, DOMString <a href="#dom-element-removeattributens-namespace-localname-localname">localName</a>); boolean <a class="idl-code" data-link-type="method" href="#dom-element-hasattribute">hasAttribute</a>(DOMString <a href="#dom-element-hasattribute-qualifiedname-qualifiedname">qualifiedName</a>); boolean <a class="idl-code" data-link-type="method" href="#dom-element-hasattributens">hasAttributeNS</a>(DOMString? <a href="#dom-element-hasattributens-namespace-localname-namespace">namespace</a>, DOMString <a href="#dom-element-hasattributens-namespace-localname-localname">localName</a>); <a data-link-type="idl-name" href="#attr">Attr</a>? <a class="idl-code" data-link-type="method" href="#dom-element-getattributenode">getAttributeNode</a>(DOMString <a href="#dom-element-getattributenode-qualifiedname-qualifiedname">qualifiedName</a>); <a data-link-type="idl-name" href="#attr">Attr</a>? <a class="idl-code" data-link-type="method" href="#dom-element-getattributenodens">getAttributeNodeNS</a>(DOMString? <a href="#dom-element-getattributenodens-namespace-localname-namespace">namespace</a>, DOMString <a href="#dom-element-getattributenodens-namespace-localname-localname">localName</a>); - <a data-link-type="idl-name" href="#attr">Attr</a>? <a class="idl-code" data-link-type="method" href="#dom-element-setattributenode">setAttributeNode</a>(<a data-link-type="idl-name" href="#attr">Attr</a> <a href="#dom-element-setattributenode-attr-attr">attr</a>); - <a data-link-type="idl-name" href="#attr">Attr</a>? <a class="idl-code" data-link-type="method" href="#dom-element-setattributenodens">setAttributeNodeNS</a>(<a data-link-type="idl-name" href="#attr">Attr</a> <a href="#dom-element-setattributenodens-attr-attr">attr</a>); - <a data-link-type="idl-name" href="#attr">Attr</a> <a class="idl-code" data-link-type="method" href="#dom-element-removeattributenode">removeAttributeNode</a>(<a data-link-type="idl-name" href="#attr">Attr</a> <a href="#dom-element-removeattributenode-attr-attr">attr</a>); + [CEReactions] <a data-link-type="idl-name" href="#attr">Attr</a>? <a class="idl-code" data-link-type="method" href="#dom-element-setattributenode">setAttributeNode</a>(<a data-link-type="idl-name" href="#attr">Attr</a> <a href="#dom-element-setattributenode-attr-attr">attr</a>); + [CEReactions] <a data-link-type="idl-name" href="#attr">Attr</a>? <a class="idl-code" data-link-type="method" href="#dom-element-setattributenodens">setAttributeNodeNS</a>(<a data-link-type="idl-name" href="#attr">Attr</a> <a href="#dom-element-setattributenodens-attr-attr">attr</a>); + [CEReactions] <a data-link-type="idl-name" href="#attr">Attr</a> <a class="idl-code" data-link-type="method" href="#dom-element-removeattributenode">removeAttributeNode</a>(<a data-link-type="idl-name" href="#attr">Attr</a> <a href="#dom-element-removeattributenode-attr-attr">attr</a>); <a data-link-type="idl-name" href="#shadowroot">ShadowRoot</a> <a class="idl-code" data-link-type="method" href="#dom-element-attachshadow">attachShadow</a>(<a data-link-type="idl-name" href="#dictdef-shadowrootinit">ShadowRootInit</a> <a href="#dom-element-attachshadow-init-init">init</a>); readonly attribute <a data-link-type="idl-name" href="#shadowroot">ShadowRoot</a>? <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="ShadowRoot? " href="#dom-element-shadowroot">shadowRoot</a>; @@ -6305,8 +6696,8 @@ <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">I <a data-link-type="idl-name" href="#htmlcollection">HTMLCollection</a> <a class="idl-code" data-link-type="method" href="#dom-element-getelementsbytagnamens">getElementsByTagNameNS</a>(DOMString? <a href="#dom-element-getelementsbytagnamens-namespace-localname-namespace">namespace</a>, DOMString <a href="#dom-element-getelementsbytagnamens-namespace-localname-localname">localName</a>); <a data-link-type="idl-name" href="#htmlcollection">HTMLCollection</a> <a class="idl-code" data-link-type="method" href="#dom-element-getelementsbyclassname">getElementsByClassName</a>(DOMString <a href="#dom-element-getelementsbyclassname-classnames-classnames">classNames</a>); - <a data-link-type="idl-name" href="#element">Element</a>? <a class="idl-code" data-link-type="method" href="#dom-element-insertadjacentelement">insertAdjacentElement</a>(DOMString <a href="#dom-element-insertadjacentelement-where-element-where">where</a>, <a data-link-type="idl-name" href="#element">Element</a> <a href="#dom-element-insertadjacentelement-where-element-element">element</a>); // historical - void <a class="idl-code" data-link-type="method" href="#dom-element-insertadjacenttext">insertAdjacentText</a>(DOMString <a href="#dom-element-insertadjacenttext-where-data-where">where</a>, DOMString <a href="#dom-element-insertadjacenttext-where-data-data">data</a>); // historical + [CEReactions] <a data-link-type="idl-name" href="#element">Element</a>? <a class="idl-code" data-link-type="method" href="#dom-element-insertadjacentelement">insertAdjacentElement</a>(DOMString <a href="#dom-element-insertadjacentelement-where-element-where">where</a>, <a data-link-type="idl-name" href="#element">Element</a> <a href="#dom-element-insertadjacentelement-where-element-element">element</a>); // historical + [CEReactions] void <a class="idl-code" data-link-type="method" href="#dom-element-insertadjacenttext">insertAdjacentText</a>(DOMString <a href="#dom-element-insertadjacenttext-where-data-where">where</a>, DOMString <a href="#dom-element-insertadjacenttext-where-data-data">data</a>); // historical }; dictionary <a href="#dictdef-shadowrootinit">ShadowRootInit</a> { @@ -6319,10 +6710,10 @@ <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">I getter <a data-link-type="idl-name" href="#attr">Attr</a>? <a class="idl-code" data-link-type="method" href="#dom-namednodemap-item">item</a>(unsigned long <a href="#dom-namednodemap-item-index-index">index</a>); getter <a data-link-type="idl-name" href="#attr">Attr</a>? <a class="idl-code" data-link-type="method" href="#dom-namednodemap-getnameditem">getNamedItem</a>(DOMString <a href="#dom-namednodemap-getnameditem-qualifiedname-qualifiedname">qualifiedName</a>); <a data-link-type="idl-name" href="#attr">Attr</a>? <a class="idl-code" data-link-type="method" href="#dom-namednodemap-getnameditemns">getNamedItemNS</a>(DOMString? <a href="#dom-namednodemap-getnameditemns-namespace-localname-namespace">namespace</a>, DOMString <a href="#dom-namednodemap-getnameditemns-namespace-localname-localname">localName</a>); - <a data-link-type="idl-name" href="#attr">Attr</a>? <a class="idl-code" data-link-type="method" href="#dom-namednodemap-setnameditem">setNamedItem</a>(<a data-link-type="idl-name" href="#attr">Attr</a> <a href="#dom-namednodemap-setnameditem-attr-attr">attr</a>); - <a data-link-type="idl-name" href="#attr">Attr</a>? <a class="idl-code" data-link-type="method" href="#dom-namednodemap-setnameditemns">setNamedItemNS</a>(<a data-link-type="idl-name" href="#attr">Attr</a> <a href="#dom-namednodemap-setnameditemns-attr-attr">attr</a>); - <a data-link-type="idl-name" href="#attr">Attr</a> <a class="idl-code" data-link-type="method" href="#dom-namednodemap-removenameditem">removeNamedItem</a>(DOMString <a href="#dom-namednodemap-removenameditem-qualifiedname-qualifiedname">qualifiedName</a>); - <a data-link-type="idl-name" href="#attr">Attr</a> <a class="idl-code" data-link-type="method" href="#dom-namednodemap-removenameditemns">removeNamedItemNS</a>(DOMString? <a href="#dom-namednodemap-removenameditemns-namespace-localname-namespace">namespace</a>, DOMString <a href="#dom-namednodemap-removenameditemns-namespace-localname-localname">localName</a>); + [CEReactions] <a data-link-type="idl-name" href="#attr">Attr</a>? <a class="idl-code" data-link-type="method" href="#dom-namednodemap-setnameditem">setNamedItem</a>(<a data-link-type="idl-name" href="#attr">Attr</a> <a href="#dom-namednodemap-setnameditem-attr-attr">attr</a>); + [CEReactions] <a data-link-type="idl-name" href="#attr">Attr</a>? <a class="idl-code" data-link-type="method" href="#dom-namednodemap-setnameditemns">setNamedItemNS</a>(<a data-link-type="idl-name" href="#attr">Attr</a> <a href="#dom-namednodemap-setnameditemns-attr-attr">attr</a>); + [CEReactions] <a data-link-type="idl-name" href="#attr">Attr</a> <a class="idl-code" data-link-type="method" href="#dom-namednodemap-removenameditem">removeNamedItem</a>(DOMString <a href="#dom-namednodemap-removenameditem-qualifiedname-qualifiedname">qualifiedName</a>); + [CEReactions] <a data-link-type="idl-name" href="#attr">Attr</a> <a class="idl-code" data-link-type="method" href="#dom-namednodemap-removenameditemns">removeNamedItemNS</a>(DOMString? <a href="#dom-namednodemap-removenameditemns-namespace-localname-namespace">namespace</a>, DOMString <a href="#dom-namednodemap-removenameditemns-namespace-localname-localname">localName</a>); }; [Exposed=Window] @@ -6332,9 +6723,9 @@ <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">I readonly attribute DOMString <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="DOMString " href="#dom-attr-localname">localName</a>; readonly attribute DOMString <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="DOMString " href="#dom-attr-name">name</a>; readonly attribute DOMString <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="DOMString " href="#dom-attr-nodename">nodeName</a>; // historical alias of .name - attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-attr-value">value</a>; - [TreatNullAs=<a data-link-type="idl-name">EmptyString</a>] attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-attr-nodevalue">nodeValue</a>; // historical alias of .value - [TreatNullAs=<a data-link-type="idl-name">EmptyString</a>] attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-attr-textcontent">textContent</a>; // historical alias of .value + [CEReactions] attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-attr-value">value</a>; + [CEReactions, TreatNullAs=<a data-link-type="idl-name">EmptyString</a>] attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-attr-nodevalue">nodeValue</a>; // historical alias of .value + [CEReactions, TreatNullAs=<a data-link-type="idl-name">EmptyString</a>] attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-attr-textcontent">textContent</a>; // historical alias of .value readonly attribute <a data-link-type="idl-name" href="#element">Element</a>? <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="Element? " href="#dom-attr-ownerelement">ownerElement</a>; @@ -6392,11 +6783,11 @@ <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">I const unsigned short <a href="#dom-range-end_to_start">END_TO_START</a> = 3; short <a class="idl-code" data-link-type="method" href="#dom-range-compareboundarypoints">compareBoundaryPoints</a>(unsigned short <a href="#dom-range-compareboundarypoints-how-sourcerange-how">how</a>, <a data-link-type="idl-name" href="#range">Range</a> <a href="#dom-range-compareboundarypoints-how-sourcerange-sourcerange">sourceRange</a>); - void <a class="idl-code" data-link-type="method" href="#dom-range-deletecontents">deleteContents</a>(); - [NewObject] <a data-link-type="idl-name" href="#documentfragment">DocumentFragment</a> <a class="idl-code" data-link-type="method" href="#dom-range-extractcontents">extractContents</a>(); - [NewObject] <a data-link-type="idl-name" href="#documentfragment">DocumentFragment</a> <a class="idl-code" data-link-type="method" href="#dom-range-clonecontents">cloneContents</a>(); - void <a class="idl-code" data-link-type="method" href="#dom-range-insertnode">insertNode</a>(<a data-link-type="idl-name" href="#node">Node</a> <a href="#dom-range-insertnode-node-node">node</a>); - void <a class="idl-code" data-link-type="method" href="#dom-range-surroundcontents">surroundContents</a>(<a data-link-type="idl-name" href="#node">Node</a> <a href="#dom-range-surroundcontents-newparent-newparent">newParent</a>); + [CEReactions] void <a class="idl-code" data-link-type="method" href="#dom-range-deletecontents">deleteContents</a>(); + [CEReactions, NewObject] <a data-link-type="idl-name" href="#documentfragment">DocumentFragment</a> <a class="idl-code" data-link-type="method" href="#dom-range-extractcontents">extractContents</a>(); + [CEReactions, NewObject] <a data-link-type="idl-name" href="#documentfragment">DocumentFragment</a> <a class="idl-code" data-link-type="method" href="#dom-range-clonecontents">cloneContents</a>(); + [CEReactions] void <a class="idl-code" data-link-type="method" href="#dom-range-insertnode">insertNode</a>(<a data-link-type="idl-name" href="#node">Node</a> <a href="#dom-range-insertnode-node-node">node</a>); + [CEReactions] void <a class="idl-code" data-link-type="method" href="#dom-range-surroundcontents">surroundContents</a>(<a data-link-type="idl-name" href="#node">Node</a> <a href="#dom-range-surroundcontents-newparent-newparent">newParent</a>); [NewObject] <a data-link-type="idl-name" href="#range">Range</a> <a class="idl-code" data-link-type="method" href="#dom-range-clonerange">cloneRange</a>(); void <a class="idl-code" data-link-type="method" href="#dom-range-detach">detach</a>(); @@ -6467,12 +6858,12 @@ <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">I readonly attribute unsigned long <a class="idl-code" data-link-type="attribute" data-readonly="" data-type="unsigned long " href="#dom-domtokenlist-length">length</a>; getter DOMString? <a class="idl-code" data-link-type="method" href="#dom-domtokenlist-item">item</a>(unsigned long <a href="#dom-domtokenlist-item-index-index">index</a>); boolean <a class="idl-code" data-link-type="method" href="#dom-domtokenlist-contains">contains</a>(DOMString <a href="#dom-domtokenlist-contains-token-token">token</a>); - void <a class="idl-code" data-link-type="method" href="#dom-domtokenlist-add">add</a>(DOMString... <a href="#dom-domtokenlist-add-tokens-tokens">tokens</a>); - void <a class="idl-code" data-link-type="method" href="#dom-domtokenlist-remove">remove</a>(DOMString... <a href="#dom-domtokenlist-remove-tokens-tokens">tokens</a>); - boolean <a class="idl-code" data-link-type="method" href="#dom-domtokenlist-toggle">toggle</a>(DOMString <a href="#dom-domtokenlist-toggle-token-force-token">token</a>, optional boolean <a href="#dom-domtokenlist-toggle-token-force-force">force</a>); - void <a class="idl-code" data-link-type="method" href="#dom-domtokenlist-replace">replace</a>(DOMString <a href="#dom-domtokenlist-replace-token-newtoken-token">token</a>, DOMString <a href="#dom-domtokenlist-replace-token-newtoken-newtoken">newToken</a>); + [CEReactions] void <a class="idl-code" data-link-type="method" href="#dom-domtokenlist-add">add</a>(DOMString... <a href="#dom-domtokenlist-add-tokens-tokens">tokens</a>); + [CEReactions] void <a class="idl-code" data-link-type="method" href="#dom-domtokenlist-remove">remove</a>(DOMString... <a href="#dom-domtokenlist-remove-tokens-tokens">tokens</a>); + [CEReactions] boolean <a class="idl-code" data-link-type="method" href="#dom-domtokenlist-toggle">toggle</a>(DOMString <a href="#dom-domtokenlist-toggle-token-force-token">token</a>, optional boolean <a href="#dom-domtokenlist-toggle-token-force-force">force</a>); + [CEReactions] void <a class="idl-code" data-link-type="method" href="#dom-domtokenlist-replace">replace</a>(DOMString <a href="#dom-domtokenlist-replace-token-newtoken-token">token</a>, DOMString <a href="#dom-domtokenlist-replace-token-newtoken-newtoken">newToken</a>); boolean <a class="idl-code" data-link-type="method" href="#dom-domtokenlist-supports">supports</a>(DOMString <a href="#dom-domtokenlist-supports-token-token">token</a>); - attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-domtokenlist-value">value</a>; + [CEReactions] attribute DOMString <a class="idl-code" data-link-type="attribute" data-type="DOMString " href="#dom-domtokenlist-value">value</a>; <a data-link-type="dfn" href="#dom-domtokenlist-stringifier">stringifier</a>; iterable<DOMString>; };