mirror of
https://github.com/servo/servo.git
synced 2025-08-09 15:35:34 +01:00
Thread ParseError return values through CSS parsing.
This commit is contained in:
parent
58e39bfffa
commit
27ae1ef2e7
121 changed files with 2133 additions and 1505 deletions
|
@ -9,7 +9,7 @@ use cssparser::Parser;
|
|||
use parser::ParserContext;
|
||||
use properties::animated_properties::Animatable;
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use style_traits::{ToCss, ParseError};
|
||||
|
||||
/// A generic value for the `initial-letter` property.
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
|
@ -71,12 +71,12 @@ impl<Value> Spacing<Value> {
|
|||
|
||||
/// Parses.
|
||||
#[inline]
|
||||
pub fn parse_with<F>(
|
||||
pub fn parse_with<'i, 't, F>(
|
||||
context: &ParserContext,
|
||||
input: &mut Parser,
|
||||
input: &mut Parser<'i, 't>,
|
||||
parse: F)
|
||||
-> Result<Self, ()>
|
||||
where F: FnOnce(&ParserContext, &mut Parser) -> Result<Value, ()>
|
||||
-> Result<Self, ParseError<'i>>
|
||||
where F: FnOnce(&ParserContext, &mut Parser<'i, 't>) -> Result<Value, ParseError<'i>>
|
||||
{
|
||||
if input.try(|i| i.expect_ident_matching("normal")).is_ok() {
|
||||
return Ok(Spacing::Normal);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue