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

M1501: R​eport CSS errors to the devtools, both stored and live #8210

Closed
wants to merge 1 commit into from

Conversation

GauriGNaik
Copy link
Contributor

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

Review on Reviewable

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Oct 26, 2015
@highfive
Copy link

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.

@jdm
Copy link
Member

jdm commented Oct 26, 2015

Looks good! We just need to address these style issues reported by ./mach test-tidy:

./components/style/parser.rs:21: Line is longer than 120 characters

./components/style/parser.rs:9: use statement is not in alphabetical order

    expected: style_traits::ParseErrorReporter

    found: stylesheets::Origin

./components/style/parser.rs:10: use statement is not in alphabetical order

    expected: stylesheets::Origin

    found: url::{Url, UrlParser}

./components/style/parser.rs:11: use statement is not in alphabetical order

    expected: url::{Url, UrlParser}

    found: style_traits::ParseErrorReporter

./components/style_traits/lib.rs:30: no newline at EOF

@jdm jdm added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Oct 26, 2015
@jdm jdm self-assigned this Oct 26, 2015
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Oct 26, 2015
@jdm
Copy link
Member

jdm commented Oct 26, 2015

From test-tidy again: ./components/style/parser.rs:21: trailing whitespace
However, more importantly, these don't appear to compile. Did you build them locally?

@jdm jdm added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Oct 26, 2015
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Oct 26, 2015
@jdm jdm added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Oct 27, 2015
@GauriGNaik
Copy link
Contributor Author

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.

@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Oct 28, 2015
@GauriGNaik
Copy link
Contributor Author

Once, we are clear on how to proceed we will resolve the checkstyle errors thrown by ./mach test-tidy in the next commit.

@jdm
Copy link
Member

jdm commented Oct 28, 2015

I propose changes that should make it easier to build correctly:

  • store a Box<ParseErrorReporter + Send> value in the struct
  • take Box<ParseErrorReporter + Send> arguments everywhere necessary
    There should be no need to add <'a> or &'a anywhere with these changes.

@jdm
Copy link
Member

jdm commented Oct 28, 2015

Please also use git rebase instead of merging changes from master, too. It results in much cleaner lists of commits.

@jdm jdm added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Oct 28, 2015
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Oct 28, 2015
@GauriGNaik
Copy link
Contributor Author

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.

@eefriedman
Copy link
Contributor

Could you rebase and push what you currently have? It's hard to help without being able to read your current code.

@jdm
Copy link
Member

jdm commented Oct 30, 2015

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.

@GauriGNaik
Copy link
Contributor Author

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.

@eefriedman
Copy link
Contributor

properties.rs is generated; you should be able to make equivalent changes to properties.mako.rs.

@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Nov 16, 2015
@jdm jdm removed the S-awaiting-review There is new code that needs to be reviewed. label Nov 17, 2015
@jdm
Copy link
Member

jdm commented Nov 17, 2015

-S-awaiting-review +S-needs-squash
Great work! Please rebase these changes against master and squash them into a single commit so they can be merged!


Reviewed 2 of 2 files at r4.
Review status: all files reviewed at latest revision, all discussions resolved, some commit checks failed.


Comments from the review on Reviewable.io

@jdm jdm added the S-needs-squash Some (or all) of the commits in the PR should be combined. label Nov 17, 2015
@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Nov 18, 2015
@jdm jdm added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-needs-rebase There are merge conflict errors. S-needs-squash Some (or all) of the commits in the PR should be combined. S-awaiting-review There is new code that needs to be reviewed. labels Nov 18, 2015
@jdm
Copy link
Member

jdm commented Nov 18, 2015

This can almost merge, but the changes to support/android-rs-glue from the rebase need to be reverted - specifically, that directory no longer exists on master. The build from TravisCI should be successful for this to merge correctly. You can commit changes using --amend and force push to avoid creating extra commits at this point.

@bors-servo
Copy link
Contributor

☔ The latest upstream changes (presumably #8589) made this pull request unmergeable. Please resolve the merge conflicts.

@highfive highfive added S-needs-rebase There are merge conflict errors. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Nov 19, 2015
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Nov 25, 2015
@jdm
Copy link
Member

jdm commented Nov 25, 2015

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 :)

@jdm
Copy link
Member

jdm commented Nov 25, 2015

Rebased in #8682.

@jdm jdm closed this Nov 25, 2015
bors-servo pushed a commit that referenced this pull request Nov 26, 2015
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 -->
bors-servo pushed a commit that referenced this pull request Nov 26, 2015
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 -->
bors-servo pushed a commit that referenced this pull request Nov 26, 2015
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 -->
bors-servo pushed a commit that referenced this pull request Feb 7, 2016
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 -->
bors-servo pushed a commit that referenced this pull request Feb 8, 2016
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 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-awaiting-review There is new code that needs to be reviewed. S-needs-rebase There are merge conflict errors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants