-
Notifications
You must be signed in to change notification settings - Fork 227
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
Share more code with xml5ever #266
Comments
Sounds like a plan. I am assuming following structure for workspace:
|
Looks good 👍 I sometimes don’t use a |
Here is the WIP: https://github.com/Ygg01/html5ever/tree/xhtml5ever Questions I have are following:
|
|
Hello, I am a student. I recently started contributing on servo. I found my self doing only "easy" bugs, which gets boring after some time. I would like to work on servo and actually understand whats going on. To begin with i have decided to work on html5ever first and understand how parsing is done at lower levels, If you guys could sort of mentor me that will be great( @SimonSapin @Ygg01 ) Looks like this issue has lots of stuff to do, may i be of any help? |
I think @Ygg01 has already started working on this, so you should coordinate together :) |
@karan1276 I will gladly accept a PR to my PR :P So what do you want to do? Want do you want to know about? You can look at xml5ever as a simplified version of html5ever. Basically, xml5ever and hmtl5ever tokenization is similar, but tree building is waaaay different, because HTML has insertion modes. @SimonSapin Could I partially commit this? I think I did items 1-4 on that list, but recently some PRs broke my commits :( Last bullet point is really numerous, and might take more sense to divide. |
@Ygg01 one thing is that if there are breaking API changes I’d prefer to batch them as much as reasonable. Do you think there’s work that can be deferred to later without introducing more breakage then? In any case feel free to send PRs :) |
@SimonSapin Ok, I think I got most of stuff done. Only few issues remain:
Is there in your opinion better way to organize these, things? |
Don’t spend effort trying to unify Regarding deprecation, we’re making breaking changes anyway so I wouldn’t worry too much about it.
|
Xhtml5ever Ok, this is a large one. Fixes #266, fixes #261, fixes #210. It moves html5ever into separate folder, renames html5ever macros markup5ever and stores common code there. Here is short summary of what I know is and isn't done. - [x] Make every crate in the repo use a single workspace - [x] Make sure Travis-CI is running every test - [x] Rename the the html5ever_atoms crate to markup5ever and update html5ever and xml5ever to use it. - [x] Increment version numbers - [x] Make it so that users of either html5ever or xml5ever don’t need to have an explicit dependency to markup5ever - [x] Export QualName #210 - [x] let markup5ever generate entities.json #261 - [ ] **Move TokenSink to markup5ever** - [x] Move TreeSink to markup5ever - [x] Move BufferQueue to markup5ever - [x] Move SmallCharSet to markup5ever - [ ] **Deal with driver.rs** <!-- 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/268) <!-- Reviewable:end -->
Yes, after discussion in https://github.com/Ygg01/xml5ever/issues/30 we’ve moved the xml5ever code into this repository with the intention to share more code. However much of that has yet to happen. Rough plan:
Make every crate in the repo use a single workspace
Make sure Travis-CI is running every test
Rename the the
html5ever_atoms
crate tomarkup5ever
and update html5ever and xml5ever to use it. This is a breaking change, so increment version numbers accordingly.Make it so that users of either html5ever or xml5ever don’t need to have an explicit dependency to markup5ever (which should be an implementation detail). One way to do this is to have
pub use markup5ever::*;
at the root of each crate.Find things that exist in both html5ever and xml5ever, and move them to markup5ever. Judge on a case-by-case basis when there are differences.
For example
TokenSink
has some methods in common, but both parsers have some methods unique to it in their respectiveTokenSink
. Since this trait is implemented by users of the libraries, the sharedTokenSink
should have the union of all methods (to support both parsers) and provide default implementations of methods where that makes sense (to reduce the overhead for users that only care about one parser).The
Parser
andBytesParser
types inhtml5ever::driver
are busted for handling</script>
, we might want to remove them or redesign them. (Don’t bother adding it to xhtml5ever.)The text was updated successfully, but these errors were encountered: