mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Auto merge of #15867 - servo:negative, r=nox
Reject negative factors in filter functions (fixes #15494) <!-- 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/15867) <!-- Reviewable:end -->
This commit is contained in:
commit
1f2e1e8b84
2 changed files with 45 additions and 2 deletions
|
@ -367,8 +367,8 @@ ${helpers.predefined_type("clip",
|
|||
fn parse_factor(input: &mut Parser) -> Result<::values::CSSFloat, ()> {
|
||||
use cssparser::Token;
|
||||
match input.next() {
|
||||
Ok(Token::Number(value)) => Ok(value.value),
|
||||
Ok(Token::Percentage(value)) => Ok(value.unit_value),
|
||||
Ok(Token::Number(value)) if value.value.is_sign_positive() => Ok(value.value),
|
||||
Ok(Token::Percentage(value)) if value.unit_value.is_sign_positive() => Ok(value.unit_value),
|
||||
_ => Err(())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue