mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
style: linear()
easing function should not consider less than 2 linear stop arguments valid
Latest spec no longer handles `linear() == linear` and `linear(<single value>) == <single value>`. Differential Revision: https://phabricator.services.mozilla.com/D169955
This commit is contained in:
parent
d76fe81600
commit
017ab0cb24
1 changed files with 4 additions and 3 deletions
|
@ -136,10 +136,8 @@ impl TimingFunction {
|
||||||
if !linear_timing_function_enabled() {
|
if !linear_timing_function_enabled() {
|
||||||
return Err(input.new_custom_error(StyleParseErrorKind::ExperimentalProperty));
|
return Err(input.new_custom_error(StyleParseErrorKind::ExperimentalProperty));
|
||||||
}
|
}
|
||||||
if input.is_exhausted() {
|
|
||||||
return Ok(GenericTimingFunction::LinearFunction(LinearStops::default()));
|
|
||||||
}
|
|
||||||
let mut result = vec![];
|
let mut result = vec![];
|
||||||
|
// Closely follows `parse_comma_separated`, but can generate multiple entries for one comma-separated entry.
|
||||||
loop {
|
loop {
|
||||||
input.parse_until_before(Delimiter::Comma, |i| {
|
input.parse_until_before(Delimiter::Comma, |i| {
|
||||||
let mut input_start = i.try_parse(|i| Percentage::parse(context, i)).ok();
|
let mut input_start = i.try_parse(|i| Percentage::parse(context, i)).ok();
|
||||||
|
@ -175,6 +173,9 @@ impl TimingFunction {
|
||||||
Ok(_) => unreachable!(),
|
Ok(_) => unreachable!(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if result.len() < 2 {
|
||||||
|
return Err(input.new_custom_error(StyleParseErrorKind::UnspecifiedError));
|
||||||
|
}
|
||||||
|
|
||||||
Ok(GenericTimingFunction::LinearFunction(LinearStops::new(
|
Ok(GenericTimingFunction::LinearFunction(LinearStops::new(
|
||||||
crate::OwnedSlice::from(result),
|
crate::OwnedSlice::from(result),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue