diff --git a/dom.bs b/dom.bs index afe7880a0..80ad9b844 100644 --- a/dom.bs +++ b/dom.bs @@ -3320,6 +3320,8 @@ dictionary MutationObserverInit { boolean attributeOldValue; boolean characterDataOldValue; sequence<DOMString> attributeFilter; + sequence<DOMString> elementFilterByAttribute; + sequence<DOMString> elementLocalNameFilter; }; @@ -3398,6 +3400,19 @@ dictionary MutationObserverInit { attribute mutations need to be observed and {{MutationObserverInit/attributes}} is true or omitted. + +
observer . {{disconnect()}}
@@ -3437,6 +3452,14 @@ method, when invoked, must run these steps:
options's {{MutationObserverInit/characterData}} is omitted, then set
options's {{MutationObserverInit/characterData}} to true.
+ If options's {{MutationObserverInit/elementFilterByAttribute}} is present and + options's {{MutationObserverInit/childList}} is omitted, then set + options's {{MutationObserverInit/childList}} to true. + +
If options's {{MutationObserverInit/elementLocalNameFilter}} is present and + options's {{MutationObserverInit/childList}} is omitted, then set + options's {{MutationObserverInit/childList}} to true. +
If none of options's {{MutationObserverInit/childList}},
{{MutationObserverInit/attributes}}, and {{MutationObserverInit/characterData}} is true, then
throw a TypeError
.
@@ -3453,6 +3476,14 @@ method, when invoked, must run these steps:
options's {{MutationObserverInit/characterData}} is false, then throw a
TypeError
.
+
If options's {{MutationObserverInit/elementFilterByAttribute}} is present and
+ options's {{MutationObserverInit/childList}} is false, then throw a
+ TypeError
.
+
+
If options's {{MutationObserverInit/elementLocalNameFilter}} is present and
+ options's {{MutationObserverInit/childList}} is false, then throw a
+ TypeError
.
+
For each registered of target's registered observer list, if registered's @@ -3594,6 +3625,60 @@ run these steps:
Assert: either addedNodes or removedNodes is not empty. +
If either options's' {{MutationObserverInit/elementLocalNameFilter}} or + {{MutationObserverInit/elementFilterByAttribute}} is present, then: + +
Let nodeAttributesList be the set of local names of node's attributes. + +
Let filteredAddedNodes be an empty list. + +
Let filterRemovedNodes be an empty list. + +
For each node in addedNodes. + +
If none of the following are true + +
node.localName
" is in {{MutationObserverInit/elementLocalNameFilter}}
+
+ then: +
Enqueue record node in filteredAddedNodes +
For each node in removedNodes. +
If none of the following are true +
node.localName
" is in {{MutationObserverInit/elementLocalNameFilter}}
+ then: +
Enqueue record node in filterRemovedNodes +
Assert: either filteredAddedNodes or filteredRemovedNodes is not empty. + +
Set addedNodes to filteredAddedNodes + +
Set removedNodes to filteredRemovedNodes +
Queue a mutation record of "childList
" for target with
null, null, null, addedNodes, removedNodes, previousSibling,
and nextSibling.