Commit a8edcd9
bors-servo
Auto merge of servo#198 - Manishearth:nth-child-saturate, r=SimonSapin
Saturate if nth-child value is out of range
Reusing our tokenizer because it already saturates.
There is no way to reliably get the error details from `"-12034".parse()`, since the error type is opaque and the description strings may change.
This fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1401016
A less risky but also less correct fix is to simply return an error when `.parse()` fails.
r? @SimonSapin
Don't land until I can get a try run; nth-child has weird tokenization rules that we need to respect here (which is why I'm creating a new tokenizer in the first place)
<!-- 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/198)
<!-- Reviewable:end -->2 files changed
+18
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
0 commit comments