Move Parse impl of SpecifiedUrl into corresponding files.

This commit is contained in:
Xidorn Quan 2018-03-08 21:31:06 +11:00
parent a99ca543cd
commit d001fd9a0a
3 changed files with 18 additions and 13 deletions

View file

@ -116,23 +116,10 @@ pub mod ui;
/// Common handling for the specified value CSS url() values.
pub mod url {
use cssparser::Parser;
use parser::{Parse, ParserContext};
use style_traits::ParseError;
#[cfg(feature = "servo")]
pub use ::servo::url::*;
#[cfg(feature = "gecko")]
pub use ::gecko::url::*;
impl Parse for SpecifiedUrl {
fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> {
let url = input.expect_url()?;
Self::parse_from_string(url.as_ref().to_owned(), context)
}
}
impl Eq for SpecifiedUrl {}
}
/// Parse a `<number>` value, with a given clamping mode.