mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
stylo: Support stroke-dasharray and stroke-dashoffset
MozReview-Commit-ID: 4QKKzJ1DVYP
This commit is contained in:
parent
4d33761596
commit
ff08de8ad1
7 changed files with 89 additions and 4 deletions
|
@ -110,6 +110,22 @@ impl<T> Parse for Vec<T> where T: Parse + OneOrMoreCommaSeparated {
|
|||
}
|
||||
}
|
||||
|
||||
/// Parse a non-empty space-separated or comma-separated list of objects parsed by parse_one
|
||||
pub fn parse_space_or_comma_separated<F, T>(input: &mut Parser, mut parse_one: F)
|
||||
-> Result<Vec<T>, ()>
|
||||
where F: FnMut(&mut Parser) -> Result<T, ()> {
|
||||
let first = parse_one(input)?;
|
||||
let mut vec = vec![first];
|
||||
loop {
|
||||
let _ = input.try(|i| i.expect_comma());
|
||||
if let Ok(val) = input.try(|i| parse_one(i)) {
|
||||
vec.push(val)
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
Ok(vec)
|
||||
}
|
||||
impl Parse for UnicodeRange {
|
||||
fn parse(_context: &ParserContext, input: &mut Parser) -> Result<Self, ()> {
|
||||
UnicodeRange::parse(input)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue