Re: [whatwg/dom] Consider adding localNameFilter to MutationObserver (#398)

For easy of use and consistency with [`attributeFilter`](https://dom.spec.whatwg.org/#dom-mutationobserverinit-attributefilter) which doesn't callout that it's a local name, I'd suggest `elementFilter` as the name of the filter.

We can revisit adding a new variant of filtering which takes qualified name (e.g. namespace and/or prefix into account) in the future.

> If options elementLocalNameFilter is present and options’s subTree is omitted, then set options’s elementChanges to true.

I don't think there is such a thing as "elementChanges".

> If options’s elementLocalNameFilter is present and options’s subTree is false, then throw a TypeError.

I don't think we should do this. It's definitely useful to be able to observe the direct child of an element of specific types.

We'd now have to consider what happens when both attributeFilter and elementFilter are set. One interpretation is that they're independent. We'd be monitoring insertion and removal of elements of specific types, and any changes to a set of attributes. Alternatively, they combine. We'd be only observing changes to attributes on elements of specific types.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/398#issuecomment-603659173

Received on Wednesday, 25 March 2020 06:08:56 UTC