mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Move Parse impl of SpecifiedUrl into corresponding files.
This commit is contained in:
parent
a99ca543cd
commit
d001fd9a0a
3 changed files with 18 additions and 13 deletions
|
@ -102,6 +102,15 @@ impl SpecifiedUrl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 {}
|
||||||
|
|
||||||
impl MallocSizeOf for SpecifiedUrl {
|
impl MallocSizeOf for SpecifiedUrl {
|
||||||
fn size_of(&self, _ops: &mut MallocSizeOfOps) -> usize {
|
fn size_of(&self, _ops: &mut MallocSizeOfOps) -> usize {
|
||||||
// XXX: measure `serialization` once bug 1397971 lands
|
// XXX: measure `serialization` once bug 1397971 lands
|
||||||
|
|
|
@ -102,6 +102,13 @@ impl SpecifiedUrl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 PartialEq for SpecifiedUrl {
|
impl PartialEq for SpecifiedUrl {
|
||||||
fn eq(&self, other: &Self) -> bool {
|
fn eq(&self, other: &Self) -> bool {
|
||||||
// TODO(emilio): maybe we care about equality of the specified values if
|
// TODO(emilio): maybe we care about equality of the specified values if
|
||||||
|
@ -110,6 +117,8 @@ impl PartialEq for SpecifiedUrl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Eq for SpecifiedUrl {}
|
||||||
|
|
||||||
impl ToCss for SpecifiedUrl {
|
impl ToCss for SpecifiedUrl {
|
||||||
fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
|
fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
|
||||||
where
|
where
|
||||||
|
|
|
@ -116,23 +116,10 @@ pub mod ui;
|
||||||
|
|
||||||
/// Common handling for the specified value CSS url() values.
|
/// Common handling for the specified value CSS url() values.
|
||||||
pub mod url {
|
pub mod url {
|
||||||
use cssparser::Parser;
|
|
||||||
use parser::{Parse, ParserContext};
|
|
||||||
use style_traits::ParseError;
|
|
||||||
|
|
||||||
#[cfg(feature = "servo")]
|
#[cfg(feature = "servo")]
|
||||||
pub use ::servo::url::*;
|
pub use ::servo::url::*;
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
pub use ::gecko::url::*;
|
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.
|
/// Parse a `<number>` value, with a given clamping mode.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue