diff options
author | Glenn Watson <gw@intuitionlibrary.com> | 2014-07-24 13:45:19 +1000 |
---|---|---|
committer | Glenn Watson <gw@intuitionlibrary.com> | 2014-07-24 13:45:19 +1000 |
commit | a500099df6d26dd1f46264160bb53a68f94dc608 (patch) | |
tree | eb652c75efec6f61cab7fa2fbb90bff637035bd0 | |
parent | c76cd128a7477cabdb81bb8814a78d45b34a92a0 (diff) | |
download | servo-a500099df6d26dd1f46264160bb53a68f94dc608.tar.gz servo-a500099df6d26dd1f46264160bb53a68f94dc608.zip |
Update font face to new url parser.
-rw-r--r-- | src/components/gfx/gfx.rs | 2 | ||||
-rw-r--r-- | src/components/style/font_face.rs | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/components/gfx/gfx.rs b/src/components/gfx/gfx.rs index d9510350d83..2754e774344 100644 --- a/src/components/gfx/gfx.rs +++ b/src/components/gfx/gfx.rs @@ -31,7 +31,7 @@ extern crate servo_util = "util"; extern crate servo_msg = "msg"; extern crate style; extern crate sync; -extern crate url; +extern crate url = "url_"; // Eventually we would like the shaper to be pluggable, as many operating systems have their own // shapers. For now, however, this is a hard dependency. diff --git a/src/components/style/font_face.rs b/src/components/style/font_face.rs index 353808f3772..069d232b354 100644 --- a/src/components/style/font_face.rs +++ b/src/components/style/font_face.rs @@ -8,8 +8,7 @@ use errors::{ErrorLoggerIterator, log_css_error}; use std::ascii::StrAsciiExt; use parsing_utils::one_component_value; use stylesheets::{CSSRule, CSSFontFaceRule}; -use url::Url; -use servo_util::url::parse_url; +use url::{Url, UrlParser}; #[deriving(PartialEq)] pub enum FontFaceFormat { @@ -80,7 +79,9 @@ pub fn parse_font_face_rule(rule: AtRule, parent_rules: &mut Vec<CSSRule>, base_ // url() or local() should be next let maybe_url = match iter.next() { Some(&URL(ref string_value)) => { - Some(parse_url(string_value.as_slice(), Some(base_url.clone()))) + // FIXME: handle URL parse errors more gracefully. + let url = UrlParser::new().base_url(base_url).parse(string_value.as_slice()).unwrap(); + Some(url) }, Some(&Function(ref string_value, ref _values)) => { match string_value.as_slice() { |