Skip to content

Fix interaction of skip_whitespace and nested blocks #185

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

Merged
merged 1 commit into from
Aug 25, 2017
Merged

Conversation

SimonSapin
Copy link
Member

@SimonSapin SimonSapin commented Aug 25, 2017

This fixes (at least some of) the test failures at servo/servo#18171

In code like this:

unsupported selector ! { stuff }
valid selector { color: green }

rules_and_declarations::parse_qualified_rule would leave the parser just after the first { with Parser::at_start_of == Some(BlockType::CurlyBracket). The latter means that, unless Parser::parse_nested_block is called, the parser needs to skip over this block until the matching } before doing anything else. This PR makes Parser::skip_whitespace and Parser::skip_cdc_and_cdo (both added recently in #181) take care of Parser::at_start_of correctly the same way Parser::next does.


This change is Reviewable

This fixes (at least some of) the test failures at servo/servo#18171
@SimonSapin
Copy link
Member Author

@bors-servo r=emilio

@bors-servo
Copy link
Contributor

📌 Commit 0acff3b has been approved by emilio

@bors-servo
Copy link
Contributor

⌛ Testing commit 0acff3b with merge bb8b678...

bors-servo pushed a commit that referenced this pull request Aug 25, 2017
Fix interaction of skip_whitespace and nested blocks

This fixes (at least some of) the test failures at servo/servo#18171

In code like this:

```css
unsupported selector ! { stuff }
valid selector { color: green }
```

`rules_and_declarations::parse_qualified_rule` would leave the parser just after the first `{` with `Parser::at_start_of == Some(BlockType::CurlyBracket)`. The latter means that, unless `Parser::parse_nested_block` is called, the parser needs to skip over this block until the matching `}` before doing anything else. This PR makes `Parser::skip_whitespace` and `Parser::skip_cdc_and_cdo` (both added recently in #181) take care of `Parser::at_start_of` correctly the same way `Parser::next` does.

<!-- 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/185)
<!-- Reviewable:end -->
@emilio
Copy link
Member

emilio commented Aug 25, 2017

@bors-servo r+

@bors-servo
Copy link
Contributor

💡 This pull request was already approved, no need to approve it again.

  • This pull request is currently being tested. If there's no response from the continuous integration service, you may use retry to trigger a build again.

@bors-servo
Copy link
Contributor

📌 Commit 0acff3b has been approved by emilio

@bors-servo
Copy link
Contributor

⌛ Testing commit 0acff3b with merge acac1ce...

bors-servo pushed a commit that referenced this pull request Aug 25, 2017
Fix interaction of skip_whitespace and nested blocks

This fixes (at least some of) the test failures at servo/servo#18171

In code like this:

```css
unsupported selector ! { stuff }
valid selector { color: green }
```

`rules_and_declarations::parse_qualified_rule` would leave the parser just after the first `{` with `Parser::at_start_of == Some(BlockType::CurlyBracket)`. The latter means that, unless `Parser::parse_nested_block` is called, the parser needs to skip over this block until the matching `}` before doing anything else. This PR makes `Parser::skip_whitespace` and `Parser::skip_cdc_and_cdo` (both added recently in #181) take care of `Parser::at_start_of` correctly the same way `Parser::next` does.

<!-- 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/185)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

☀️ Test successful - status-travis
Approved by: emilio
Pushing acac1ce to master...

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