-
Notifications
You must be signed in to change notification settings - Fork 130
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
Have at-rule without block handled in two stages as well #180
Conversation
r? @SimonSapin |
Probably we shouldn't take this until we can figure out a solution for servo/servo#18139 (comment). |
Since that has been solved, I think this is ready for review as well now. This is a breaking change. I have a local patch for Servo side. |
Maybe it is still better to distinguish between type for |
I added |
OK, I'll try to figure out it tomorrow. |
76bf7c4
to
fd02324
Compare
We probably should upgrade Servo to use 0.19.3 and then merge this PR and handle the change in a separate Servo PR. |
servo/servo#18171 upgrades to 0.19.3 but we’re waiting on dtolnay/dtoa#9 to land it, unless you’re ok with including the unnecessary PNG in mozilla-central. |
☔ The latest upstream changes (presumably 9542ab4) made this pull request unmergeable. Please resolve the merge conflicts. |
a13d07b
to
e365c23
Compare
@SimonSapin ping for review? |
Looks good. Do tests pass at the intermediate commit? Please squash if not. Do you have a corresponding Servo PR? r=me when that’s ready. Reviewed 5 of 5 files at r1, 3 of 3 files at r2. Comments from Reviewable |
It is supposed to pass at the intermediate commit. I'll try again before merging. |
So I can confirm that tests pass at the intermediate commit. |
e365c23
to
08d510d
Compare
[WIP] Parse at-rule without block in two stages This is the Servo side change necessary for servo/rust-cssparser#180. Cargo.lock inside needs to be updated before landing after new version of cssparser gets published. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18336) <!-- Reviewable:end -->
[WIP] Parse at-rule without block in two stages This is the Servo side change necessary for servo/rust-cssparser#180. Cargo.lock inside needs to be updated before landing after new version of cssparser gets published. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18336) <!-- Reviewable:end -->
@bors-servo r+ Reviewed 2 of 2 files at r4. Comments from Reviewable |
📌 Commit 08d510d has been approved by |
Have at-rule without block handled in two stages as well This change makes `AtRuleParser::parse_prelude` always return a prelude if parsed successfully, so that at-rules which do not accept block can be handled in two phases just like those with block. This is important because at-rules without block usually have side effects. If `parse_prelude` executes the side effect, but `parse_at_rule` later determined that the rule is actually invalid (e.g. because it is followed by a block), there is no way for impl of `AtRuleParser` to undo the side effect. It provides the necessary parser side change for fixing [Gecko bug 1388911](https://bugzilla.mozilla.org/show_bug.cgi?id=1388911). <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-cssparser/180) <!-- Reviewable:end -->
☀️ Test successful - status-travis |
Parse at-rule without block in two stages This is the Servo side change necessary for servo/rust-cssparser#180. ---- This also pulls in other changes from cssparser 0.20.0. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18336) <!-- Reviewable:end -->
Parse at-rule without block in two stages This is the Servo side change necessary for servo/rust-cssparser#180. ---- This also pulls in other changes from cssparser 0.20.0. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18336) <!-- Reviewable:end -->
Parse at-rule without block in two stages This is the Servo side change necessary for servo/rust-cssparser#180. ---- This also pulls in other changes from cssparser 0.20.0. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18336) <!-- Reviewable:end -->
Parse at-rule without block in two stages This is the Servo side change necessary for servo/rust-cssparser#180. ---- This also pulls in other changes from cssparser 0.20.0. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18336) <!-- Reviewable:end -->
Parse at-rule without block in two stages This is the Servo side change necessary for servo/rust-cssparser#180. ---- This also pulls in other changes from cssparser 0.20.0. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18336) <!-- Reviewable:end -->
… upsuper:two-stage-at-rule); r=SimonSapin This is the Servo side change necessary for servo/rust-cssparser#180. ---- This also pulls in other changes from cssparser 0.20.0. Source-Repo: https://github.com/servo/servo Source-Revision: f2e5b4992658db504db0f6176d3bfa580ced6fd0
… upsuper:two-stage-at-rule); r=SimonSapin This is the Servo side change necessary for servo/rust-cssparser#180. ---- This also pulls in other changes from cssparser 0.20.0. Source-Repo: https://github.com/servo/servo Source-Revision: f2e5b4992658db504db0f6176d3bfa580ced6fd0 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : 9c1767c636a6585ed1d552ae8c26376547d2f2fc
… upsuper:two-stage-at-rule); r=SimonSapin This is the Servo side change necessary for servo/rust-cssparser#180. ---- This also pulls in other changes from cssparser 0.20.0. Source-Repo: https://github.com/servo/servo Source-Revision: f2e5b4992658db504db0f6176d3bfa580ced6fd0
… upsuper:two-stage-at-rule); r=SimonSapin This is the Servo side change necessary for servo/rust-cssparser#180. ---- This also pulls in other changes from cssparser 0.20.0. Source-Repo: https://github.com/servo/servo Source-Revision: f2e5b4992658db504db0f6176d3bfa580ced6fd0 UltraBlame original commit: 18d453c2736cc29e3e52acdd3c262292db07b4d3
… upsuper:two-stage-at-rule); r=SimonSapin This is the Servo side change necessary for servo/rust-cssparser#180. ---- This also pulls in other changes from cssparser 0.20.0. Source-Repo: https://github.com/servo/servo Source-Revision: f2e5b4992658db504db0f6176d3bfa580ced6fd0 UltraBlame original commit: 18d453c2736cc29e3e52acdd3c262292db07b4d3
… upsuper:two-stage-at-rule); r=SimonSapin This is the Servo side change necessary for servo/rust-cssparser#180. ---- This also pulls in other changes from cssparser 0.20.0. Source-Repo: https://github.com/servo/servo Source-Revision: f2e5b4992658db504db0f6176d3bfa580ced6fd0 UltraBlame original commit: 18d453c2736cc29e3e52acdd3c262292db07b4d3
This change makes
AtRuleParser::parse_prelude
always return a prelude if parsed successfully, so that at-rules which do not accept block can be handled in two phases just like those with block.This is important because at-rules without block usually have side effects. If
parse_prelude
executes the side effect, butparse_at_rule
later determined that the rule is actually invalid (e.g. because it is followed by a block), there is no way for impl ofAtRuleParser
to undo the side effect.It provides the necessary parser side change for fixing Gecko bug 1388911.
This change is