html5ever
html5ever copied to clipboard
When are TreeSink's methods called
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).
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/.
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?
I can't imagine a situation where an element would be created but not appended to the tree.