Skip to content

Latest commit

 

History

History
54 lines (31 loc) · 3.44 KB

Contributing.md

File metadata and controls

54 lines (31 loc) · 3.44 KB

Mission

jsdom is, as said in our tagline, “A JavaScript implementation of the W3C DOM.” Anything that helps us be better at that is welcome.

Status

We're pretty happy with our DOM2 implementation, modulo bugs. DOM3 is nowhere near complete, and DOM4 is almost nonexistant.

Existing Tests

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 test/level2/html.js.

The current test compliance is tracked in the README.

Contributing

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:

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 our DOM3 support not being complete. (Maybe you could help break them out into complete vs. work in progress?)

DOM4 has no officially-finished test suite, but many tests are found on w3c-test.org. Check in a few different directories, e.g. html and webapps, or perhaps browse through the nice test runner interface. If you really can't find anything, you can always ask public-webapps-testsuite@w3.org, like I did.

More recently there's been an attempt to consolidate tests for HTML5 in the w3c/web-platform-tests repository, so you can try to find things there. Many of the directories are empty, however; it seems that's still largely a work in progress.

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!

Issues

Finally, we have an active and full issue tracker that we'd love you to help with. Go find something broken, and fix it!