servo/servo — pull request #3253 by ChrisParis (2014-09-08 22:57:44+00:00)
Title: Implement TreeWalker

Addresses https://github.com/servo/servo/issues/1234. This implementation allows NodeFilters to be provided as JavaScript objects, for the normal use case, but also as native Rust functions. This is so that TreeWalker can be used internally. This could be useful, for example, in implementing HTMLOptionElement.text, in which we have to skip script elements and children. You can see this worked out at https://github.com/ChrisParis/servo/commit/c1bb1e7584ac65a00d2ccf4b6b7faba39778d9e0.

I've submitted test cases to https://github.com/w3c/web-platform-tests. The tests in which the NodeFilter either isn't callable or throws an exception don't work. It looks like that has something to do with the automatically generated code.