We're pretty happy with our DOM2 implementation, modulo bugs. DOM3 is nowhere near complete, and DOM4 is almost nonexistant.
The DOM, thankfully, has lots of tests already out there. Those already included in the repository are of two types:
- Auto-generated or adapted from existing W3C tests.
- Written by contributors to plug gaps in the W3C tests.
Of these, of course, the first is preferable. When we find gaps, we usually add the tests at the bottom of the relevant auto-generated test suite, e.g. in
Not all of the existing tests pass. The current test compliance is tracked in the README.
When contributing, the first question you should ask is:
Can I exhibit how the browsers differ from what jsdom is doing?
If you can, then you've almost certainly found a bug in or missing feature of jsdom, and we'd love to have your contribution. In that case, move on to:
What W3C spec covers this potential contribution?
Some likely ones include:
- DOM2 Core, DOM2 HTML, DOM2 Events, DOM2 Style
- DOM3 Core, DOM3 Events
- Other W3C Dom Specs
Once you have those nailed down, you'll want to ask:
Where can I get a W3C test for this functionality?
We already have all the DOM1 and DOM2 tests. We even have some DOM3 ones, although sadly they are currently disabled, due to DOM3 not being complete. DOM4 has no official test suite yet, but many tests are found on w3c-test.org. If you really can't find it, you can always ask firstname.lastname@example.org, like I did.
If there is no W3C test covering the functionality you're after, then you can write your own, placing it in the appropriate level. But in this case you'll probably want to alert the authors of the relevant test suite that they missed something!
Finally, we have an active and full issue tracker that we'd love you to help with. Go find something broken, and fix it!