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
M1501: Report CSS errors to the devtools, both stored and live #8210
Conversation
Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @larsbergstrom (or someone else) soon. |
Looks good! We just need to address these style issues reported by
|
From test-tidy again: |
To build successfully, it requires changes to be made to properties.mako.rs, selector_matching.rs, stylesheets.rs and viewport.rs. I have made changes to these files but still the build fails due to properties.rs and properties.rs gets generated on building servo. I have tried but I have not been able to figure out what other changes I need to make in order to build servo successfully. |
Once, we are clear on how to proceed we will resolve the checkstyle errors thrown by ./mach test-tidy in the next commit. |
I propose changes that should make it easier to build correctly:
|
Please also use git rebase instead of merging changes from master, too. It results in much cleaner lists of commits. |
Even after making the proposed changes, build fails because of properties.rs. Tried making changes to properties.rs according to the errors it throws. Managed to eliminate some of the errors. But it is getting too complicated to make changes to properties.rs. Could you please suggest some way out of this problem so that we can build servo successfully ? Thank you for your help. |
Could you rebase and push what you currently have? It's hard to help without being able to read your current code. |
According to the TravisCI link, many of the remaining errors are of the form "function expected 4 arguments, got 3" (which I presume has to do with need to pass the new error reporter value). If you correct that issue, I would expect the rest of the errors to disappear. |
Yes correct, most of the errors are of that form and all the errors are in properties.rs. However, when I make those changes and do (./mach build --dev), initially I was able to reduce the number of errors. However, now when I build servo again, I lost the changes that I made to properties.rs and I am again back to the same number of errors I was facing earlier. |
properties.rs is generated; you should be able to make equivalent changes to properties.mako.rs. |
-S-awaiting-review +S-needs-squash Reviewed 2 of 2 files at r4. Comments from the review on Reviewable.io |
869fd05
to
9946d8b
Compare
This can almost merge, but the changes to |
☔ The latest upstream changes (presumably #8589) made this pull request unmergeable. Please resolve the merge conflicts. |
9946d8b
to
47bceb8
Compare
Looks like something went wrong with the rebase, since there are merge conflicts now and changes are included in the commit that are already present in master. I'm going to go ahead and perform the surgery necessary to get this to land, in the interest of expediency :) |
Rebased in #8682. |
Defined new trait ParseErrorReporter and added error_reporter member … …to ParserContext. Rebase of #8210. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8682) <!-- Reviewable:end -->
Defined new trait ParseErrorReporter and added error_reporter member … …to ParserContext. Rebase of #8210. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8682) <!-- Reviewable:end -->
Defined new trait ParseErrorReporter and added error_reporter member … …to ParserContext. Rebase of #8210. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8682) <!-- Reviewable:end -->
The interface in #8210 allows us to create custom instances of CSS parse error reporters. We should write a test in tests/unit/style/stylesheets.rs that tries to parse invalid CSS and have a custom reporter that asserts the errors that are reported. Code: tests/unit/style/stylesheets.rs, http://doc.servo.org/style_traits/trait.ParseErrorReporter.html Fixes #8842 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9028) <!-- Reviewable:end -->
The interface in #8210 allows us to create custom instances of CSS parse error reporters. We should write a test in tests/unit/style/stylesheets.rs that tries to parse invalid CSS and have a custom reporter that asserts the errors that are reported. Code: tests/unit/style/stylesheets.rs, http://doc.servo.org/style_traits/trait.ParseErrorReporter.html Fixes #8842 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9028) <!-- Reviewable:end -->
Define a new trait called ParseErrorReporter in
components/style_traits/lib.rs with an appropriate method to report an error, and add a error_reporter member to ParserContext that uses this