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

Implement TreeWalker #3253

Merged
merged 1 commit into from Sep 19, 2014
Merged

Implement TreeWalker #3253

merged 1 commit into from Sep 19, 2014

Conversation

@ChrisParis
Copy link
Contributor

ChrisParis commented Sep 8, 2014

Addresses #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 ChrisParis@c1bb1e7.

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.

@hoppipolla-critic-bot
Copy link

hoppipolla-critic-bot commented Sep 8, 2014

Critic review: https://critic.hoppipolla.co.uk/r/2536

This is an external review system which you may optionally use for the code review of your pull request.

In order to help critic track your changes, please do not make in-place history rewrites (e.g. via git rebase -i or git commit --amend) when updating this pull request.

@jdm
Copy link
Member

jdm commented Sep 9, 2014

Woo! This is an exciting PR! 🐨

@jdm
Copy link
Member

jdm commented Sep 9, 2014

/dom/interfaces.html
--------------------
PASS expected FAIL Document interface: xmlDoc must inherit property "createTreeWalker" with the proper type (23)
PASS expected FAIL Document interface: calling createTreeWalker(Node,unsigned long,NodeFilter) on xmlDoc with too few arguments must throw TypeError
PASS expected FAIL TreeWalker interface: attribute root
PASS expected FAIL TreeWalker interface: attribute whatToShow
PASS expected FAIL TreeWalker interface: attribute filter
PASS expected FAIL TreeWalker interface: attribute currentNode
PASS expected FAIL TreeWalker interface: operation parentNode()
PASS expected FAIL TreeWalker interface: operation firstChild()
PASS expected FAIL TreeWalker interface: operation lastChild()
PASS expected FAIL TreeWalker interface: operation previousSibling()
PASS expected FAIL TreeWalker interface: operation nextSibling()
PASS expected FAIL TreeWalker interface: operation previousNode()
PASS expected FAIL TreeWalker interface: operation nextNode()
@ChrisParis
Copy link
Contributor Author

ChrisParis commented Sep 9, 2014

PASS expected FAIL --
My favorite kind of bug.

@jdm
Copy link
Member

jdm commented Sep 18, 2014

You're correct that the test failures fall outside the purview of this PR. This is ready to merge after rebasing and squashing!

@ChrisParis ChrisParis force-pushed the ChrisParis:TreeWalker branch from 54c9203 to 92638a6 Sep 18, 2014
jdm added a commit that referenced this pull request Sep 19, 2014
Implement TreeWalker
@jdm jdm merged commit 6d67261 into servo:master Sep 19, 2014
1 check failed
1 check failed
continuous-integration/travis-ci The Travis CI build failed
Details
@ChrisParis ChrisParis deleted the ChrisParis:TreeWalker branch Apr 11, 2015
@KiChjang KiChjang mentioned this pull request Aug 27, 2017
4 of 4 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.