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

Have at-rule without block handled in two stages as well #180

Merged
merged 2 commits into from
Sep 1, 2017

Conversation

upsuper
Copy link
Contributor

@upsuper upsuper commented Aug 18, 2017

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.


This change is Reviewable

@upsuper
Copy link
Contributor Author

upsuper commented Aug 18, 2017

r? @SimonSapin

@upsuper
Copy link
Contributor Author

upsuper commented Aug 18, 2017

Probably we shouldn't take this until we can figure out a solution for servo/servo#18139 (comment).

@upsuper
Copy link
Contributor Author

upsuper commented Aug 20, 2017

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.

@upsuper
Copy link
Contributor Author

upsuper commented Aug 21, 2017

Maybe it is still better to distinguish between type for WithBlock and WithoutBlock so that users don't need to list unnecessary branches for prelude? But the existence of OptionalBlock is a problem then :/

@SimonSapin
Copy link
Member

I added OptionalBlock because it seemed easy enough at the time, but I don’t think any real CSS construct would ever use it. I don’t mind removing it.

@upsuper
Copy link
Contributor Author

upsuper commented Aug 21, 2017

OK, I'll try to figure out it tomorrow.

@upsuper
Copy link
Contributor Author

upsuper commented Aug 22, 2017

We probably should upgrade Servo to use 0.19.3 and then merge this PR and handle the change in a separate Servo PR.

@SimonSapin
Copy link
Member

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.

@bors-servo
Copy link
Contributor

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

@upsuper upsuper force-pushed the at-rule-parser branch 2 times, most recently from a13d07b to e365c23 Compare August 28, 2017 01:33
@upsuper
Copy link
Contributor Author

upsuper commented Aug 31, 2017

@SimonSapin ping for review?

@SimonSapin
Copy link
Member

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.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@upsuper
Copy link
Contributor Author

upsuper commented Aug 31, 2017

It is supposed to pass at the intermediate commit. I'll try again before merging.

@upsuper
Copy link
Contributor Author

upsuper commented Sep 1, 2017

So I can confirm that tests pass at the intermediate commit.

bors-servo pushed a commit to servo/servo that referenced this pull request Sep 1, 2017
[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 pushed a commit to servo/servo that referenced this pull request Sep 1, 2017
[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 -->
@SimonSapin
Copy link
Member

@bors-servo r+


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


Comments from Reviewable

@bors-servo
Copy link
Contributor

📌 Commit 08d510d has been approved by SimonSapin

@bors-servo
Copy link
Contributor

⌛ Testing commit 08d510d with merge 7a1266c...

bors-servo pushed a commit that referenced this pull request Sep 1, 2017
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 -->
@bors-servo
Copy link
Contributor

☀️ Test successful - status-travis
Approved by: SimonSapin
Pushing 7a1266c to master...

@bors-servo bors-servo merged commit 08d510d into servo:master Sep 1, 2017
@upsuper upsuper deleted the at-rule-parser branch September 1, 2017 06:18
bors-servo pushed a commit to servo/servo that referenced this pull request Sep 1, 2017
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 -->
bors-servo pushed a commit to servo/servo that referenced this pull request Sep 1, 2017
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 -->
bors-servo pushed a commit to servo/servo that referenced this pull request Sep 1, 2017
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 -->
bors-servo pushed a commit to servo/servo that referenced this pull request Sep 1, 2017
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 -->
bors-servo pushed a commit to servo/servo that referenced this pull request Sep 1, 2017
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 -->
xeonchen pushed a commit to xeonchen/gecko-cinnabar that referenced this pull request Sep 2, 2017
… 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
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Sep 2, 2017
… 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
aethanyc pushed a commit to aethanyc/gecko-dev that referenced this pull request Sep 3, 2017
… 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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 1, 2019
… 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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 1, 2019
… 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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 1, 2019
… 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants