dom icon indicating copy to clipboard operation
dom copied to clipboard

Add new mutation observer init options elementByAttributeFilter and elementFilter

Open AndrewRot opened this issue 4 years ago • 12 comments

Adds additional options when constructing a MutationObserver.

MutationObserverInit now contains two additional options: elementByAttributeFilter and elementFilter which are used to enhance the precision of filtering DOM nodes to observe.

See #398 for the background.

  • [x] At least two implementers are interested (and none opposed):
    • @rniwa
    • @annevk ?
  • [ ] Tests are written and can be reviewed and commented upon at:
    • … TODO
  • [ ] Implementation bugs are filed:
    • Chrome: None yet
    • Firefox: None yet
    • Safari: None yet

(See WHATWG Working Mode: Changes for more details.)


Preview | Diff

AndrewRot avatar Aug 12 '20 22:08 AndrewRot

@AndrewRot can Shape Security sign https://participate.whatwg.org/agreement? Previously that ended up not happening, but not sure what the reason was.

annevk avatar Aug 14 '20 13:08 annevk

@rniwa I don't see anything obvious that could be causing this error:

LINK ERROR: Multiple possible 'dfn' local refs for 'element'.

AndrewRot avatar Aug 28 '20 17:08 AndrewRot

@mfreed7 any thoughts from Google on this?

annevk avatar Sep 10 '20 10:09 annevk

FWIW, we're supportive of this proposal.

rniwa avatar Sep 11 '20 05:09 rniwa

@annevk yes - I've gotten written approval to sign off on the agreement from our legal department as well as my team managers.

AndrewRot avatar Sep 23 '20 19:09 AndrewRot

@annevk looks like agreement was filled out. Though I just added my manager as a secondary contact.

All comments appear to have been addressed. At this point, the only thing missing seems to be the tests? I can start on those.

AndrewRot avatar Sep 22 '21 18:09 AndrewRot

@AndrewRot that sounds great, thank you! Once the tests are there I'm happy to give this another pass.

annevk avatar Sep 23 '21 15:09 annevk

Has there been any progress on the tests? I'm working on a product which would benefit from this Mutation Observer filter feature, and might be able to assist with tests if there is interest.

bershanskiy avatar Dec 13 '22 15:12 bershanskiy

@mfreed7 ping on Chromium interest. @smaug---- Gecko?

@bershanskiy I'd be happy to pick up the remaining specification work assuming @AndrewRot no longer has the bandwidth if you can sort the tests. Thanks for volunteering!

annevk avatar Dec 13 '22 16:12 annevk

Hi @bershanskiy & @annevk - I'm glad this feature is useful for others! Yes, feel free to take the reins from here. I do not currently have the bandwidth to allocate for this feature.

AndrewRot avatar Dec 13 '22 16:12 AndrewRot

Gecko would implement this or some variant of it. (which isn't super surprising since looks like I filed https://github.com/whatwg/dom/issues/398 )

smaug---- avatar Dec 13 '22 23:12 smaug----

@mfreed7 ping on Chromium interest. @smaug---- Gecko?

@bershanskiy I'd be happy to pick up the remaining specification work assuming @AndrewRot no longer has the bandwidth if you can sort the tests. Thanks for volunteering!

Looks like a good addition to MutationObserver which would avoid boilerplate JS and speed things up a lot. I'm supportive!

mfreed7 avatar Dec 15 '22 17:12 mfreed7