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

When are TreeSink's methods called #454

Open
Zizico2 opened this issue Oct 19, 2021 · 3 comments
Open

When are TreeSink's methods called #454

Zizico2 opened this issue Oct 19, 2021 · 3 comments

Comments

@Zizico2
Copy link

Zizico2 commented Oct 19, 2021

This is the second issue I open asking for support about html5ever (the other one was in kuchiki) (is there a better place to get support?). When are methods like remove_from_parent and reparent_children called outside of a browser environment? If I parse an html file will those ever get called or are they supposed to be called by JavaScript? Could it be documented when/why methods are called and in which use cases do they decisively need to be implemented (or if I can, for example, improve the performance of other methods to the detriment of methods that won't be called or will barely be called in my use case).

@jdm
Copy link
Member

jdm commented Oct 19, 2021

They can be invoked by the html5 parsing rules. For example, there are various callers for both methods in code under html5ever/src/tree_builder/.

@Zizico2
Copy link
Author

Zizico2 commented Oct 22, 2021

okok thanks. while we're on the topic... Will every created element be used? Or can a created element be left dangling, not appended to the tree. Will they all be popped, so I can implement pop and listen to that?

@jdm
Copy link
Member

jdm commented Oct 22, 2021

I can't imagine a situation where an element would be created but not appended to the tree.

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

2 participants