diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2018-05-20 14:13:32 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-20 14:13:32 -0400 |
commit | affcf81ce6156f0796b5e3a4332780135bbd51dd (patch) | |
tree | e0fd9c3d8d09336c50d2fda5ddae33d2eec2e925 /components/style/servo/url.rs | |
parent | 0b5720547e8ee0148d8482b04cfc0a5f71cca2f0 (diff) | |
parent | fade636ebeab55e9e7158a25abf117d86dad2130 (diff) | |
download | servo-affcf81ce6156f0796b5e3a4332780135bbd51dd.tar.gz servo-affcf81ce6156f0796b5e3a4332780135bbd51dd.zip |
Auto merge of #20838 - emilio:gecko-sync, r=emilio
style: Sync changes from mozilla-central.
See each individual commit for details.
Diffstat (limited to 'components/style/servo/url.rs')
-rw-r--r-- | components/style/servo/url.rs | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/components/style/servo/url.rs b/components/style/servo/url.rs index c0867122ae3..b4821f21e66 100644 --- a/components/style/servo/url.rs +++ b/components/style/servo/url.rs @@ -40,18 +40,14 @@ pub struct CssUrl { impl CssUrl { /// Try to parse a URL from a string value that is a valid CSS token for a - /// URL. Never fails - the API is only fallible to be compatible with the - /// gecko version. - pub fn parse_from_string<'a>( - url: String, - context: &ParserContext, - ) -> Result<Self, ParseError<'a>> { + /// URL. + pub fn parse_from_string(url: String, context: &ParserContext) -> Self { let serialization = Arc::new(url); let resolved = context.url_data.join(&serialization).ok(); - Ok(CssUrl { + CssUrl { original: Some(serialization), resolved: resolved, - }) + } } /// Returns true if the URL is definitely invalid. For Servo URLs, we can @@ -110,7 +106,7 @@ impl Parse for CssUrl { input: &mut Parser<'i, 't>, ) -> Result<Self, ParseError<'i>> { let url = input.expect_url()?; - Self::parse_from_string(url.as_ref().to_owned(), context) + Ok(Self::parse_from_string(url.as_ref().to_owned(), context)) } } |