Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MutationObserver #80

Open
pimterry opened this issue May 10, 2016 · 5 comments
Open

MutationObserver #80

pimterry opened this issue May 10, 2016 · 5 comments

Comments

@pimterry
Copy link
Contributor

pimterry commented May 10, 2016

Any enthusiasm for adding support for MutationObserver? In the Living Standard, part of the full W3C Recommendation for DOM4, and implemented in almost every browser already.

Also, I'd find pretty useful.

I'd be happy to help out and try to work on this myself, but I haven't dug into the Domino source much, so some pointers in the right direction (assuming you'd be happy to include this) would be helpful.

@cscott
Copy link
Collaborator

cscott commented May 19, 2016

I certainly wouldn't object to its implementation! I'm unlikely to tackle this myself, simply because none of the projects I'm responsible for (primarily Parsoid) would use it. But it should be straightforward. The first step would be just to mechanically include the proper APIs, then you could actually hook it up to the node mutation mechanics in a second step. I suspect most of the node mutation happens in methods of Node, so it should be pretty obvious where to add new code.

Finding a good test suite would be key to ensure we actually are firing all the right events and not missing corner cases. Having 90% complete functionality could be worse than not having it at all for some users, as code with feature tests would break. Does the official W3C test suite cover this? It would also be good to ensure that third-party libraries like MutationSummary work correctly with domino's implementation. Hopefully we could plumb those two things into domino's test harness to convince ourselves that our implementation was sound.

@pimterry
Copy link
Contributor Author

pimterry commented May 20, 2016

Awesome, good to hear. I'll look at tackling this sometime soon.

cscott pushed a commit to cscott/domino that referenced this issue Jan 26, 2017
We blacklist those that don't work yet.  Some of these are mutation
observer tests we hope to get working in fgnass#80.

Fixes: fgnass#92
@MurhafSousli
Copy link

Hey guys, any updates on this?

@pimterry
Copy link
Contributor Author

@MurhafSousli I'm no longer working on it, it stopped being relevant to me, but feel free to take a look yourself.

The first step was getting the relevant web platform tests working - the work to get those tests usefully running in general is now there, but I think with most of them ignored because they fail. If you want to look at this the next step is to get the mutation observer tests working (and sensibly failing) and then to find a nice way to add a polyfill that makes them actually pass. The polyfill bit shouldn't be too hard in principle, there's existing polyfills for MutationObserver, it's just a matter of working out how to integrate them.

There's some unmerged work on getting tests that need to load resources (other scripts etc I think) at master...pimterry:load-resources-in-tests, which I think was part of getting the rest of the tests working, so might be helpful. It's been a long time though, so I can't tell you a lot more about the status of that.

@pimterry
Copy link
Contributor Author

The details in this commit particularly may be of interest: c6f89d0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants