-
Notifications
You must be signed in to change notification settings - Fork 235
Consider killing the TreeBuilderActions trait and its ilk #258
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
What changes does this entail? Just moving methods from TreeBuilderActions/TreeBuilderStep to TreeBuilder, correct? |
Yep. |
This task seems trivial. Do you guys want to nominate this for Servo starter tasks? Or is html5ever outside of scope for such tasks? PS. Whoever fixes TreeBuilderActions, could also fix xml5ever, as well. |
Yes this should be made into an E-Easy issue. |
|
Hello. I would like to contribute. May I take this issue? |
@Januson Please do! Ask questions if anything is unclear. |
Thank you. I have a question about visibility. If I understand current code correctly, methods from TreeBuilderStep and TreeBuilderActions traits are private to the tree_builder mod. First idea how to get gid of these traits was to just copy them to TreeBuilder. But I figured that is a bad idea since tree_builder/mod.rs would grow past 3k lines. So keeping them separate I run into problem with visibility as private impl method in actions.rs is not visible in tree_builder/mod.rs but public method is visible everywhere. Is there any other way? Or am I missing something? So far I found only a SO question and this issue. |
Hello again. Ihave another question. I moved most of the required methods but I am struggling with methods from TreeBuilderStep. I can't figure out how to use match_token! macro outside of tree_builder/rules.rs. It is somehow generated in macros/match_token.rs and build.rs. How can I make it visible for methods in tree_builder/mod.rs? |
That sounds tricky. Can you move the relevant code into |
If want to go with the latter, add a new call to |
Thank you for suggestion. I thought about splitting it into methods, so that functionality using match_token macro stays in |
I made a pull request implementing these changes, feedback would be appreciated! |
Remove [Xml]TreeBuilderActions and [Xml]TreeBuilderStep and move their implementations into [Xml]TreeBuilder See issue #258 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/html5ever/274) <!-- Reviewable:end -->
@jbg Congrats! Your change is implemented and this bug can be closed :D |
They are only there for namespacing reasons.
The text was updated successfully, but these errors were encountered: